- Timestamp:
- 10/19/08 00:29:45 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/treeanimation.cg
r3040 r3041 8 8 float4 position: POSITION; 9 9 float3 normal: NORMAL; 10 float 3color: COLOR;11 float 2 texcoord: TEXCOORD0;10 float4 color: COLOR; 11 float4 texCoord: TEXCOORD0; 12 12 }; 13 14 13 15 14 // vtx output 16 15 struct vtxout 17 16 { 18 float4 position: POSITION; // eye space17 float4 position: POSITION; 19 18 float4 texCoord: TEXCOORD0; 20 19 21 20 float4 color: COLOR0; 21 float4 eyePos: TEXCOORD1; // eye position 22 22 float3 normal: TEXCOORD2; 23 float4 eyePos: TEXCOORD3;24 23 }; 25 26 24 27 25 … … 34 32 uniform float3 windDir, 35 33 uniform float windStrength, 36 uniform float2 minmaxPos, 34 uniform float frequency, 35 uniform float2 minMaxPos, 37 36 uniform float timer) 38 37 { 39 38 vtxout OUT; 40 39 41 OUT.color = IN.color;40 OUT.color = float4(0);//IN.color; 42 41 OUT.texCoord = IN.texCoord; 42 43 const float pos = (minMaxPos.x - IN.position.z) / (minMaxPos.x - minMaxPos.y); 44 45 float factor = pos * windStrength * sin(timer * frequency); 46 47 // transform the vertex position into post projection space 48 OUT.position = mul(glstate.matrix.mvp, IN.position); 49 // displace the input position 50 OUT.position += float4(factor * windDir, 0); 51 43 52 // transform the vertex position into eye space 44 53 OUT.eyePos = mul(glstate.matrix.modelview[0], IN.position); 45 46 const float pos = (minmaxPos.x - IN.position.y / (minmaxPos.x - minmaxPos.y); 47 48 float factor = windStrength * sin(timer); 49 50 // displace the input position 51 float4 newPos = IN.position + float4(factor * windDir, 0.0f); 52 // transform the vertex position into post projection space 53 OUT.position = mul(glstate.matrix.mvp, IN.position); 54 OUT.eyePos += float4(factor * windDir, 0); 54 55 55 56 OUT.normal = IN.normal;
Note: See TracChangeset
for help on using the changeset viewer.