Changeset 3876
- Timestamp:
- Jun 22, 2006, 4:09:40 PM (19 years ago)
- Location:
- data/branches/atmospheric_engine/shaders
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
data/branches/atmospheric_engine/shaders/cloud.frag
r3875 r3876 1 // 1 2 // Fragment shader for producing animated clouds (mostly cloudy) 3 // 4 // Author: Randi Rost 5 // 6 // Copyright (c) 2002-2004 3Dlabs Inc. Ltd. 7 // 8 // See 3Dlabs-License.txt for license information 9 // 2 10 3 11 varying float LightIntensity; … … 11 19 void main (void) 12 20 { 13 21 vec4 noisevec = texture3D(Noise, MCposition + Offset); 14 22 15 16 23 float intensity = (noisevec[0] + noisevec[1] + 24 noisevec[2] + noisevec[3]) * 1.5; 17 25 18 26 vec3 color = mix(SkyColor, CloudColor, intensity) * LightIntensity; 19 27 20 28 gl_FragColor = vec4 (color, 1.0); 21 29 } -
data/branches/atmospheric_engine/shaders/cloud.vert
r3875 r3876 1 // 1 2 // Vertex shader for producing animated clouds (mostly cloudy) 3 // 4 // Authors: John Kessenich, Randi Rost 5 // 6 // Copyright (c) 2002-2004 3Dlabs Inc. Ltd. 7 // 8 // See 3Dlabs-License.txt for license information 9 // 2 10 3 11 varying float LightIntensity; 4 12 varying vec3 MCposition; 5 13 14 uniform vec3 LightPos; 6 15 uniform float Scale; 7 16 8 17 void main(void) 9 18 { 10 vec3 ECposition = vec3 (gl_ModelViewMatrix * gl_Vertex); 11 MCposition = vec3 (gl_Vertex) * Scale; 12 vec3 tnorm = normalize(vec3 (gl_NormalMatrix * gl_Normal)); 13 LightIntensity = 1; 14 gl_Position = ftransform(); 19 vec3 ECposition = vec3 (gl_ModelViewMatrix * gl_Vertex); 20 MCposition = vec3 (gl_Vertex) * Scale; 21 vec3 tnorm = normalize(vec3 (gl_NormalMatrix * gl_Normal)); 22 LightIntensity = dot(normalize(LightPos - ECposition), tnorm); 23 LightIntensity = 1.0; 24 gl_Position = ftransform(); 15 25 }
Note: See TracChangeset
for help on using the changeset viewer.