- Timestamp:
- 02/20/07 14:13:51 (17 years ago)
- File:
-
- 1 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
Note: See TracChangeset
for help on using the changeset viewer.