Changeset 1102 for GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs
- Timestamp:
- 07/07/06 17:01:28 (19 years ago)
- Location:
- GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/GameTools_DepthShadow.hlsl
r1060 r1102 23 23 { 24 24 float dist = length(IN.Position.xyz); 25 return float4(dist, dist, dist, 1); 25 return float4(dist, dist, dist, 1); 26 //return 1; 26 27 } 27 28 … … 59 60 float4 shadowColor = float4(0.6, 0.6, 0.6, 1.0); 60 61 61 float4 light1 = 1; 62 float4 light2 = 1; 63 float weight1 = 1; 64 float weight2 = 1; 62 float4 light1 = float4(1,1,1,1); 65 63 66 64 float4 lightCamPos1 = mul(lightView, IN.Position); … … 72 70 float4 storedDepth1 = tex2D(depthShadowMap, lightScreenPos1.xy); 73 71 if(storedDepth1.r + bias < d1) 74 light1 =0;72 light1 = shadowColor; 75 73 76 74 77 float4 lightCamPos2 = mul(lightView2, IN.Position); 78 float d2 = length(lightCamPos2.xyz); 79 80 81 float4 lightScreenPos2 = mul(lightViewProj2, IN.Position); 82 lightScreenPos2 = lightScreenPos2 / lightScreenPos2.w ; 83 84 if(abs(lightScreenPos2.x) < 0.99 && abs(lightScreenPos2.y) < 0.99 ) 85 { 86 lightScreenPos2 = ( lightScreenPos2 + 1.0 ) / 2.0; 87 lightScreenPos2.y = 1.0 - lightScreenPos2.y; 88 float4 storedDepth2 = tex2D(depthShadowMap2, lightScreenPos2.xy); 89 if(storedDepth2.r + bias < d2) 90 light2=0; 91 } 92 else 93 weight2 = 0; 94 95 weight1 = 1 - weight2; 96 97 return saturate((light1*weight1 + light2*weight2) + shadowColor); 75 return light1; 98 76 } 99 77
Note: See TracChangeset
for help on using the changeset viewer.