- Timestamp:
- 01/24/07 21:44:30 (18 years ago)
- Location:
- GTP/trunk/App/Demos/Illum/Ogre/Media/materials
- Files:
-
- 22 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPBasic/GTPBasic.program
r2024 r2054 50 50 entry_point VPos 51 51 target vs_1_1 52 } 53 54 vertex_program GTP/Basic/MPos_VS hlsl 55 { 56 source GTPBasic_VS.hlsl 57 entry_point MPos 58 target vs_1_1 59 } 60 61 vertex_program GTP/Basic/MPos_NoTransform_VS hlsl 62 { 63 source GTPBasic_VS.hlsl 64 entry_point MPos_NoTransform 65 target vs_1_1 52 66 } 53 67 … … 56 70 source GTPBasic_VS.hlsl 57 71 entry_point CPos 72 target vs_1_1 73 } 74 75 vertex_program GTP/Basic/Shaded_CPos_VS hlsl 76 { 77 source GTPBasic_VS.hlsl 78 entry_point Shaded_CPos_VS 58 79 target vs_1_1 59 80 } -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPBasic/GTPBasic_VS.hlsl
r2024 r2054 153 153 } 154 154 155 struct MPos_OUT 156 { 157 float4 VPos : POSITION; 158 float4 MPos : TEXCOORD0; 159 }; 160 161 MPos_OUT MPos(float4 position : POSITION0, 162 uniform float4x4 WorldViewProj) 163 { 164 MPos_OUT OUT; 165 OUT.VPos = mul(WorldViewProj, position); 166 OUT.MPos = position; 167 return OUT; 168 } 169 170 MPos_OUT MPos_NoTransform(float4 position : POSITION0) 171 { 172 MPos_OUT OUT; 173 OUT.VPos = position; 174 OUT.MPos = position; 175 return OUT; 176 } 155 177 156 178 struct CPos_OUT … … 168 190 OUT.CPos = mul(WorldView, position); 169 191 return OUT; 192 } 193 194 struct Shaded_CPos_OUT 195 { 196 float4 vPos : POSITION; 197 float4 wNormal : TEXCOORD0; 198 float4 wPos : TEXCOORD1; 199 float4 CPos : TEXCOORD2; 200 }; 201 202 Shaded_CPos_OUT Shaded_CPos_VS(float4 position : POSITION, 203 float4 normal : NORMAL, 204 uniform float4x4 WorldViewProj, 205 uniform float4x4 World, 206 uniform float4x4 WorldView, 207 uniform float4x4 WorldInv) 208 { 209 Shaded_CPos_OUT OUT; 210 OUT.vPos = mul(WorldViewProj, position); 211 OUT.wPos = mul(World, position); 212 OUT.CPos = mul(WorldView, position); 213 OUT.wNormal = mul(normal, WorldInv); 214 return OUT; 170 215 } 171 216 -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPCaustic/GTPCaustic.hlsl
r2024 r2054 256 256 257 257 if(mydist > dist + EPSILON) caustic = 0; 258 //caustic.rgb *= max(attenuation - mydist, 0.0) / attenuation; 258 259 caustic.rgb *= max(attenuation - mydist, 0.0) / attenuation; 259 260 260 261 Color = caustic; 261 Color += attenuation; 262 Color.a = 1; 262 //Color += attenuation * 0.000000000001; 263 Color.a = 1; 264 263 265 return Color; 264 266 } -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPCaustic/GTPCaustic.material
r2040 r2054 40 40 param_named_auto WorldView worldview_matrix 41 41 param_named_auto Proj projection_matrix 42 param_named CauSpriteSize float 20 .042 param_named CauSpriteSize float 20 43 43 } 44 44 fragment_program_ref GTP/Caustic/CauCube_PointSprite_PS 45 45 { 46 param_named CausticColor float4 0.7 0.7 0.5 0. 1546 param_named CausticColor float4 0.7 0.7 0.5 0.3 47 47 } 48 48 texture_unit … … 96 96 { 97 97 update_interval 0 98 update_all_face true 99 distance_calc true 3.5 98 update_all_face true 100 99 } 101 100 RenderTechnique DistanceCubeMap 102 101 { 103 102 update_interval 0 104 update_all_face true 105 distance_calc true 3.5 103 update_all_face true 106 104 } 107 105 RenderTechnique CausticCaster 108 106 { 109 attenuation 0107 attenuation 1000 110 108 photonmap_resolution 32 111 109 caustic_cubemap_resolution 256 … … 118 116 119 117 } 120 118 vertex_program_ref GTP/Basic/ShadedTex_VS 121 119 { 122 120 param_named_auto WorldViewProj worldviewproj_matrix … … 124 122 param_named_auto WorldInv inverse_world_matrix 125 123 } 126 124 fragment_program_ref GTP/EnvMap/Localized_Refraction_PS 127 125 { 128 126 param_named_auto cameraPos camera_position -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPEnvMap/GTPEnvMap.hlsl
r2040 r2054 25 25 26 26 // iteration 27 for( int i = 0; i < SECANT_ITERATIONCOUNT ; i++ )27 for( int i = 0; i < SECANT_ITERATIONCOUNT ; i++ ) 28 28 { 29 29 float llp = length( l ) / readDistanceCubeMap( mp, l); // |l|/|l| … … 43 43 } 44 44 45 struct ShadedTex_OUT 45 46 struct Shaded_OUT 46 47 { 47 48 float4 vPos : POSITION; 48 float4 texCoord : TEXCOORD0; 49 float4 wNormal : TEXCOORD1; 50 float4 wPos : TEXCOORD2; 49 float4 wNormal : TEXCOORD0; 50 float4 wPos : TEXCOORD1; 51 51 }; 52 52 53 float4 EnvMap_Default_PS(ShadedTex_OUT IN, 53 54 float4 EnvMap_Default_PS(Shaded_OUT IN, 54 55 uniform samplerCUBE CubeMap : register(s0), 55 56 uniform float3 cameraPos) : COLOR0 … … 62 63 } 63 64 64 float4 EnvMap_Localized_Reflection_PS( Shaded Tex_OUT IN,65 float4 EnvMap_Localized_Reflection_PS( Shaded_OUT IN, 65 66 uniform samplerCUBE CubeMap : register(s0), 66 67 uniform samplerCUBE DistanceMap : register(s1), … … 82 83 } 83 84 84 float4 EnvMap_Localized_Refraction_PS( Shaded Tex_OUT IN,85 float4 EnvMap_Localized_Refraction_PS( Shaded_OUT IN, 85 86 uniform samplerCUBE CubeMap : register(s0), 86 87 uniform samplerCUBE DistanceMap : register(s1), … … 111 112 112 113 113 float4 EnvMap_LocalizedMetal_PS( Shaded Tex_OUT IN,114 float4 EnvMap_LocalizedMetal_PS( Shaded_OUT IN, 114 115 uniform samplerCUBE CubeMap : register(s0), 115 116 uniform samplerCUBE DistanceMap : register(s1), -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPEnvMap/GTPEnvMap.material
r2040 r2054 140 140 update_interval 0 141 141 update_all_face true 142 distance_calc true 3.5 142 distance_calc false 143 face_angle_calc false 143 144 } 144 145 RenderTechnique DistanceCubeMap … … 146 147 update_interval 0 147 148 update_all_face true 148 distance_calc true 3.5 149 distance_calc false 150 face_angle_calc false 149 151 } 150 152 } -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPParticles/GTP_Particles.material
r2024 r2054 31 31 technique 32 32 { 33 33 pass 34 34 { 35 36 35 IllumTechniques 36 { 37 37 RenderTechnique SphericalBillboard 38 38 { 39 39 texture_unit_id 1 40 } 41 } 42 scene_blend src_alpha one 43 //scene_blend src_alpha one_minus_src_alpha 44 depth_write off 45 depth_check off 46 vertex_program_ref GTP/Particles/SB_Sprite_VS 47 { 48 param_named_auto worldView worldview_matrix 49 param_named_auto Proj projection_matrix 50 param_named_auto width viewport_width 51 param_named_auto height viewport_height 52 } 53 fragment_program_ref GTP/Particles/SB_Sprite_PS 54 { 55 param_named_auto farplane far_clip_distance 56 param_named_auto nearplane near_clip_distance 57 } 58 texture_unit 59 { 60 anim_texture smokealpha.tga 32 2.0 61 //texture flare.png 62 } 63 //scene depth texture 64 texture_unit 65 { 66 filtering none 67 } 68 texture_unit 69 { 70 texture planck.tga 71 } 40 } 41 } 42 scene_blend src_alpha one 43 //scene_blend src_alpha one_minus_src_alpha 44 depth_write off 45 depth_check off 46 vertex_program_ref GTP/Particles/SB_Sprite_VS 47 { 48 param_named_auto worldView worldview_matrix 49 param_named_auto Proj projection_matrix 50 param_named_auto width viewport_width 51 param_named_auto height viewport_height 52 } 53 fragment_program_ref GTP/Particles/SB_Sprite_PS 54 { 55 param_named_auto farplane far_clip_distance 56 param_named_auto nearplane near_clip_distance 57 param_named color float4 3 3 3 1 58 } 59 texture_unit 60 { 61 anim_texture smokealpha.tga 32 2.0 62 //texture flare.png 63 } 64 //scene depth texture 65 texture_unit 66 { 67 filtering none 68 } 69 texture_unit 70 { 71 texture planck.tga 72 } 72 73 } 73 74 } -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPParticles/GTP_Sprite.hlsl
r2024 r2054 100 100 uniform float nearplane, 101 101 uniform float farplane, 102 uniform sampler2D colorTexture : register(s0), 103 uniform sampler2D DepthMap : register(s1), 104 uniform sampler2D PlanckMap : register(s2) 102 uniform float4 color, 103 uniform sampler2D colorTexture : register(s0), 104 uniform sampler2D DepthMap : register(s1), 105 uniform sampler2D PlanckMap : register(s2) 105 106 ) : COLOR 106 107 { … … 137 138 Color.rgb = tex2D( PlanckMap, Color.aa).rgb; 138 139 139 return Color ;140 return Color * color; 140 141 } 141 142 -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/GameTools_DepthShadow.hlsl
r1691 r2054 113 113 114 114 115 115 116 VS_OUT_SHADOW distShadowVS(float4 position : POSITION, 116 117 uniform float4x4 worldViewProj, … … 128 129 } 129 130 130 131 /* 131 132 float4 distShadowPS(VS_OUT_SHADOW IN, 132 133 uniform float4x4 lightViewProj, … … 173 174 174 175 return shadow + (1 - shadow) * light; 175 } 176 176 }*/ 177 178 float4 distShadowPS(VS_OUT_SHADOW IN, 179 uniform float4x4 lightViewProj, 180 uniform float lightFarPlane, 181 uniform sampler2D depthShadowMap : register(s0) 182 ):COLOR 183 { 184 float bias = 0.001; 185 float epsilon = 0.001; 186 float4 light = float4(1,1,1,1); 187 float4 shadow = float4(0.85,0.85,0.85,1); 188 189 if(IN.lPosition.z > 0.0) 190 { 191 float4 pos = (IN.lPosition / IN.lPosition.w); 192 193 float d = length(pos.xy); 194 195 light = saturate((1.0 - d)/0.05); 196 197 if(d <= 1.0) 198 { 199 float dist = length(IN.lVPosition.xyz) / lightFarPlane; 200 pos.xy = (pos.xy + 1.0) / 2.0; 201 pos.y = 1.0 - pos.y; 202 float4 storedDist = tex2D(depthShadowMap, pos.xy); 203 204 light = storedDist.r + dist*0.000000000001; 205 206 } 207 208 } 209 else 210 light = 0; 211 212 return shadow + (1 - shadow) * light; 213 } 177 214 178 215 /* -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/GameTools_Diffuse.hlsl
r1929 r2054 1 1 float REDUCED_CUBEMAP_SIZE; 2 int CUBEMAP_SIZE = 128; 3 int RATE = 32; 2 4 3 5 float4 readCubeMap(samplerCUBE cm, float3 coord) … … 13 15 if(dist == 0) dist = 1000000; ///sky 14 16 return dist; 17 } 18 19 20 ///// 21 /// Reduce cube map shader 22 ///// 23 struct MPos_OUT 24 { 25 float4 VPos : POSITION; 26 float4 MPos : TEXCOORD0; 27 }; 28 29 float4 ReduceCubeMap_PS(MPos_OUT IN, 30 uniform int nFace, 31 uniform samplerCUBE EnvironmentMapSampler : register(s0) ) : COLOR 32 { 33 RATE = 32; 34 CUBEMAP_SIZE = 128; 35 float4 color = 0; 36 float3 dir; 37 38 for (int i = 0; i < RATE; i++) 39 for (int j = 0; j < RATE; j++) 40 { 41 float2 pos; 42 pos.x = IN.mPos.x + (2*i + 1)/(float)CUBEMAP_SIZE; 43 pos.y = IN.mPos.y - (2*j + 1)/(float)CUBEMAP_SIZE; // y=-u 44 45 // "scrambling" 46 if (nFace == 0) dir = float3(1, pos.y, -pos.x); 47 if (nFace == 1) dir = float3(-1, pos.y, pos.x); 48 if (nFace == 2) dir = float3(pos.x, 1, -pos.y); 49 if (nFace == 3) dir = float3(pos.x, -1, pos.y); 50 if (nFace == 4) dir = float3(pos.x, pos.y, 1); 51 if (nFace == 5) dir = float3(-pos.x, pos.y,-1); 52 53 color += texCUBE( EnvironmentMapSampler, dir); 54 } 55 56 return color / (RATE*RATE); 15 57 } 16 58 -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/MetalTeapotNew.hlsl
r2024 r2054 413 413 return I; 414 414 } 415 415 /* 416 416 float4 mainPS(VertOut IN, 417 417 uniform float3 cameraPos, … … 448 448 return Color; 449 449 } 450 451 /* 450 */ 451 452 452 float4 mainPS(VertOut IN, 453 453 uniform float3 cameraPos, … … 486 486 487 487 return Color; 488 }*/ 489 490 /* 491 float4 mainPS(VertOut IN, 492 uniform float3 cameraPos, 493 uniform samplerCUBE CubeMap : register(s0), 494 uniform samplerCUBE DistanceMap : register(s1), 495 uniform samplerCUBE NormDistMap1 : register(s2), 496 uniform samplerCUBE NormDistMap2 : register(s3), 497 uniform float3 lastCenter, 498 uniform float SingleBounce, 499 uniform float refIndex, 500 uniform float4 min, 501 uniform float4 min1, 502 uniform float4 min2, 503 uniform float4 max, 504 uniform float4 max1, 505 uniform float4 max2 506 ):COLOR 507 { 508 float2 miniMaxi1; 509 miniMaxi1.x = min1.a; 510 miniMaxi1.y = max1.a; 511 512 float4 I = float4(0,0,0,0); 513 514 float3 N = normalize(IN.mNormal); 515 float3 x = IN.wPos - lastCenter; 516 float3 V = normalize(IN.wPos - cameraPos); 517 float3 R = normalize(reflect(V, N)); 518 519 float3 p; 520 float dl, dp, llp, ppp; 521 linearSearch( x, R, N, NormDistMap1, miniMaxi1, p, dl, dp, llp, ppp); 522 if( dot(p, p) != 0 ) 523 { 524 //secantSearch(x, R, NormDistMap1, dl, dp, llp, ppp, p); 525 I = readCubeMap(NormDistMap1, p); 526 } 527 <<<<<<< .mine 528 I = max1 + 0.0000000000001 *x.x; 529 ======= 530 I = max1 + 0.000000001 * x.x; 531 >>>>>>> .r1994 532 //I = readCubeMap(NormDistMap1, R)+0.00000000001*x.x; 533 return I; 534 }*/ 488 } -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/GameTools.material
r2030 r2054 261 261 technique 262 262 { 263 scene_blend none 264 265 pass 266 { 267 cull_hardware anticlockwise 268 //cull_hardware none 263 264 pass 265 { 266 scene_blend none 267 268 cull_hardware anticlockwise 269 //cull_hardware none 270 //cull_hardware clockwise 269 271 270 272 vertex_program_ref GameTools/ShadowMap/DistVS 271 273 { 272 274 param_named_auto worldViewProj worldviewproj_matrix 273 275 param_named_auto worldView worldview_matrix 274 275 276 } 277 fragment_program_ref GameTools/ShadowMap/DistPS 276 278 { 277 279 param_named_auto farPlane far_clip_distance 278 280 } 279 281 -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/colorcube.material
r1862 r2054 6 6 { 7 7 //lighting off 8 8 IllumTechniques 9 { 10 11 RenderTechnique CausticReciever 12 { 13 max_caster_count 10 14 } 15 RenderTechnique DepthShadowReciever 16 { 17 max_light_count 1 18 vertex_program_name GameTools/ShadowMap/ShadowDistVS 19 fragment_program_name GameTools/ShadowMap/ShadowDistPS 20 set_light_view true 21 set_light_farplane true 22 } 23 } 24 9 25 texture_unit 10 26 { 11 27 texture roomc.PNG 12 28 tex_coord_set 0 13 colour_op replace29 colour_op modulate 14 30 } 15 31 } -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/difflab.material
r1671 r2054 192 192 set_light_farplane true 193 193 } 194 RenderTechnique CausticReciever 195 { 196 max_caster_count 3 197 } 194 198 } 195 199 -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/kupola.material
r1691 r2054 11 11 { 12 12 13 //RenderTechnique CausticReciever14 //{15 //max_caster_count 1016 //}13 RenderTechnique CausticReciever 14 { 15 max_caster_count 10 16 } 17 17 //RenderTechnique DepthShadowReciever 18 18 //{ … … 65 65 { 66 66 67 //RenderTechnique CausticReciever68 //{69 //max_caster_count 1070 //}67 RenderTechnique CausticReciever 68 { 69 max_caster_count 10 70 } 71 71 //RenderTechnique DepthShadowReciever 72 72 //{
Note: See TracChangeset
for help on using the changeset viewer.