/[gzz]/gzz/gfx/libtexture/TubeConnector.texture
ViewVC logotype

Diff of /gzz/gfx/libtexture/TubeConnector.texture

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by jvk, Wed Aug 7 10:24:00 2002 UTC revision 1.2 by tjl, Wed Sep 4 18:05:43 2002 UTC
# Line 10  void GENERATE(TextureParam *params, int Line 10  void GENERATE(TextureParam *params, int
10    float x, y;    float x, y;
11    int ind = 0, i, j;    int ind = 0, i, j;
12    
13      enum { AMBIENT = 0, DIFFUSE, SPECULAR, SHADOW };
14    int type = params->getStringEnum("light",  0, "ambient", "diffuse", "specular", "shadow", 0);    int type = params->getStringEnum("light",  0, "ambient", "diffuse", "specular", "shadow", 0);
15    int power = (int)params->getFloat("power", 8);    int power = (int)params->getFloat("power", 8);
16    
# Line 32  void GENERATE(TextureParam *params, int Line 33  void GENERATE(TextureParam *params, int
33        float alpha = d > .5 ? 0 : d > -.5 ? .5 - d : 1;        float alpha = d > .5 ? 0 : d > -.5 ? .5 - d : 1;
34        float dot;        float dot;
35    
36        if (type == 3) {        if (type == SHADOW) {
37          float d = fabs(y) - r;          float d = fabs(y) - r;
38          alpha = .7 * (d < -.5 ? 1 : 1 - (d + .5) * (d + .5) * (d + .5) * (d + .5) * 16);          alpha = .7 * (d < -.5 ? 1 : 1 - (d + .5) * (d + .5) * (d + .5) * (d + .5) * 16);
39          dot = 0;          dot = 0;
# Line 40  void GENERATE(TextureParam *params, int Line 41  void GENERATE(TextureParam *params, int
41    
42        alpha *= h;        alpha *= h;
43    
44        if (type == 0) {        if (type == AMBIENT) {
45          dot = 1;          dot = 1;
46        }        }
47        else dot = f > 0 ? 1 / sqrt(dx * dx + dy * dy + 1) : 0;        else dot = f > 0 ? 1 / sqrt(dx * dx + dy * dy + 1) : 0;
48    
49        if (type == 2) {        if (type == SPECULAR) {
50          for (int p = power; p >>= 1; )          for (int p = power; p >>= 1; )
51            dot *= dot;            dot *= dot;
52        }        }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26