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

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

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

revision 1.3 by tjl, Thu Sep 5 11:19:32 2002 UTC revision 1.4 by tjl, Thu Sep 5 11:54:50 2002 UTC
# Line 12  void GENERATE(TextureParam *params, int Line 12  void GENERATE(TextureParam *params, int
12    int power = (int)params->getFloat("power", 8);    int power = (int)params->getFloat("power", 8);
13    float shadow = params->getFloat("shadowlen", 0.5);    float shadow = params->getFloat("shadowlen", 0.5);
14    
15    
16    FPARAM(spec_low, 0.85);    FPARAM(spec_low, 0.85);
17    FPARAM(spec_high, 0.9);    FPARAM(spec_high, 0.9);
18    
19    FPARAM(lx, -.7);    FPARAM(lx, -.7);
20    FPARAM(ly, .7);    FPARAM(ly, .7);
21    
22      FPARAM(noisescale, .1);
23      FPARAM(noisefreqangle, .1);
24      FPARAM(noisefreqr, .1);
25    
26      FPARAM(xnoisescale, .1);
27      FPARAM(xnoisefreq, 200);
28    
29    int type = 0;    int type = 0;
30    float L[3] = { lx, ly, sqrt(1 - lx*lx - ly*ly) };    float L[3] = { lx, ly, sqrt(1 - lx*lx - ly*ly) };
31    float E[3] = { 0, 0, 1 };    float E[3] = { 0, 0, 1 };
# Line 47  void GENERATE(TextureParam *params, int Line 55  void GENERATE(TextureParam *params, int
55        float x8 = ((x * x) * (x * x)) * ((x * x) * (x * x));        float x8 = ((x * x) * (x * x)) * ((x * x) * (x * x));
56        float y8 = ((y * y) * (y * y)) * ((y * y) * (y * y));        float y8 = ((y * y) * (y * y)) * ((y * y) * (y * y));
57    
58    
59        float rad = sqrt(sqrt(sqrt(x8 + y8)));        float rad = sqrt(sqrt(sqrt(x8 + y8)));
60        float r = (rad - irad) / (orad - irad);        float r = (rad - irad) / (orad - irad);
61    
62          float angle = atan2(x, y);
63    
64          float par[2] = { noisefreqangle * angle, noisefreqr * r };
65          float pnoise = Perlin::noise2(par);
66    
67          par[0] = xnoisefreq * x; par[1] = xnoisefreq * y;
68          float xnoise = Perlin::noise2(par);
69    
70        float dot = 0;        float dot = 0;
71        float alpha = r >= 0 && r <= 1;        float alpha = r >= 0 && r <= 1;
72    
# Line 124  void GENERATE(TextureParam *params, int Line 141  void GENERATE(TextureParam *params, int
141              alpha = alpha + (1 - alpha) * .7 * (1 - t * t * t * t);              alpha = alpha + (1 - alpha) * .7 * (1 - t * t * t * t);
142            }            }
143        }        }
144    
145          dot *= (1 + noisescale * pnoise + xnoisescale * xnoise);
146                
147        switch (components) {        switch (components) {
148        case 1:        case 1:

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

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