Changeset 2404 for GTP/trunk/App/Demos/Illum/Ogre/Media/materials
- Timestamp:
- 06/05/07 01:57:13 (18 years ago)
- Location:
- GTP/trunk/App/Demos/Illum/Ogre/Media/materials
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPBasic/GTPBasic.program
r2337 r2404 216 216 target ps_2_0 217 217 } 218 219 fragment_program GTP/Basic/Shaded/TexturedTwoLights_PS hlsl 220 { 221 source GTPBasicShading.hlsl 222 entry_point TexturedShadedTwoLights_PS 223 target ps_2_0 224 } 218 225 -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPBasic/GTPBasicShading.hlsl
r2266 r2404 27 27 float cosb = max(dot(IN.wNormal.xyz, diff), 0); 28 28 29 color.rgb = pow(cosa, 9) * cosb / dist2 * lightPower ;29 color.rgb = pow(cosa, 9) * cosb / dist2 * lightPower * lightColor; 30 30 //color.rgb *= lightPower; 31 31 //return 0; 32 32 return color * tex2D(colorTex, IN.texCoord); 33 33 } 34 35 36 float4 TexturedShadedTwoLights_PS(ShadedTex_OUT IN, 37 uniform float3 lightPos1, 38 uniform float3 lightDir1, 39 uniform float3 lightColor1, 40 uniform float lightPower1, 41 uniform float3 lightPos2, 42 uniform float3 lightDir2, 43 uniform float3 lightColor2, 44 uniform float lightPower2, 45 uniform sampler2D colorTex : register(s0)):COLOR0 46 { 47 float4 color = 0; 48 IN.wNormal.xyz = normalize(IN.wNormal.xyz); 49 50 { 51 float3 lightDir = normalize(lightDir1); 52 53 float3 diff = lightPos1 - IN.wPos; 54 float dist2 = dot(diff, diff); 55 if(dist2 < SAMPLECUTDIST2) 56 dist2 = SAMPLECUTDIST2; 57 diff = normalize(diff); 58 float cosa = max(dot(lightDir1, -diff), 0); 59 float cosb = max(dot(IN.wNormal.xyz, diff), 0); 60 61 //color.rgb += pow(cosa, 9) * cosb / dist2 * lightPower1 * lightColor1; 62 color.rgb += cosb / dist2 * lightPower1 * lightColor1; 63 64 } 65 66 { 67 float3 lightDir = normalize(lightDir2); 68 69 float3 diff = lightPos2 - IN.wPos; 70 float dist2 = dot(diff, diff); 71 if(dist2 < SAMPLECUTDIST2) 72 dist2 = SAMPLECUTDIST2; 73 diff = normalize(diff); 74 float cosa = max(dot(lightDir2, -diff), 0); 75 float cosb = max(dot(IN.wNormal.xyz, diff), 0); 76 77 color.rgb += pow(cosa, 9) * cosb / dist2 * lightPower2 * lightColor2; 78 } 79 80 //color.rgb *= lightPower; 81 //return 0; 82 return color * tex2D(colorTex, IN.texCoord); 83 } -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPBasic/GTPShadowMap_PS.hlsl
r2337 r2404 15 15 #define DEPTH_BIAS_VSM 0.001 16 16 #define DEPTH_EPSILON 0.05 17 #define DIST_BIAS 0.00 0517 #define DIST_BIAS 0.005 18 18 #define DIST_BIAS_VSM 0.0005 19 19 #define DIST_EPSILON 0.001 … … 76 76 uniform sampler2D shadowMap) : COLOR 77 77 { 78 float4 light = shadowColor;78 float4 light = 0;//shadowColor; 79 79 if( IN.LightVPos.z > 0.0) 80 80 { 81 81 float4 pos = (IN.LightVPos / IN.LightVPos.w); 82 82 float d = length(pos.xy); 83 light = saturate((1.0 - d)/0.05);83 //light = saturate((1.0 - d)/0.05); 84 84 if(d <= 1.0) 85 85 { … … 90 90 light = max(dist < storedDist + DIST_BIAS, shadowColor); 91 91 light = dist < storedDist + DIST_BIAS; 92 //if(dist < storedDist + DIST_BIAS) 93 //light = 1; 92 94 } 93 95 } -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPEnvMap/GTPEnvMap.hlsl
r2266 r2404 128 128 RR = R; 129 129 RR = Hit(cubePos, R, DistanceMap); 130 Color = readCubeMap(CubeMap, R R);130 Color = readCubeMap(CubeMap, R); 131 131 //Color = readDistanceCubeMap(DistanceMap, cubePos)/300.0; 132 132 //return Color; -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/difflab.material
r2293 r2404 130 130 world_view_proj_param_name WorldViewProj 131 131 world_param_name World 132 nearest_from_camera false 132 133 } 133 134 } … … 167 168 world_view_proj_param_name WorldViewProj 168 169 world_param_name World 170 nearest_from_camera false 169 171 } 170 172 } … … 210 212 world_view_proj_param_name WorldViewProj 211 213 world_param_name World 214 nearest_from_camera false 212 215 } 213 216 } … … 267 270 world_view_proj_param_name WorldViewProj 268 271 world_param_name World 272 nearest_from_camera false 269 273 } 270 274 } … … 310 314 world_view_proj_param_name WorldViewProj 311 315 world_param_name World 316 nearest_from_camera false 312 317 } 313 318 } … … 371 376 world_view_proj_param_name WorldViewProj 372 377 world_param_name World 378 nearest_from_camera false 373 379 } 374 380 }
Note: See TracChangeset
for help on using the changeset viewer.