Rev | Line | |
---|
[3825] | 1 | // Fragment shader for producing animated clouds (mostly cloudy) |
---|
| 2 | |
---|
| 3 | varying float LightIntensity; |
---|
| 4 | varying vec3 MCposition; |
---|
| 5 | |
---|
| 6 | uniform sampler3D Noise; |
---|
| 7 | uniform vec3 SkyColor; // (0.0, 0.0, 0.8) |
---|
| 8 | uniform vec3 CloudColor; // (0.8, 0.8, 0.8) |
---|
| 9 | uniform vec3 Offset; // updated each frame by the application |
---|
| 10 | |
---|
| 11 | void 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); |
---|
[3875] | 21 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.