Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3876


Ignore:
Timestamp:
Jun 22, 2006, 4:09:40 PM (19 years ago)
Author:
hdavid
Message:
 
Location:
data/branches/atmospheric_engine/shaders
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • data/branches/atmospheric_engine/shaders/cloud.frag

    r3875 r3876  
     1//
    12// 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//
    210
    311varying float LightIntensity;
     
    1119void main (void)
    1220{
    13     vec4  noisevec  = texture3D(Noise, MCposition + Offset);
     21  vec4  noisevec  = texture3D(Noise, MCposition + Offset);
    1422
    15     float intensity = (noisevec[0] + noisevec[1] +
    16                        noisevec[2] + noisevec[3]) * 1.5;
     23  float intensity = (noisevec[0] + noisevec[1] +
     24      noisevec[2] + noisevec[3]) * 1.5;
    1725
    18     vec3 color   = mix(SkyColor, CloudColor, intensity) * LightIntensity;
     26  vec3 color   = mix(SkyColor, CloudColor, intensity) * LightIntensity;
    1927
    20     gl_FragColor = vec4 (color, 1.0);
     28  gl_FragColor = vec4 (color, 1.0);
    2129}
  • data/branches/atmospheric_engine/shaders/cloud.vert

    r3875 r3876  
     1//
    12// 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//
    210
    311varying float LightIntensity;
    412varying vec3  MCposition;
    513
     14uniform vec3  LightPos;
    615uniform float Scale;
    716
    817void main(void)
    918{
    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();
    1525}
Note: See TracChangeset for help on using the changeset viewer.