Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/atmospheric_engine/shaders/cloud.frag @ 3875

Last change on this file since 3875 was 3875, checked in by hdavid, 18 years ago

branches/atmospheric_engine

File size: 637 bytes
Line 
1// Fragment shader for producing animated clouds (mostly cloudy)
2
3varying float LightIntensity;
4varying vec3  MCposition;
5
6uniform sampler3D Noise;
7uniform vec3 SkyColor;     // (0.0, 0.0, 0.8)
8uniform vec3 CloudColor;   // (0.8, 0.8, 0.8)
9uniform vec3 Offset;       // updated each frame by the application
10
11void main (void)
12{
13    vec4  noisevec  = texture3D(Noise, MCposition + Offset);
14
15    float intensity = (noisevec[0] + noisevec[1] +
16                       noisevec[2] + noisevec[3]) * 1.5;
17
18    vec3 color   = mix(SkyColor, CloudColor, intensity) * LightIntensity;
19
20    gl_FragColor = vec4 (color, 1.0);
21}
Note: See TracBrowser for help on using the repository browser.