Changeset 1424 for GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs
- Timestamp:
- 09/21/06 08:35:22 (18 years ago)
- Location:
- GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs
- Files:
-
- 3 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/GameTools_HPS_Smoke_L.hlsl
r1355 r1424 7 7 float r : TEXCOORD2; 8 8 float4 center : TEXCOORD3; 9 float4 Color : TEXCOORD4; 9 10 }; 10 11 11 12 VS_OUT HPS_Smoke_L_VS (float4 position : POSITION, 12 13 float4 texCoord : TEXCOORD0, 13 14 float4 Color: COLOR0, 15 uniform float baseRadius, 14 16 uniform float4x4 worldView, 15 17 uniform float4x4 Proj, … … 17 19 { 18 20 VS_OUT OUT; 19 20 float2 offset = texCoord.zw; 21 float2 offset = texCoord.zw * baseRadius; 21 22 float4 cPosition; 22 23 cPosition = mul(worldView, position); … … 24 25 cPosition.xy += offset; 25 26 OUT.cPosition = cPosition; 26 OUT.r = abs( texCoord.z);27 OUT.r = abs(offset.x); 27 28 28 29 OUT.hPosition = mul( Proj, cPosition ); 29 30 30 OUT.texCoord = texCoord.xy; 31 OUT.texCoord = texCoord.xy; 32 OUT.Color = Color; 31 33 return OUT; 32 34 } … … 39 41 float4 Color = 0; 40 42 Color = tex2D(Texture, IN.texCoord); 41 Color = float4(1, 1, 1, Color.a) ;43 Color = float4(1, 1, 1, Color.a) * IN.Color; 42 44 return Color; 43 45 } -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/GameTools_HPS_Smoke_S.hlsl
r1355 r1424 7 7 float r : TEXCOORD2; 8 8 float4 center : TEXCOORD3; 9 float4 Color : TEXCOORD4; 9 10 }; 10 11 11 12 VS_OUT HPS_Smoke_S_VS (float4 position : POSITION, 12 13 float4 texCoord : TEXCOORD0, 13 14 float4 Color: COLOR0, 14 15 uniform float4x4 worldView, 15 16 uniform float4x4 Proj, … … 28 29 OUT.hPosition = mul( Proj, cPosition ); 29 30 30 OUT.texCoord = texCoord.xy; 31 OUT.texCoord = texCoord.xy; 32 OUT.Color = Color; 31 33 return OUT; 32 34 } … … 42 44 float alpha = 0; 43 45 44 float d = length( IN.cPosition.xy z - IN.center.xyz);46 float d = length( IN.cPosition.xy- IN.center.xy); 45 47 46 48 if( d < IN.r ) … … 53 55 fPosition = mul(Proj, fPosition); 54 56 bPosition = mul(Proj, bPosition); 55 f = (fPosition.z / fPosition.w + 1.0) / 2.0;56 b = (bPosition.z / bPosition.w + 1.0) / 2.0;57 f = fPosition.z / fPosition.w; 58 b = bPosition.z / bPosition.w; 57 59 58 60 alpha = pow(w / IN.r, 4) * 0.5; … … 63 65 Color.r = b; 64 66 Color.g = 1 - f; 65 Color.a = alpha ;67 Color.a = alpha * IN.Color.a; 66 68 //Color.a = tex2D(Texture, IN.texCoord).a * 0.2; 67 69
Note: See TracChangeset
for help on using the changeset viewer.