1 | # Copyright (c) 2001, Stanford University
|
---|
2 | # All rights reserved.
|
---|
3 | #
|
---|
4 | # See the file LICENSE.txt for information on redistributing this software.
|
---|
5 | :colorMaterial:colorMaterialFace,colorMaterialMode:ColorMaterial
|
---|
6 | :enable:lighting:GL_LIGHTING
|
---|
7 | :enable:colorMaterial:GL_COLOR_MATERIAL
|
---|
8 | :enable:colorSumEXT:GL_COLOR_SUM_EXT
|
---|
9 | :shadeModel:shadeModel:ShadeModel
|
---|
10 | :lightModel:lightModelAmbient|r,g,b,a:LightModelfv,GL_LIGHT_MODEL_AMBIENT
|
---|
11 | :lightModel:lightModelLocalViewer:*diff_api.LightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, to->lightModelLocalViewer==GL_TRUE);
|
---|
12 | :lightModel:lightModelTwoSide:*diff_api.LightModeli(GL_LIGHT_MODEL_TWO_SIDE, to->lightModelTwoSide==GL_TRUE);
|
---|
13 | :lightModel:lightModelColorControlEXT:*diff_api.LightModeli(GL_LIGHT_MODEL_COLOR_CONTROL_EXT, to->lightModelColorControlEXT);
|
---|
14 | %flush
|
---|
15 | :material:ambient[0]|r,g,b,a:Materialfv, GL_FRONT, GL_AMBIENT
|
---|
16 | :material:ambient[1]|r,g,b,a:Materialfv, GL_BACK, GL_AMBIENT
|
---|
17 | :material:diffuse[0]|r,g,b,a:Materialfv, GL_FRONT, GL_DIFFUSE
|
---|
18 | :material:diffuse[1]|r,g,b,a:Materialfv, GL_BACK, GL_DIFFUSE
|
---|
19 | :material:specular[0]|r,g,b,a:Materialfv, GL_FRONT, GL_SPECULAR
|
---|
20 | :material:specular[1]|r,g,b,a:Materialfv, GL_BACK, GL_SPECULAR
|
---|
21 | :material:emission[0]|r,g,b,a:Materialfv, GL_FRONT, GL_EMISSION
|
---|
22 | :material:emission[1]|r,g,b,a:Materialfv, GL_BACK, GL_EMISSION
|
---|
23 | :material:shininess[0]:Materialf, GL_FRONT, GL_SHININESS
|
---|
24 | :material:shininess[1]:Materialf, GL_BACK, GL_SHININESS
|
---|
25 | %flush
|
---|
26 | >for (i=0; i<CR_MAX_LIGHTS; i++) {
|
---|
27 | >CRLightBits *lb = b->light+i;
|
---|
28 | >CRLight *tl = to->light+i;
|
---|
29 | >CRLight *cl = from->light+i;
|
---|
30 | >if (!(CHECKDIRTY(lb->dirty, bitID))) continue;
|
---|
31 | %target=tl
|
---|
32 | %current=cl
|
---|
33 | %bit=lb
|
---|
34 | %extrabit=b
|
---|
35 | :enable:enable:GL_LIGHT0+i
|
---|
36 | %flush
|
---|
37 | :ambient:ambient|r,g,b,a:Lightfv, GL_LIGHT0+i, GL_AMBIENT
|
---|
38 | :diffuse:diffuse|r,g,b,a:Lightfv, GL_LIGHT0+i, GL_DIFFUSE
|
---|
39 | :specular:specular|r,g,b,a:Lightfv, GL_LIGHT0+i, GL_SPECULAR
|
---|
40 | :attenuation:constantAttenuation:Lightf, GL_LIGHT0+i, GL_CONSTANT_ATTENUATION
|
---|
41 | :attenuation:linearAttenuation:Lightf, GL_LIGHT0+i, GL_LINEAR_ATTENUATION
|
---|
42 | :attenuation:quadraticAttenuation:Lightf, GL_LIGHT0+i, GL_QUADRATIC_ATTENUATION
|
---|
43 | :position:*diff_api.MatrixMode(GL_MODELVIEW);
|
---|
44 | :position:*diff_api.PushMatrix();
|
---|
45 | :position:*diff_api.LoadIdentity();
|
---|
46 | :position:position|x,y,z,w:Lightfv, GL_LIGHT0+i, GL_POSITION
|
---|
47 | :position:*diff_api.PopMatrix();
|
---|
48 | :position:*diff_api.MatrixMode(toCtx->transform.matrixMode);
|
---|
49 | :spot:*diff_api.MatrixMode(GL_MODELVIEW);
|
---|
50 | :spot:*diff_api.PushMatrix();
|
---|
51 | :spot:*diff_api.LoadIdentity();
|
---|
52 | :spot:spotDirection|x,y,z:Lightfv, GL_LIGHT0+i, GL_SPOT_DIRECTION
|
---|
53 | :spot:spotExponent:Lightf, GL_LIGHT0+i, GL_SPOT_EXPONENT
|
---|
54 | :spot:spotCutoff:Lightf, GL_LIGHT0+i, GL_SPOT_CUTOFF
|
---|
55 | :spot:*diff_api.PopMatrix();
|
---|
56 | :spot:*diff_api.MatrixMode(toCtx->transform.matrixMode);
|
---|
57 | %flush
|
---|
58 | >CLEARDIRTY(lb->dirty, nbitID);
|
---|
59 | >}
|
---|
60 | %target=to
|
---|
61 | %current=from
|
---|
62 | %bit=b
|
---|
63 | %extrabit=
|
---|