Changeset 2404 for GTP/trunk/App/Demos/Illum
- Timestamp:
- 06/05/07 01:57:13 (18 years ago)
- Location:
- GTP/trunk/App/Demos/Illum/Ogre/Media
- Files:
-
- 2 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/FPSarm.material
r2398 r2404 24 24 } 25 25 } 26 27 vertex_program GTP/MoriaDemo/Sword_VS hlsl 28 { 29 source sword.hlsl 30 entry_point Sword_VS 31 target vs_2_0 32 } 33 34 fragment_program GTP/MoriaDemo/Sword_Metal_PS hlsl 35 { 36 source sword.hlsl 37 entry_point Sword_Metal_PS 38 target ps_3_0 39 } 40 fragment_program GTP/MoriaDemo/Sword_Handle_PS hlsl 41 { 42 source sword.hlsl 43 entry_point Sword_Handle_PS 44 target ps_3_0 45 } 46 47 material swordHandle 48 { 49 technique 50 { 51 pass 52 { 53 IllumTechniques 54 { 55 // RenderTechnique DepthShadowReceiver 56 // { 57 // max_light_count 1 58 // set_light_viewproj false 59 // set_light_view true 60 // set_light_farplane true 61 // light_view_param_name LightView 62 // light_farplane_param_name lightFarPlane 63 // new_passes false 64 // start_tex_id 1 65 // } 66 } 67 cull_hardware none 68 vertex_program_ref GTP/MoriaDemo/Sword_VS 69 { 70 param_named_auto WorldViewProj worldviewproj_matrix 71 param_named_auto World world_matrix 72 param_named_auto WorldI inverse_world_matrix 73 param_named_auto wCamPos camera_position 74 } 75 fragment_program_ref GTP/MoriaDemo/Sword_Handle_PS 76 { 77 param_named_auto wLightPos1 light_position 0 78 // param_named_auto wLightPos2 light_position 1 79 param_named_auto lightRange1 light_attenuation 0 80 // param_named_auto lightRange2 light_attenuation 1 81 param_named_auto lightPower1 light_power 0 82 // param_named_auto lightPower2 light_power 1 83 param_named_auto lightColor1 light_diffuse_colour 0 84 // param_named_auto lightColor2 light_diffuse_colour 1 85 param_named specularity float 100 86 param_named specularColor float4 0.05 0.05 0.05 0.05 87 } 88 texture_unit 89 { 90 texture swordColor.dds 91 } 92 texture_unit 93 { 94 } 95 texture_unit 96 { 97 } 98 } 99 } 100 } 101 102 material swordMetal 103 { 104 technique maintechnique 105 { 106 pass mainpass 107 { 108 IllumTechniques 109 { 110 RenderTechnique ColorCubeMap 111 { 112 update_interval 1 113 update_all_face false 114 distance_calc false 115 face_angle_calc false 116 } 117 } 118 vertex_program_ref GTP/Basic/ShadedTex_VS 119 { 120 param_named_auto WorldViewProj worldviewproj_matrix 121 param_named_auto World world_matrix 122 param_named_auto WorldInv inverse_world_matrix 123 } 124 fragment_program_ref GTP/MoriaDemo/Sword_Metal_PS 125 { 126 param_named_auto wCamPos camera_position 127 } 128 //Cube map for reflections and refractions 129 texture_unit 130 { 131 132 } 133 texture_unit 134 { 135 texture swordColor.dds 136 } 137 } 138 } 139 } 140 141 -
GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/MoriaHallBase.hlsl
r2398 r2404 3 3 #define MAX_LIGHT 2 4 4 #define MAX_CAU_CASTER 2 5 #define SPOT_ANGLE 2.0936 #define SPOT_FALLOFF 17 #define SHADOW_COLOR float4(0.3,0.3,0.3,1.0)8 #define SHADOW_BIAS_POINT 0.00019 #define SHADOW_EPSILON_POINT 0.000110 5 11 6 #include "illum.hlsl" -
GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/illum.hlsl
r2398 r2404 1 #define SPOT_ANGLE 2.093 2 #define SPOT_FALLOFF 1 3 #define SHADOW_COLOR float4(0.3,0.3,0.3,1.0) 4 #define SHADOW_BIAS_POINT 0.0001 5 #define SHADOW_EPSILON_POINT 0.0001 1 6 2 7 float4 Illumination(float3 N, float3 L, float3 V, float4 lightColor, float4 lightRange, float4 diffuseColor, float specularity, float4 specularColor) -
GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/trollvs.cg
r2386 r2404 5 5 float2 uv : TEXCOORD0, 6 6 float3 tangent : TANGENT, 7 float blendIdx : BLENDINDICES, 7 float4 blendIdx : BLENDINDICES, 8 float4 blendWgt : BLENDWEIGHT, 8 9 out float4 oPosition : POSITION, 9 10 out float2 oUv : TEXCOORD0, 10 out float3 oTangent: TEXCOORD1,11 out float3 oBinormal: TEXCOORD2,11 //out float3 oTangent: TEXCOORD1, 12 //out float3 oBinormal: TEXCOORD2, 12 13 out float3 oNormal : TEXCOORD3, 13 14 out float3 V: TEXCOORD4, 14 15 out float3 L: TEXCOORD5, 15 uniform float3x4 worldMatrix3x4Array[6 7],16 uniform float3x4 worldMatrix3x4Array[69], 16 17 uniform float4x4 viewProjectionMatrix, 17 18 uniform float4 lightPos, … … 19 20 { 20 21 // transform by indexed matrix 21 float4 blendPos = float4(mul(worldMatrix3x4Array[blendIdx], position).xyz, 1.0); 22 float4 blendPos = float4(0,0,0,1); 23 blendPos.xyz += mul(worldMatrix3x4Array[blendIdx[0]], position).xyz * blendWgt[0]; 24 blendPos.xyz += mul(worldMatrix3x4Array[blendIdx[1]], position).xyz * blendWgt[1]; 25 22 26 // view / projection 23 27 oPosition = mul(viewProjectionMatrix, blendPos); 24 28 // transform normal 25 oNormal = mul((float3x3)worldMatrix3x4Array[blendIdx], normal);26 oTangent = mul((float3x3)worldMatrix3x4Array[blendIdx], tangent);29 //oNormal = mul((float3x3)worldMatrix3x4Array[blendIdx], normal); 30 //oTangent = mul((float3x3)worldMatrix3x4Array[blendIdx], tangent); 27 31 oNormal = normalize(oNormal); 28 oTangent = normalize(oTangent);29 oBinormal = cross(oTangent, oNormal);32 // oTangent = normalize(oTangent); 33 // oBinormal = cross(oTangent, oNormal); 30 34 // Lighting - support point and directional 31 35 L = lightPos.xyz - blendPos.xyz * lightPos.w; … … 38 42 void trollSkinning_SMGen_One_Weight_vp( 39 43 float4 position : POSITION, 40 float blendIdx : BLENDINDICES, 44 float4 blendIdx : BLENDINDICES, 45 float4 blendWgt : BLENDWEIGHT, 41 46 out float4 oPosition : POSITION, 42 47 out float3 cPos:TEXCOORD0, … … 48 53 { 49 54 // transform by indexed matrix 50 float4 blendPos = float4(mul(worldMatrix3x4Array[blendIdx], position).xyz, 1.0); 55 float4 blendPos = float4(0,0,0,1); 56 blendPos.xyz += mul(worldMatrix3x4Array[blendIdx[0]], position).xyz * blendWgt[0]; 57 blendPos.xyz += mul(worldMatrix3x4Array[blendIdx[1]], position).xyz * blendWgt[1]; 58 51 59 // view / projection 52 60 cPos = mul(viewMatrix, blendPos).xyz; -
GTP/trunk/App/Demos/Illum/Ogre/Media/PMDemo/PRMDemo.material
r2337 r2404 7 7 IllumTechniques 8 8 { 9 RenderTechnique PathMap 9 10 RenderTechnique PathMap 10 11 { 11 12 } 13 RenderTechnique DepthShadowReceiver 14 { 15 max_light_count 2 16 vertex_program_name GTP/Basic/LightCPos_VS 17 fragment_program_name GTP/Basic/SM/Dist_VSM_PS 18 set_light_view true 19 set_light_farplane true 20 light_viewproj_param_name LightViewProj 21 light_view_param_name LightView 22 light_farplane_param_name lightFarPlane 23 world_view_proj_param_name WorldViewProj 24 world_param_name World 25 } 12 pass_blending one one 13 } 14 15 26 16 } 27 17 vertex_program_ref GTP/Basic/ShadedTex_VS … … 31 21 param_named_auto WorldInv inverse_world_matrix 32 22 } 33 fragment_program_ref GTP/Basic/Shaded/Textured OneLight_PS23 fragment_program_ref GTP/Basic/Shaded/TexturedTwoLights_PS 34 24 { 35 param_named_auto lightPos light_position 0 36 param_named_auto lightDir light_direction 0 37 param_named_auto lightColor light_diffuse_colour 0 38 param_named_auto lightPower light_power 0 25 param_named_auto lightPos1 light_position 0 26 param_named_auto lightDir1 light_direction 0 27 param_named_auto lightColor1 light_diffuse_colour 0 28 param_named_auto lightPower1 light_power 0 29 30 param_named_auto lightPos2 light_position 1 31 param_named_auto lightDir2 light_direction 1 32 param_named_auto lightColor2 light_diffuse_colour 1 33 param_named_auto lightPower2 light_power 1 39 34 } 40 35 texture_unit color … … 116 111 } 117 112 } 113 114 115 116 RenderTechnique DepthShadowReceiver 117 { 118 pass_blending one zero 119 max_light_count 1 120 vertex_program_name GTP/Basic/LightCPos_VS 121 //fragment_program_name GTP/Basic/SM/Dist_VSM_PS 122 fragment_program_name GTP/Basic/SM/Dist_PS 123 set_light_view true 124 set_light_farplane true 125 light_viewproj_param_name LightViewProj 126 light_view_param_name LightView 127 light_farplane_param_name lightFarPlane 128 world_view_proj_param_name WorldViewProj 129 world_param_name World 130 } 131 132 133 RenderTechnique DepthShadowReceiver 134 { 135 pass_blending zero src_colour 136 max_light_count 1 137 vertex_program_name GTP/Basic/LightCPos_VS 138 //fragment_program_name GTP/Basic/SM/Dist_VSM_PS 139 fragment_program_name GTP/Basic/SM/Dist_PS 140 set_light_view true 141 set_light_farplane true 142 light_viewproj_param_name LightViewProj 143 light_view_param_name LightView 144 light_farplane_param_name lightFarPlane 145 world_view_proj_param_name WorldViewProj 146 world_param_name World 147 } -
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.