1 |
< |
/* Copyright (c) 1997 Silicon Graphics, Inc. */ |
1 |
> |
/* Copyright (c) 1998 Silicon Graphics, Inc. */ |
2 |
|
|
3 |
|
/* SCCSid "$SunId$ SGI" */ |
4 |
|
|
18 |
|
int4 bi; /* beam index (second) */ |
19 |
|
int4 nr; /* number of rays (third) */ |
20 |
|
int4 nc; /* number calculated (fourth) */ |
21 |
< |
RAYVAL ra[RPACKSIZ]; /* ray values (fourth) */ |
21 |
> |
RAYVAL ra[RPACKSIZ]; /* ray values (fifth) */ |
22 |
|
float *offset; /* offset array if !vbool(OBSTRUCTIONS) */ |
23 |
|
struct packet *next; /* next in packet list */ |
24 |
|
} PACKET; /* a beam packet */ |
33 |
|
#define packsiz(nr) (sizeof(PACKHEAD)+(nr)*sizeof(RAYVAL)) |
34 |
|
#define packra(p) ((RAYVAL *)((p)+1)) |
35 |
|
|
36 |
+ |
typedef struct { |
37 |
+ |
int nb; /* number of beams in list */ |
38 |
+ |
PACKHEAD *bl; /* allocated beam list */ |
39 |
+ |
} BEAMLIST; /* a list of beam requests */ |
40 |
+ |
|
41 |
+ |
typedef struct { |
42 |
+ |
FVECT vpt; /* view (eye point) position */ |
43 |
+ |
double rng; /* desired mean radius for sample rays */ |
44 |
+ |
} VIEWPOINT; /* target eye position */ |
45 |
+ |
|
46 |
|
/* input variables */ |
47 |
< |
#define RENDER 0 /* rendering options */ |
48 |
< |
#define SECTION 1 /* holodeck section boundaries */ |
49 |
< |
#define OCTREE 2 /* octree file name */ |
50 |
< |
#define RIF 3 /* rad input file */ |
51 |
< |
#define TIME 4 /* maximum rendering time */ |
52 |
< |
#define DISKSPACE 5 /* how much disk space to use */ |
53 |
< |
#define CACHE 6 /* amount of memory to use as cache */ |
54 |
< |
#define GRID 7 /* target grid size */ |
55 |
< |
#define OBSTRUCTIONS 8 /* shall we track obstructions? */ |
56 |
< |
#define VDIST 9 /* virtual distance calculation */ |
57 |
< |
#define OCCUPANCY 10 /* expected occupancy probability */ |
58 |
< |
#define REPORT 11 /* report interval and error file */ |
47 |
> |
#define CACHE 0 /* amount of memory to use as cache */ |
48 |
> |
#define DISKSPACE 1 /* how much disk space to use */ |
49 |
> |
#define EYESEP 2 /* eye separation distance */ |
50 |
> |
#define GEOMETRY 3 /* section geometry */ |
51 |
> |
#define GRID 4 /* target grid size */ |
52 |
> |
#define OBSTRUCTIONS 5 /* shall we track obstructions? */ |
53 |
> |
#define OCTREE 6 /* octree file name */ |
54 |
> |
#define PORTS 7 /* section portals */ |
55 |
> |
#define RENDER 8 /* rendering options */ |
56 |
> |
#define REPORT 9 /* report interval and error file */ |
57 |
> |
#define RIF 10 /* rad input file */ |
58 |
> |
#define SECTION 11 /* holodeck section boundaries */ |
59 |
> |
#define TIME 12 /* maximum rendering time */ |
60 |
> |
#define VDIST 13 /* virtual distance calculation */ |
61 |
|
|
62 |
< |
#define NRHVARS 12 /* number of variables */ |
62 |
> |
#define NRHVARS 14 /* number of variables */ |
63 |
|
|
64 |
|
#define RHVINIT { \ |
53 |
– |
{"render", 3, 0, NULL, catvalues}, \ |
54 |
– |
{"section", 3, 0, NULL, NULL}, \ |
55 |
– |
{"OCTREE", 3, 0, NULL, onevalue}, \ |
56 |
– |
{"RIF", 3, 0, NULL, onevalue}, \ |
57 |
– |
{"TIME", 2, 0, NULL, fltvalue}, \ |
58 |
– |
{"DISKSPACE", 3, 0, NULL, fltvalue}, \ |
65 |
|
{"CACHE", 2, 0, NULL, fltvalue}, \ |
66 |
+ |
{"DISKSPACE", 3, 0, NULL, fltvalue}, \ |
67 |
+ |
{"EYESEP", 3, 0, NULL, fltvalue}, \ |
68 |
+ |
{"geometry", 3, 0, NULL, NULL}, \ |
69 |
|
{"GRID", 2, 0, NULL, fltvalue}, \ |
70 |
|
{"OBSTRUCTIONS",3, 0, NULL, boolvalue}, \ |
71 |
< |
{"VDISTANCE", 2, 0, NULL, boolvalue}, \ |
72 |
< |
{"OCCUPANCY", 3, 0, NULL, onevalue}, \ |
71 |
> |
{"OCTREE", 3, 0, NULL, onevalue}, \ |
72 |
> |
{"portals", 3, 0, NULL, NULL}, \ |
73 |
> |
{"render", 3, 0, NULL, catvalues}, \ |
74 |
|
{"REPORT", 3, 0, NULL, onevalue}, \ |
75 |
+ |
{"RIF", 3, 0, NULL, onevalue}, \ |
76 |
+ |
{"section", 3, 0, NULL, NULL}, \ |
77 |
+ |
{"TIME", 2, 0, NULL, fltvalue}, \ |
78 |
+ |
{"VDISTANCE", 2, 0, NULL, boolvalue}, \ |
79 |
|
} |
80 |
|
|
81 |
|
/* bundle set requests */ |
83 |
|
#define BS_ADD 2 /* add to current set */ |
84 |
|
#define BS_ADJ 3 /* adjust current set quantities */ |
85 |
|
#define BS_DEL 4 /* delete from current set */ |
86 |
+ |
#define BS_MAX 5 /* set to max of old and new */ |
87 |
|
|
88 |
|
extern char *progname; /* our program name */ |
89 |
|
extern char *hdkfile; /* holodeck file name */ |
91 |
|
|
92 |
|
extern char *outdev; /* output device name */ |
93 |
|
|
94 |
+ |
extern int readinp; /* read input from stdin */ |
95 |
+ |
|
96 |
+ |
extern int force; /* allow overwrite of holodeck */ |
97 |
+ |
|
98 |
|
extern int nowarn; /* turn warnings off? */ |
99 |
|
|
100 |
< |
extern int ncprocs; /* number of compute processes */ |
100 |
> |
extern int ncprocs; /* number of requested compute processes */ |
101 |
> |
extern int nprocs; /* number of running compute processes */ |
102 |
|
|
103 |
< |
extern double expval; /* global exposure value */ |
103 |
> |
extern int chunkycmp; /* using "chunky" comparison mode */ |
104 |
|
|
105 |
+ |
extern VIEWPOINT myeye; /* target view position */ |
106 |
+ |
|
107 |
|
extern time_t starttime; /* time we got started */ |
108 |
|
extern time_t endtime; /* time we should end by */ |
109 |
|
extern time_t reporttime; /* time for next report */ |
110 |
|
|
111 |
+ |
extern long nraysdone; /* number of rays done */ |
112 |
+ |
extern long npacksdone; /* number of packets done */ |
113 |
+ |
|
114 |
|
extern int rtargc; /* rtrace command */ |
115 |
|
extern char *rtargv[]; |
116 |
|
|
117 |
|
extern PACKET *do_packets(), *get_packets(), *flush_queue(); |
118 |
+ |
|
119 |
+ |
extern int2 *viewbeams(); |