1 /* Copyright (C) 1992-1998 The Geometry Center
2 * Copyright (C) 1998-2000 Stuart Levy, Tamara Munzner, Mark Phillips
3 * Copyright (C) 2007 Claus-Justus Heine
4 *
5 * This file is part of Geomview.
6 *
7 * Geomview is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as published
9 * by the Free Software Foundation; either version 2, or (at your option)
10 * any later version.
11 *
12 * Geomview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with Geomview; see the file COPYING. If not, write
19 * to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139,
20 * USA, or visit http://www.gnu.org.
21 */
22
23
24 /* Authors: Charlie Gunn, Stuart Levy, Tamara Munzner, Mark Phillips */
25
26 #ifndef APPEARANCEDEF
27 #define APPEARANCEDEF
28
29 /*
30 #define AP_IDEBUG before #including this file to compile for
31 debugging
32 */
33
34 #include <stdarg.h>
35
36 #include "ooglutil.h"
37 #include "transobj.h"
38 #include "3d.h"
39 #include "color.h"
40 #include "streampool.h"
41 #include "dbllist.h"
42
43 #define DONE 1
44 #define ANOTHER 2
45
46 typedef struct LtLight {
47 REFERENCEFIELDS;
48 Color ambient;
49 Color color;
50 Point position; /* application-specified light position */
51 Point globalposition; /* real light position; set & used only by mg */
52 float intensity;
53
54 int Private; /* private part; used only by mg */
55
56 short location; /* How to interpret the "position": */
57 #define LTF_GLOBAL 0x0 /* global coordinate system */
58 #define LTF_CAMERA 0x1 /* camera coordinates */
59 #define LTF_LOCAL 0x2 /* local coordinates
60 * where appearance is attached. */
61
62 short changed;
63 } LtLight;
64
65
66 #define AP_MAXLIGHTS 8
67
68 typedef struct LmLighting {
69 REFERENCEFIELDS;
70 int valid, override; /* LMF_* inheritance bits */
71 Color ambient;
72 int localviewer;
73 float attenconst, attenmult, attenmult2;
74 LtLight *lights[AP_MAXLIGHTS];
75
76 int Private;
77 int changed;
78 } LmLighting;
79
80 #define LM_ANY_LIGHTS(lm) ((lm)->lights[0] != NULL)
81 #define LM_FOR_ALL_LIGHTS(lm, i,lp) for((i)=0, (lp) = &(lm)->lights[0]; \
82 (i)<AP_MAXLIGHTS && *(lp) != NULL; (i)++, (lp)++)
83
84 typedef struct Material {
85 REFERENCEFIELDS;
86 int valid, override; /* MTF_* inheritance bits */
87 Color emission;
88 Color ambient;
89 ColorA diffuse; /* diffuse.a === material alpha */
90 Color specular;
91 float shininess;
92 float ka, kd, ks;
93 Color edgecolor; /* Color for polygon edges and other vectors */
94 Color normalcolor; /* Color for surface-normal vectors */
95
96 int Private;
97 int changed;
98 } Material;
99
100 /* The pixmap image underlying a texture. We define a separate
101 * Lisp-object such that sharing of image data is possible (and can be
102 * implemented more cleanly than before).
103 *
104 * The image format does not interprete the image data, it just
105 * records the number of channels. However: the corresponding I/O
106 * routines always read data in RGB(A) format, or LUMINANCE(-ALPHA)
107 * format.
108 *
109 * The pixmap is in Cartesian coordinates, i.e. row 0/col 0
110 * corresponds to the LOWER-LEFT corner.
111 */
112 typedef struct Image {
113 REFERENCEFIELDS;
114 int width; /* width in pixels */
115 int height; /* height in pixels */
116 int channels; /* number of channels */
117 int maxval; /* maximum intensity value of a channel */
118 char *data; /* image data, row by row, if depth > 8 then the
119 * most significant byte comes first (BIG-ENDIAN).
120 */
121 } Image;
122
123 typedef struct TxUser TxUser;
124
125 /* Textures are bulky and need active management! */
126 struct TxUser {
127 struct TxUser *next; /* Next user in tx->users list */
128 struct Texture *tx; /* Which texture is ours? */
129 int id; /* Slot for e.g. graphics-system texture id */
130 void *ctx; /* Slot for e.g. mg context */
131 void *data; /* Any other data the user needs */
132 int flags; /* flags for user to determine usage */
133 int (*needed)(TxUser *); /* user answers "d'you still need this?" */
134 void (*purge)(TxUser *); /* request to user to purge this texture */
135 };
136
137 typedef struct Texture {
138 REFERENCEFIELDS;
139 Image *image; /* underlying pixmap */
140 Handle *imghandle;
141 Transform tfm; /* texture-coord transformation */
142 Handle *tfmhandle;
143 unsigned int flags; /* clamp, etc. */
144 enum apply_enum {
145 tx_modulate,
146 tx_decal,
147 tx_blend,
148 tx_replace
149 } apply; /* Application style
150 * (TXF_DECAL, TXF_MODULATE, TXF_BLEND, TXF_REPLACE)
151 */
152 Color background; /* background color for TXF_BLEND */
153 TxUser *users; /* Users of this texture register here */
154 #if 0
155 int coords; /* Texture-coord auto generation (not implemented) */
156 #endif
157 /*****************************************/
158 /* the old and deprecated way to do stuff */
159 char *filename; /* ppm or pgm (.Z) file */
160 char *alphafilename; /* If present, this is a .pgm (.Z) file */
161 /*****************************************/
162 DblListNode loadnode;
163 } Texture;
164
165 extern DblListNode AllLoadedTextures; /* List of em */
166
167 typedef struct Appearance {
168 REFERENCEFIELDS;
169 Material *mat, *backmat; /* material properties */
170 LmLighting *lighting; /* attached lighting */
171 Texture *tex; /* Texture-map object */
172 unsigned int flag; /* APF_* shading,faces/edges,normals,transparency */
173 unsigned int valid; /* APF_* bits control inheritance of these fields */
174 unsigned int override; /* same APF_* flags: parent overrides child */
175 float nscale; /* scale factor for drawing normals */
176 int linewidth; /* how wide do lines appear (pixels) ? */
177 enum {
178 apf_constant = 0,
179 apf_flat,
180 apf_smooth,
181 apf_csmooth,
182 apf_vcflat,
183 apf_num_shadings
184 } shading;
185 enum {
186 apf_alpha_blending = 0, /* translucency using alpha-blending. */
187 apf_screen_door, /* translucency by stipple patterns. */
188 apf_naive_blending,
189 apf_num_translucencies
190 } translucency;
191 int dice[2]; /* u, v patch dicing parameters */
192 } Appearance;
193
194 extern HandleOps AppearanceOps;
195 extern HandleOps ImageOps;
196 extern HandleOps TextureOps;
197
198 /* the following tokens are used in LtSet and LtGet */
199 #define LT_END 700
200 #define LT_AMBIENT 701 /* Color ambient */
201 #define LT_COLOR 702 /* Color color */
202 #define LT_POSITION 703 /* Point position */
203 #define LT_INTENSITY 704 /* double intensity */
204 #define LT_LOCATION 705 /* int location: LTF_{GLOBAL,CAMERA,LOCAL} */
205
206 #define LT_ABLOCK 706 /* void **ablock ??? cH: unimplemented ??? */
207
208
209 /* the following tokens are used in LmSet and LmGet */
210 #define LM_END 600
211 #define LM_AMBIENT 601 /* Color ambient */
212 #define LM_LOCALVIEWER 602 /* int localviewer */
213 #define LM_ATTENC 603 /* double attenconst */
214 #define LM_ATTENM 604 /* double attenmult */
215 #define LM_ATTEN2 612 /* double attenmult2 */
216 #define LM_LtSet 605 /* ... */
217 #define LM_LIGHT 606 /* LtLight *light */
218 #define LM_VALID 607 /* int mask (Get only) */
219 #define LM_INVALID 608 /* int mask (unsets valid bits) */
220 #define LM_OVERRIDE 609 /* int mask (sets override bits) */
221 #define LM_NOOVERRIDE 610 /* int mask (unsets override bits) */
222 #define LM_REPLACELIGHTS 611 /* int replace */
223
224 #define LM_ABLOCK 613 /* void **ablock ??? cH: unimplemented ??? */
225
226
227 /* the following tokens are used in MtSet and MtGet */
228 #define MT_END 500
229 #define MT_EMISSION 501 /* Color *emission */
230 #define MT_AMBIENT 502 /* Color *ambient */
231 #define MT_DIFFUSE 503 /* Color *diffuse */
232 #define MT_SPECULAR 504 /* Color *specular */
233 #define MT_Ka 505 /* double ka */
234 #define MT_Kd 506 /* double kd */
235 #define MT_Ks 507 /* double ks */
236 #define MT_ALPHA 508 /* double alpha */
237 #define MT_SHININESS 509 /* double shininess */
238 #define MT_EDGECOLOR 510 /* Color *edgecolor (for edges & vectors) */
239 #define MT_NORMALCOLOR 511 /* Color *normalcolor (for surface normals) */
240 #define MT_VALID 512 /* int mask (Get only) */
241 #define MT_INVALID 513 /* int mask (unsets valid bits) */
242 #define MT_OVERRIDE 514 /* int mask (sets override bits) */
243 #define MT_NOOVERRIDE 515 /* int mask (unsets override bits) */
244
245 #define MT_ABLOCK 516 /* void **ablock ??? cH: unimplemented ??? */
246
247
248 /* the following tokens are used in ApSet and ApGet */
249 #define AP_END 400
250 #define AP_DO 401 /* int mask (set flag bits) */
251 #define AP_DONT 402 /* int mask (unset flag bits) */
252 #define AP_MAT 403 /* Material *mat */
253 #define AP_MtSet 404 /* ... */
254 #define AP_LGT 405 /* LmLighting *lgt */
255 #define AP_LmSet 406 /* ... */
256 #define AP_NORMSCALE 407 /* float nscale */
257 #define AP_LINEWIDTH 408 /* int linewidth */
258 #define AP_VALID 409 /* int mask (Get only) */
259 #define AP_INVALID 410 /* int mask (unsets valid bits) */
260 #define AP_OVERRIDE 411 /* int mask (sets override bits) */
261 #define AP_NOOVERRIDE 412 /* int mask (unsets override bits) */
262 #define AP_SHADING 413 /* int shading (set to APF_{CONSTANT,FLAT,SMOOTH} */
263 #define AP_BACKMAT 414 /* Material *backmaterial */
264
265 #define AP_ABLOCK 415 /* void **ablock ??? cH: unimplemented ??? */
266 #define AP_DICE 416 /* int udice, vdice (set); int dice[2] (get) */
267 #define AP_TEXTURE 417 /* Texture *tx */
268 #define AP_TxSet 418 /* ... */
269
270 /* int translucency (set to APF_{ALPHA_BLENDING,SCREEN_DOOR,NAIVE_BLENDING} */
271 #define AP_TRANSLUCENCY 419
272
273 /* Flags to ApMerge, etc. */
274 #define APF_INPLACE 0x1 /* Merge in place */
275 #define APF_OVEROVERRIDE 0x2 /* src replaces dst even without src override */
276
277
278
279 /* This model of texture-mapping shamelessly stolen
280 * from GL/Open-GL
281 */
282
283 #define TXMAGIC OOGLMagic('t', 1)
284
285 #define TX_DOCLAMP 450
286 #define TXF_SCLAMP 0x1 /* Clamp if s outside 0..1 (else wrap) */
287 #define TXF_TCLAMP 0x2 /* Clamp if t outside 0..1 (else wrap) */
288
289 #define TXF_LOADED 0x4 /* Has this texture been loaded?
290 * (tried to read those files yet?)
291 */
292 #define TXF_RGBA 0x8 /* In loaded data, is R first byte? (else ABGR) */
293 #define TXF_USED 0x10 /* "Recently rendered a geom containing this texture"*/
294
295 #define TX_APPLY 451 /* Interpret texture values to... */
296 #define TXF_MODULATE tx_modulate
297 #define TXF_DECAL tx_decal
298 #define TXF_BLEND tx_blend
299 #define TXF_REPLACE tx_replace
300
301 #define TX_HANDLE_IMAGE 452
302 #define TX_HANDLE_TRANSFORM 453
303 #define TX_BACKGROUND 454
304
305 #define TX_FILE 455 /* deprecated (really?) */
306 #define TX_ALPHAFILE 456 /* deprecated (really?) */
307 #define TX_CHANNELS 457 /* deprecated (really?) */
308 #define TX_XSIZE 458 /* deprecated (really?) */
309 #define TX_YSIZE 459 /* deprecated (really?) */
310
311 #if 0 /* not implemented */
312 #define TX_COORDS 458 /* Texture coordinates come from... */
313 #define TXF_COORD_GIVEN 0 /* given as part of object (default) In
314 * fact, only TXF_COORD_GIVEN works now.
315 */
316 # define TXF_COORD_LOCAL 1 /* In coord system of texture map */
317 # define TXF_COORD_CAMERA 2 /* In camera coords */
318 # define TXF_COORD_NORMAL 3 /* Taken from surface-normal, for env map */
319 #endif
320
321 #define TX_ABLOCK 464 /* ??? cH: unimplemented ??? */
322 #define TX_END 465
323
324 #define IMGMAGIC OOGLMagic('i', 1)
325
326 /* ImgSet() commands */
327 #define IMG_WIDTH 1000
328 #define IMG_HEIGHT 1001
329 #define IMG_CHANNELS 1002
330 #define IMG_MAXVAL 1003
331 #define IMG_DATA 1004
332 #define IMG_DATA_CHAN_FILE 1005 /* CHMASK, FILTER/NULL, FILENAME */
333 #define IMG_DATA_CHAN_DATA 1006 /* CHMASK, FILTER/NULL, DATA, DATASZ */
334 #define IMGF_LUMINANCE 0x1
335 #define IMGF_LUMINANCE_ALPHA 0x3
336 #define IMGF_RGB 0x7
337 #define IMGF_RGBA 0xf
338 #define IMGF_ALPHA 0x100
339 #define IMGF_AUTO 0x200
340 #define IMG_END 1042
341
342 typedef struct TxST
343 {
344 float s;
345 float t;
346 } TxST;
347
348 /* Transformation of (s,t)-texture co-ordinates. (s,t,r,q) with r = 0,
349 * q = 1
350 */
TxSTTransform(Transform T,TxST * in,TxST * out)351 static inline void TxSTTransform(Transform T, TxST *in, TxST *out)
352 {
353 float s, t, q;
354
355 if (T == NULL || T == TM_IDENTITY) {
356 *out = *in;
357 return;
358 }
359
360 s = in->s;
361 t = in->t;
362 q = T[TMX][TMW]*s + T[TMY][TMW]*t + T[TMW][TMW];
363
364 if(q != 1.0) {
365 q = 1.0 / q;
366 out->s = q * (s*T[TMX][TMX] + t*T[TMY][TMX] + T[TMW][TMX]);
367 out->t = q * (s*T[TMX][TMY] + t*T[TMY][TMY] + T[TMW][TMY]);
368 } else {
369 out->s = s*T[TMX][TMX] + t*T[TMY][TMX] + T[TMW][TMX];
370 out->t = s*T[TMX][TMY] + t*T[TMY][TMY] + T[TMW][TMY];
371 }
372 }
373
374 Appearance * ApCreate( int attr, ... );
375 Appearance * ApSet( Appearance *ap, int attr, ... );
376 Appearance * _ApSet(Appearance *ap, int attr1, va_list *alist);
377 int ApGet( Appearance *ap, int attr, void *valuep );
378 void ApDelete( Appearance *ap );
379 Appearance * ApDefault( Appearance *ap );
380 Appearance * ApCopy(const Appearance *from, Appearance *into );
381 Appearance * ApMerge(const Appearance *src, Appearance *dst, int inplace );
382 Appearance * ApFLoad(IOBFILE *inf, char *fname);
383 Appearance * ApCopyShared(const Appearance *ap, Appearance *into );
384 Appearance * ApFSave(Appearance *ap, FILE *f, char *fname);
385 int ApStreamIn(Pool *p, Handle **hp, Appearance **app);
386 int ApStreamOut(Pool *p, Handle *h, Appearance *ap);
387
388 /* Force 'override' bits on (for all valid fields)
389 * or off, in an Appearance.
390 */
391 void ApUseOverrides( Appearance *ap, int use_overrides );
392
393 /* Erase fields in 'dst' corresponding to any in 'src';
394 * allows 'src' settings to propagate through 'dst',
395 * when 'dst' is its child.
396 */
397 void ApLetPropagate( Appearance *src, Appearance *dst );
398
399 int TxStreamIn( Pool *, Handle **, Texture ** );
400 int TxStreamOut( Pool *, Handle *, Texture * );
401 void TxDelete( Texture * );
402
403 int ImgStreamIn(Pool *p, Handle **hp, Image **imgp);
404 int ImgStreamOut(Pool *p, Handle *h, Image *tx);
405 Image *ImgFSave(Image *img, FILE *outf, char *fname);
406 void ImgDelete(Image *img);
407 Image *ImgCreate(int a1, ...);
408 int ImgWritePGM(Image *img, int channel, bool compressed, char **buffer);
409 int ImgWritePNM(Image *img, unsigned chmask, bool compressed, char **buffer);
410 int ImgWritePAM(Image *img, unsigned chmask, bool compressed, char **buffer);
411 bool ImgWriteFilter(Image *img, unsigned chmask, const char *filter);
412
413 Texture * TxFLoad( IOBFILE *inf, char *fname );
414 Texture * TxFSave(Texture *tx, FILE *outf, char *fname);
415 Texture * TxSet( Texture *, int attr, ... );
416 Texture * TxCreate( int attr, ... );
417 Texture * TxCopy( Texture *src, Texture *dst );
418 Texture * TxMerge( Texture *src, Texture *dst, int mergeflags );
419
420 void TxPurge( Texture * );
421 TxUser *TxAddUser(Texture *, int id,
422 int (*needed)(TxUser *), void (*purge)(TxUser *));
423 void TxRemoveUser(TxUser *user);
424
425 #ifndef AP_IDEBUG
426 Material * MtCreate( int attr, ... );
427 Material * MtSet( Material *, int attr, ... );
428 #endif
429 int MtGet( Material *, int attr, void *valuep );
430
431 void MtDelete( Material * );
432 Material * MtDefault( Material * );
433 Material * MtLoad( Material *, char *filename );
434 Material * MtCopy( Material *from, Material *into );
435 Material * MtMerge( Material *src, Material *dst, int inplace );
436 Material * MtFLoad( Material *into, IOBFILE *stream, char *filename );
437 int MtSave( Material *, char *filename );
438 int MtFSave( Material *mat, FILE *stream, Pool *p );
439 void MtPrint( Material * );
440
441
442 #ifndef AP_IDEBUG
443 LtLight * LtCreate( int attr, ... );
444 LtLight * LtSet( LtLight *, int attr, ... );
445 #endif
446 int LtGet( LtLight *, int attr, void *valuep );
447 void LtDelete( LtLight * );
448 LtLight * LtCopy( LtLight *, LtLight * );
449 LtLight * LtMerge( LtLight *, LtLight * );
450 LtLight * LtDefault( LtLight * );
451 void LtProperties( LtLight *, float, Color *, Point * );
452 LtLight * LtFLoad( LtLight *, IOBFILE *, char *filename);
453
454 #define LTMAGIC OOGLMagic('l', 2)
455
456 #ifndef AP_IDEBUG
457 LmLighting * LmCreate( int attr, ... );
458 LmLighting * LmSet( LmLighting *, int attr, ... );
459 #endif
460 int LmGet( LmLighting *, int attr, void *valuep );
461 void LmDelete( LmLighting * );
462 void LmDelete( LmLighting * );
463 void LmDefault( LmLighting * );
464 LmLighting * LmLoad( LmLighting *, char *filename );
465 LmLighting * LmFLoad( LmLighting *, IOBFILE *, char *filename );
466 void LmSave( LmLighting *, char *filename );
467 void LmFSave( LmLighting *, FILE *, char *filename, Pool *p );
468 LmLighting * LmMerge( LmLighting *src, LmLighting *dst, int inplace );
469 LmLighting * LmCopy( LmLighting *src, LmLighting *dst );
470 void LmAddLight( LmLighting *dst, LtLight *light );
471 void LmRemoveLight( LmLighting *dst, LtLight *light );
472 void LmCopyLights( LmLighting *src, LmLighting *dst );
473 void LmDeleteLights( LmLighting *lm );
474
475 #define LIGHTINGMAGIC OOGLMagic('l', 1)
476
477 #define LMF_LOCALVIEWER 0x1 /* Local viewer (flag valid) */
478 #define LMF_AMBIENT 0x2 /* Ambient light color */
479 #define LMF_ATTENC 0x4 /* attenuation constant factor */
480 #define LMF_ATTENM 0x8 /* attenuation linear factor */
481 #define LMF_ATTEN2 0x20 /* 1/r^2 attenuation factor */
482 #define LMF_REPLACELIGHTS 0x10 /* When merging, use only new lights, not union */
483
484 #define MATMAGIC OOGLMagic('m', 1)
485
486 #define MTF_EMISSION 0x1
487 #define MTF_AMBIENT 0x2
488 #define MTF_DIFFUSE 0x4
489 #define MTF_SPECULAR 0x8
490 #define MTF_Ka 0x10
491 #define MTF_Kd 0x20
492 #define MTF_Ks 0x40
493 #define MTF_ALPHA 0x80
494 #define MTF_SHININESS 0x100
495 #define MTF_EDGECOLOR 0x200
496 #define MTF_NORMALCOLOR 0x400
497
498
499
500 #define APMAGIC OOGLMagic('a', 1)
501
502 /* The following bits are used in 'flag', 'valid', 'override' */
503 #define APF_FACEDRAW 0x2 /* Draw faces */
504 #define APF_EDGEDRAW 0x10 /* Draw edges */
505 #define APF_TRANSP 0x20 /* Enable transparency */
506 #define APF_TRANSLUCENT APF_TRANSP /* "transparent" is the wrong word */
507 #define APF_EVERT 0x40 /* Evert surface normals */
508 #define APF_NORMALDRAW 0x80 /* Draw surface normals */
509 #define APF_VECTDRAW 0x100 /* Draw vectors/points */
510 #define APF_KEEPCOLOR 0x200 /* Not susceptible to N-D coloring */
511 #define APF_TEXTURE 0x400 /* Enable texture mapping */
512 #define APF_BACKCULL 0x800 /* Enable back-face culling */
513 #define APF_SHADELINES 0x2000 /* Enable line (edge & vect) lighting&shading */
514 #define APF_CONCAVE 0x4000 /* Expect concave polygons */
515 #define APF_TXMIPMAP 0x8000 /* Mip-mapped textures */
516 #define APF_TXMIPINTERP 0x10000 /* Interpolate between mipmaps */
517 #define APF_TXLINEAR 0x20000 /* Interpolate between texture pixels */
518
519 /* The following bits are used in 'valid', 'override' */
520 #define APF_SHADING 0x1 /* Use 'shading' value */
521 #define APF_NORMSCALE 0x4 /* Use 'nscale' value to draw normals */
522 #define APF_LINEWIDTH 0x8 /* Use 'linewidth' value */
523 #define APF_DICE 0x1000 /* Dicing (use udice, vdice fields) */
524
525 /* Possible values for ap->shading field; these MUST be consecutive !!
526 (code outside the appearance library depends on this fact) */
527 #define APF_CONSTANT apf_constant /* constant-colored (unlighted) faces */
528 #define APF_FLAT apf_flat /* Flat-shaded, lighted faces */
529 #define APF_SMOOTH apf_smooth /* Gouraud-shaded faces, with lighting */
530 #define APF_CSMOOTH apf_csmooth /* Gouraud-shaded faces, without lighting */
531 #define APF_VCFLAT apf_vcflat /* Gouraud-coloured, but flat faces */
532 #define APF_NUM_SHADINGS apf_num_shadings
533
534 #define IS_SMOOTH(shading) ((shading) >= APF_SMOOTH)
535 #define IS_SHADED(shading) \
536 ((1<<(shading)) & ((1<<APF_FLAT)|(1<<APF_SMOOTH)|(1<<APF_VCFLAT)))
537
538 /* Possible values for ap->translucency; ALPHA_BLENDING requests
539 * alpha-blending with correct ordering of faces, SCREEN_DOOR requests
540 * masking by a stipple patterns, NAIVE_BLENDING requests
541 * alpha-blending without sorting the polygons.
542 */
543 #define APF_ALPHA_BLENDING apf_alpha_blending
544 #define APF_SCREEN_DOOR apf_screen_door
545 #define APF_NAIVE_BLENDING apf_naive_blending
546
547 #ifdef AP_IDEBUG
548
549 Appearance * ApCreate();
550 Appearance * ApSet();
551 Material * MtCreate();
552 Material * MtSet();
553 LtLight * LtCreate();
554 LtLight * LtSet();
555 LmLighting * LmCreate();
556 LmLighting * LmSet();
557
558 int lt_end = LT_END;
559 int lt_ambient = LT_AMBIENT;
560 int lt_color = LT_COLOR;
561 int lt_position = LT_POSITION;
562 int lt_intensity = LT_INTENSITY;
563
564 int lm_end = LM_END;
565 int lm_ambient = LM_AMBIENT;
566 int lm_localviewer = LM_LOCALVIEWER;
567 int lm_attenc = LM_ATTENC;
568 int lm_attenm = LM_ATTENM;
569 int lm_ltset = LM_LtSet;
570 int lm_light = LM_LIGHT;
571 int lm_valid = LM_VALID;
572 int lm_invalid = LM_INVALID;
573 int lm_override = LM_OVERRIDE;
574 int lm_nooverride = LM_NOOVERRIDE;
575
576 int mt_end = MT_END;
577 int mt_emission = MT_EMISSION;
578 int mt_ambient = MT_AMBIENT;
579 int mt_diffuse = MT_DIFFUSE;
580 int mt_specular = MT_SPECULAR;
581 int mt_ka = MT_Ka;
582 int mt_kd = MT_Kd;
583 int mt_ks = MT_Ks;
584 int mt_alpha = MT_ALPHA;
585 int mt_shininess = MT_SHININESS;
586 int mt_valid = MT_VALID;
587 int mt_invalid = MT_INVALID;
588 int mt_override = MT_OVERRIDE;
589 int mt_nooverride = MT_NOOVERRIDE;
590
591 int ap_end = AP_END;
592 int ap_do = AP_DO;
593 int ap_dont = AP_DONT ;
594 int ap_mat = AP_MAT;
595 int ap_mtset = AP_MtSet;
596 int ap_lgt = AP_LGT;
597 int ap_lmset = AP_LmSet;
598 int ap_normscale = AP_NORMSCALE;
599 int ap_linewidth = AP_LINEWIDTH;
600 int ap_valid = AP_VALID;
601 int ap_invalid = AP_INVALID;
602 int ap_override = AP_OVERRIDE;
603 int ap_nooverride = AP_NOOVERRIDE;
604 int ap_shading = AP_SHADING;
605
606 int lmf_localviewer = LMF_LOCALVIEWER;
607 int lmf_ambient = LMF_AMBIENT;
608 int lmf_attenc = LMF_ATTENC;
609 int lmf_attenm = LMF_ATTENM;
610 int lmf_replacelights = LMF_REPLACELIGHTS;
611
612 int mtf_emission = MTF_EMISSION;
613 int mtf_ambient = MTF_AMBIENT;
614 int mtf_diffuse = MTF_DIFFUSE;
615 int mtf_specular = MTF_SPECULAR;
616 int mtf_ka = MTF_Ka;
617 int mtf_kd = MTF_Kd;
618 int mtf_ks = MTF_Ks;
619 int mtf_alpha = MTF_ALPHA;
620 int mtf_shininess = MTF_SHININESS;
621
622 int apf_facedraw = APF_FACEDRAW;
623 int apf_edgedraw = APF_EDGEDRAW;
624 int apf_transp = APF_TRANSP;
625 int apf_transmaskp = APF_TRANSMASKP;
626 int apf_evert = APF_EVERT;
627
628 int apf_shading = APF_SHADING;
629 int apf_normscale = APF_NORMSCALE;
630 int apf_linewidth = APF_LINEWIDTH;
631
632 int apf_constant = APF_CONSTANT;
633 int apf_flat = APF_FLAT;
634 int apf_smooth = APF_SMOOTH;
635
636 #endif /* AP_IDEBUG */
637
638 #endif /* APPEARANCEDEF */
639
640 /*
641 * Local Variables: ***
642 * mode: c ***
643 * c-basic-offset: 4 ***
644 * End: ***
645 */
646