Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/trunk/shaders/cloud.frag @ 4247

Last change on this file since 4247 was 3939, checked in by bensch, 18 years ago

data/trunk: merged the data from the atmos branche back

File size: 752 bytes
RevLine 
[3876]1//
[3825]2// Fragment shader for producing animated clouds (mostly cloudy)
[3876]3//
4// Author: Randi Rost
5//
6// Copyright (c) 2002-2004 3Dlabs Inc. Ltd.
7//
8// See 3Dlabs-License.txt for license information
9//
[3825]10
11varying float LightIntensity;
12varying vec3  MCposition;
13
14uniform sampler3D Noise;
15uniform vec3 SkyColor;     // (0.0, 0.0, 0.8)
16uniform vec3 CloudColor;   // (0.8, 0.8, 0.8)
17uniform vec3 Offset;       // updated each frame by the application
18
19void main (void)
20{
[3876]21  vec4  noisevec  = texture3D(Noise, MCposition + Offset);
[3825]22
[3876]23  float intensity = (noisevec[0] + noisevec[1] +
24      noisevec[2] + noisevec[3]) * 1.5;
[3825]25
[3876]26  vec3 color   = mix(SkyColor, CloudColor, intensity) * LightIntensity;
[3825]27
[3876]28  gl_FragColor = vec4 (color, 1.0);
[3875]29}
Note: See TracBrowser for help on using the repository browser.