Changeset 1102 for GTP/trunk/App/Demos/Illum/Ogre/Media/materials
- Timestamp:
- 07/07/06 17:01:28 (18 years ago)
- Location:
- GTP/trunk/App/Demos/Illum/Ogre/Media/materials
- Files:
-
- 1 added
- 3 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 -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/GameTools.material
r1094 r1102 137 137 } 138 138 139 material GameTools/FocusingShader 140 { 141 142 technique 143 { 144 scene_blend none 145 146 pass 147 { 148 vertex_program_ref GameTools/FocusingVS 149 { 150 param_named_auto worldView worldview_matrix 151 param_named_auto worldViewProj worldviewproj_matrix 152 param_named lightTransform matrix4x4 153 } 154 fragment_program_ref GameTools/FocusingPS 155 { 156 157 } 158 159 } 160 } 161 } 162 139 163 material GameTools/ShadowMapDepth 140 164 { -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/GameTools.program
r1060 r1102 1 vertex_program GameTools/FocusingVS hlsl 2 { 3 source GameTools_Focusing.hlsl 4 entry_point FocusingVS 5 target vs_2_0 6 } 7 8 fragment_program GameTools/FocusingPS hlsl 9 { 10 source GameTools_Focusing.hlsl 11 entry_point FocusingPS 12 target ps_2_0 13 } 14 1 15 vertex_program GameTools/PostProc1_VS hlsl 2 16 {
Note: See TracChangeset
for help on using the changeset viewer.