Changeset 2136
- Timestamp:
- 02/20/07 14:13:51 (18 years ago)
- Location:
- GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPCaustic
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPCaustic/GTPCaustic.hlsl
r2095 r2136 51 51 uniform float3 lastCenter, 52 52 uniform float3 cameraPos, 53 uniform float ref lIndex,53 uniform float refIndex, 54 54 uniform samplerCUBE DistanceMap : register(s0)):COLOR0 55 55 { … … 61 61 float3 V = normalize(IN.wPos.xyz - cameraPos); 62 62 63 float3 R = refract(V, wNormal, ref lIndex);63 float3 R = refract(V, wNormal, refIndex); 64 64 65 65 dir = R; … … 156 156 float4 texCoord : TEXCOORD0, 157 157 float4 color : COLOR0, 158 uniform float WorldSize, 159 uniform float notUseIntensity, 158 160 uniform float4x4 WorldView, 159 161 uniform float4x4 Proj, … … 166 168 float pixel = 1.0 / PhotonMapResolution; 167 169 float2 uv = float2(position.x, 1.0 - position.y); 170 uv += float2(pixel / 2.0,pixel / 2.0); 168 171 float4 pos = tex2Dlod(PhotonHitMap, float4(uv,0,0)).rgba; 169 172 … … 171 174 { 172 175 OUT.color = float4(0,0,0,0); 173 OUT.hPosition = float4( 0, 0, -1000000, 1);176 OUT.hPosition = float4(1000000, 1000000, 1000000, 1); 174 177 } 175 178 else … … 216 219 valids++; 217 220 } 218 //if(valids == 0) sumdist = 100000; 221 222 219 223 float avrdist = sumdist / valids; 220 //float maxdist = 10; 221 //intensity = max(maxdist - avrdist, 0.0) / maxdist; 222 intensity = 5 / (avrdist * avrdist * 3.14); 223 //intensity = valids / 4.0;//avrdist; 224 225 //OUT.color = float4(1,1,1,intensity); 224 if(valids == 0) avrdist = WorldSize / 1000.0; 225 226 intensity = WorldSize / (avrdist * avrdist * 3.14); 227 //intensity = 0.8; 228 226 229 OUT.color = intensity; 230 if(notUseIntensity) 231 OUT.color = float4(1,1,1,1); 227 232 } 228 233 -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPCaustic/GTPCaustic.material
r2054 r2136 15 15 param_named_auto cameraPos camera_position 16 16 param_named lastCenter float3 0 0 0 17 param_named ref lIndex float 0.8517 param_named refIndex float 0.85 18 18 } 19 19 //cubemap of distances … … 71 71 param_named_auto WorldView worldview_matrix 72 72 param_named_auto Proj projection_matrix 73 param_named PhotonMapResolution float 32 73 param_named PhotonMapResolution float 64 74 param_named WorldSize float 10 74 75 } 75 76 fragment_program_ref GTP/Caustic/CauCube_Triangles_PS 76 77 { 77 78 param_named CausticColor float4 0.7 0.7 0.5 1 79 78 80 } 79 81 texture_unit … … 95 97 RenderTechnique ColorCubeMap 96 98 { 97 update_interval 099 update_interval 1 98 100 update_all_face true 99 101 } 100 102 RenderTechnique DistanceCubeMap 101 103 { 102 update_interval 0104 update_interval 1 103 105 update_all_face true 104 106 } … … 106 108 { 107 109 attenuation 1000 108 photonmap_resolution 32 110 update_interval 1 111 update_all_face true 112 photonmap_resolution 64 109 113 caustic_cubemap_resolution 256 110 114 photon_map_material GTP/Caustic/PhotonMap_HitEnv 111 caustic_map_material GTP/Caustic/CauCube_PointSprite112 //caustic_map_material GTP/Caustic/CauCube_Triangles113 //use_triangles true114 //blur_caustic_cubemap true115 //caustic_map_material GTP/Caustic/CauCube_PointSprite 116 caustic_map_material GTP/Caustic/CauCube_Triangles 117 use_triangles true 118 blur_caustic_cubemap true 115 119 } 116 120
Note: See TracChangeset
for help on using the changeset viewer.