Changeset 2131 for GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPAdvancedEnvMap/multibounce/GTPMultipleReflection.hlsl
- Timestamp:
- 02/20/07 14:10:19 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPAdvancedEnvMap/multibounce/GTPMultipleReflection.hlsl
r2095 r2131 12 12 13 13 #define MAX_LIN_ITERATIONCOUNT 50 //80 14 #define MIN_LIN_ITERATIONCOUNT 15//6014 #define MIN_LIN_ITERATIONCOUNT 30 //60 15 15 #define SECANT_ITERATIONCOUNT 1 16 #define MAX_RAY_DEPTH 416 #define MAX_RAY_DEPTH 2 17 17 18 18 void linearSearch( float3 x, float3 R, float3 N, samplerCUBE mp, … … 240 240 float3 l = Hit(x, R, N, NormDistMap1, NormDistMap2, CubeMap, DistanceMap, Il, Nl); 241 241 if(Il.a == 0) 242 { 243 //I = readCubeMap(CubeMap, l); 242 { 244 243 depth += 1; 245 244 } … … 252 251 N = normalize(Nl); 253 252 V = R; 254 } 255 253 } 254 255 if(I.a == 0) 256 { 257 float ri = refIndex; 258 if(dot(V,N) > 0) 259 { 260 ri = 1.0 / ri; 261 N = -N; 262 } 263 float3 R = refract( V, N, ri); 264 if(dot(R,R) == 0) R = reflect( V, N); 265 I = readCubeMap(CubeMap, R); 266 } 267 256 268 I *= (1.0 - F); 257 269 … … 307 319 } 308 320 if(I.a == 0) 309 I = 0;321 I = float4(V,1); 310 322 else 311 323 I = float4(l,1);
Note: See TracChangeset
for help on using the changeset viewer.