Changeset 2294 for GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPBasic
- Timestamp:
- 03/27/07 11:55:42 (18 years ago)
- Location:
- GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPBasic
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPBasic/GTPBasic.material
r2284 r2294 44 44 pass mainpass 45 45 { 46 cull_hardware clockwise46 cull_hardware none 47 47 vertex_program_ref GTP/Basic/VPos_VS 48 48 { … … 69 69 material GTP/Basic/CameraDepth 70 70 { 71 technique 72 { 73 pass 71 technique maintechnique 72 { 73 pass mainpass 74 74 { 75 75 cull_hardware clockwise … … 86 86 } 87 87 88 material GTP/Basic/CameraDepthCCW : GTP/Basic/CameraDepthCCW 89 { 90 technique 91 { 92 pass 93 { 94 cull_hardware anticlockwise 95 vertex_program_ref GTP/Basic/CPos_VS 96 { 97 param_named_auto WorldViewProj worldviewproj_matrix 98 param_named_auto WorldView worldview_matrix 99 } 100 fragment_program_ref GTP/Basic/CDepth_PS 101 { 102 } 88 material GTP/Basic/CameraDepthCCW : GTP/Basic/CameraDepth 89 { 90 technique maintechnique 91 { 92 pass mainpass 93 { 94 cull_hardware anticlockwise 103 95 } 104 96 } … … 173 165 { 174 166 vertex_program_ref GTP/Basic/LightVPos_VS 175 176 param_named_auto World world_matrix177 178 param_named LightViewProj matrix4x4179 167 { 168 param_named_auto World world_matrix 169 param_named_auto WorldViewProj worldviewproj_matrix 170 param_named LightViewProj matrix4x4 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 171 } 180 172 fragment_program_ref GTP/Basic/LightVPos_PS 181 173 { 182 174 183 175 } 184 176 } 185 177 } -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPBasic/GTPBasic.program
r2266 r2294 144 144 source GTPBasic_PS.hlsl 145 145 entry_point PlainTex2D 146 target ps_2_0 147 } 148 149 fragment_program GTP/Basic/PlainTex2DColored_PS hlsl 150 { 151 source GTPBasic_PS.hlsl 152 entry_point PlainTex2DColored 146 153 target ps_2_0 147 154 } -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPBasic/GTPBasic_PS.hlsl
r2266 r2294 35 35 { 36 36 float4 pos = IN.VPosition / IN.VPosition.w; 37 return float4(pos.z, pos.z * pos.z, 1, 1);37 return float4(pos.z, 0, 0, 1); 38 38 } 39 39 … … 62 62 63 63 float4 PlainTex2D(PlainTex_OUT IN, 64 64 uniform sampler2D Texture) : COLOR 65 65 { 66 return IN.color * tex2D(Texture, IN.texCoord.xy); 66 return tex2D(Texture, IN.texCoord.xy); 67 } 68 69 float4 PlainTex2DColored(PlainTex_OUT IN, 70 uniform float4 color, 71 uniform sampler2D Texture) : COLOR 72 { 73 return color * tex2D(Texture, IN.texCoord.xy); 67 74 } 68 75 -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPBasic/GTPBasic_VS.hlsl
r2181 r2294 24 24 25 25 PlainTex_OUT PlainTex_VS(float4 position : POSITION, 26 float4 color : COLOR0,26 float4 color : COLOR, 27 27 float4 texCoord : TEXCOORD0, 28 28 uniform float4x4 WorldViewProj) -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPBasic/GTPShadowMap_PS.hlsl
r2271 r2294 14 14 #define DEPTH_BIAS 0.001 15 15 #define DEPTH_BIAS_VSM 0.001 16 #define DEPTH_EPSILON 0.0 00516 #define DEPTH_EPSILON 0.05 17 17 #define DIST_BIAS 0.005 18 18 #define DIST_BIAS_VSM 0.05 19 19 #define DIST_EPSILON 0.01 20 20 21 #define shadowColor float4(0.9,0.9,0.9,1) 21 //#define shadowColor float4(0.9,0.9,0.9,1) 22 #define shadowColor float4(0.1,0.1,0.1,1) 22 23 23 24 float4 shadowMapDepth(LightVPos_OUT IN, … … 26 27 float4 light = shadowColor; 27 28 28 if(IN.LightVPos.z > 0.0)29 // if(IN.LightVPos.z > 0.0) 29 30 { 30 31 float4 pos = (IN.LightVPos / IN.LightVPos.w); … … 32 33 pos.xy = (pos.xy + 1.0) / 2.0; 33 34 pos.y = 1.0 - pos.y; 34 float4 storedDepth = tex2D(shadowMap, pos.xy); 35 light = max(storedDepth.r + DEPTH_BIAS >= pos.z, shadowColor); 35 float storedDepth = abs(tex2D(shadowMap, pos.xy).r); 36 //light = (pos.z - storedDepth.r)*100.0; 37 light = max(storedDepth + DEPTH_BIAS > pos.z, shadowColor); 36 38 } 37 39 return light;
Note: See TracChangeset
for help on using the changeset viewer.