Changeset 2550 for GTP/trunk/App/Demos/Illum/Ogre/Media
- Timestamp:
- 09/05/07 10:54:23 (17 years ago)
- Location:
- GTP/trunk/App/Demos/Illum/Ogre/Media
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Illum/Ogre/Media/Towers/parallax.hlsl
r2441 r2550 14 14 float det = B2 * T2 - BT * BT; 15 15 16 return float3x3( (B2 * Tangent - BT * Binormal)/det,17 (T2 * Binormal - BT * Tangent)/det,18 Normal/N2 );16 //return float3x3( (B2 * Tangent - BT * Binormal)/det, 17 // (T2 * Binormal - BT * Tangent)/det, 18 // Normal/N2 ); 19 19 20 20 // simplified solution 21 21 //return float3x3(Tangent/T2, Binormal/B2, Normal/N2); 22 22 // more simplified solution 23 //return float3x3(Tangent, Binormal, Normal);23 return float3x3(Tangent, Binormal, Normal); 24 24 } 25 25 … … 89 89 90 90 // performing parallax mapping 91 float2 ParallaxTex = PARALLAX_MAPPING_ ITER(BumpMapSampler, IN.TexCoord, tView);91 float2 ParallaxTex = PARALLAX_MAPPING_OFFSET_LIMIT(BumpMapSampler, IN.TexCoord, tView); 92 92 DISCARD_BY_TEX(ParallaxTex); 93 93 94 94 // get model space normal vector 95 //ParallaxTex = IN.TexCoord; 95 96 float3 tNormal = tex2D(BumpMapSampler, ParallaxTex).rgb; 96 97 // Normal vector should be transformed with the inverse transpose of TangentToModel … … 98 99 float3 mNormal = normalize( mul( tNormal, ModelToTangent ) ); 99 100 //mNormal = normalize(IN.wNormal); 101 100 102 // illumination calculation 103 101 104 return Illumination(mLight, mNormal, mView, ParallaxTex, IN.TexCoord2); 102 105 } -
GTP/trunk/App/Demos/Illum/Ogre/Media/Towers/towers.material
r2507 r2550 37 37 fragment_program_ref GTP/Demo/ParallaxMapped_PS 38 38 { 39 param_named HEIGHT_SCALE float 0. 1639 param_named HEIGHT_SCALE float 0.20 40 40 param_named HEIGHT_BIAS float -0.04 41 param_named textureRepeat float 641 param_named textureRepeat float 10 42 42 } 43 43 texture_unit color … … 173 173 { 174 174 max_light_count 1 175 vertex_program_name GTP/Basic/Light VPos_VS176 fragment_program_name GTP/Basic/SM/ Depth_VSM_PS175 vertex_program_name GTP/Basic/LightCPos_VS 176 fragment_program_name GTP/Basic/SM/CameraDepth_PS 177 177 set_light_viewproj true 178 set_light_view false178 set_light_view true 179 179 set_light_farplane false 180 180 world_view_proj_param_name WorldViewProj 181 181 world_param_name World 182 182 light_viewproj_param_name LightViewProj 183 light_view_param_name LightView 184 pass_blending one zero 183 185 } 184 186 -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPBasic/GTPBasic.material
r2489 r2550 73 73 pass mainpass 74 74 { 75 cull_hardware clockwise75 cull_hardware none 76 76 vertex_program_ref GTP/Basic/CPos_VS 77 77 { -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPBasic/GTPBasic.program
r2404 r2550 172 172 source GTPShadowMap_PS.hlsl 173 173 entry_point shadowMapDepth 174 target ps_2_0 175 } 176 177 fragment_program GTP/Basic/SM/CameraDepth_PS hlsl 178 { 179 source GTPShadowMap_PS.hlsl 180 entry_point shadowMapCameraDepth 174 181 target ps_2_0 175 182 } -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPBasic/GTPBasic_PS.hlsl
r2312 r2550 41 41 uniform float farplane) : COLOR 42 42 { 43 //return float4(0.5,0,0,0); 43 44 return float4(-IN.CPos.z, -IN.CPos.z / farplane, 0, -IN.CPos.z); 44 45 } -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPBasic/GTPShadowMap_PS.hlsl
r2507 r2550 40 40 } 41 41 return light; 42 } 43 44 float4 shadowMapCameraDepth(LightCPos_OUT IN, 45 uniform sampler2D shadowMap) : COLOR 46 { 47 float4 light = shadowColor; 48 49 50 float4 pos = (IN.LightVPos / IN.LightVPos.w); 51 52 pos.xy = (pos.xy + 1.0) / 2.0; 53 pos.y = 1.0 - pos.y; 54 float storedDepth = tex2D(shadowMap, pos.xy).r; 55 //light = (pos.z - storedDepth.r)*100.0; 56 float depth = -IN.LightCPos.z; 57 light = max(storedDepth + DEPTH_BIAS > depth, shadowColor2); 58 return storedDepth; 59 return light; 42 60 } 43 61 -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPEnvMap/GTPEnvMap.hlsl
r2471 r2550 63 63 } 64 64 65 float4 EnvMap_Refract_Default_PS 66 (Shaded_OUT IN, 67 uniform samplerCUBE CubeMap : register(s0), 68 uniform float3 cameraPos, 69 uniform float sRefraction, 70 uniform float transparency ) : COLOR0 71 { 72 float3 N = normalize(IN.wNormal.xyz); 73 float3 V = normalize(IN.wPos.xyz - cameraPos); 74 float3 R = reflect( V, N); 75 float3 R2 = refract( V, N, sRefraction); 76 77 return 0.5;//(1.0 - transparency) * readCubeMap(CubeMap, R ) + transparency * readCubeMap(CubeMap, R2); 78 } 79 65 80 float4 EnvMap_Localized_Reflection_PS( Shaded_OUT IN, 66 81 uniform samplerCUBE CubeMap : register(s0), … … 88 103 uniform float3 cameraPos, 89 104 uniform float3 lastCenter, 90 uniform float sFresnel,105 uniform float4 sFresnel, 91 106 uniform float sRefraction ) :COLOR0 92 107 { -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPEnvMap/GTPEnvMap.program
r2040 r2550 3 3 source GTPEnvMap.hlsl 4 4 entry_point EnvMap_Default_PS 5 target ps_2_0 6 } 7 8 fragment_program GTP/EnvMap/Default_Refract_PS hlsl 9 { 10 source GTPEnvMap.hlsl 11 entry_point EnvMap_Refract_Default_PS 5 12 target ps_2_0 6 13 }
Note: See TracChangeset
for help on using the changeset viewer.