Changeset 2186 for GTP/trunk/App/Demos/Illum/Ogre/Media/Demo
- Timestamp:
- 03/02/07 19:07:56 (18 years ago)
- Location:
- GTP/trunk/App/Demos/Illum/Ogre/Media/Demo
- Files:
-
- 9 added
- 1 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Illum/Ogre/Media/Demo/bump.hlsl
r2157 r2186 109 109 return Illumination(mLight, mNormal, mView, IN.TexCoord, IN.TexCoord2); 110 110 111 111 112 } -
GTP/trunk/App/Demos/Illum/Ogre/Media/Demo/parallax.hlsl
r2152 r2186 17 17 (T2 * Binormal - BT * Tangent)/det, 18 18 Normal/N2 ); 19 /*19 20 20 // simplified solution 21 return float3x3(Tangent/T2, Binormal/B2, Normal/N2); 22 */ 21 //return float3x3(Tangent/T2, Binormal/B2, Normal/N2); 22 // more simplified solution 23 //return float3x3(Tangent, Binormal, Normal); 23 24 } 24 25 … … 52 53 } 53 54 54 float2 PARALLAX_MAPPING_ITER(sampler2D heightMap, float3 TexCoord, float3 View) 55 float2 PARALLAX_MAPPING_OFFSET_LIMIT(sampler2D heightMap, float2 TexCoord, float3 View) 56 { 57 float4 Normal = tex2D(heightMap, TexCoord); 58 float h = Normal.a * HEIGHT_SCALE + HEIGHT_BIAS; 59 return TexCoord + h * View.xy; 60 } 61 62 float2 PARALLAX_MAPPING_ITER(sampler2D heightMap, float2 TexCoord, float3 View) 55 63 { 56 64 for(int i = 0; i < PARALLAX_ITERATION; i++) { 57 65 float4 Normal = tex2D(heightMap, TexCoord); 58 66 float h = Normal.a * HEIGHT_SCALE + HEIGHT_BIAS; 59 TexCoord += (h - TexCoord.z)* Normal.z * View;67 TexCoord += h * Normal.z * View; 60 68 } 61 69 return TexCoord.xy; … … 81 89 82 90 // performing parallax mapping 83 float2 ParallaxTex = PARALLAX_MAPPING_ITER(BumpMapSampler, float3(IN.TexCoord, 0), tView);91 float2 ParallaxTex = PARALLAX_MAPPING_ITER(BumpMapSampler, IN.TexCoord, tView); 84 92 DISCARD_BY_TEX(ParallaxTex); 85 93
Note: See TracChangeset
for help on using the changeset viewer.