- Timestamp:
- 12/08/06 18:52:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/MetalTeapotNew.hlsl
r1863 r1870 13 13 } 14 14 15 #define MAX_LIN_ITERATIONCOUNT 40 //8016 #define MIN_LIN_ITERATIONCOUNT 20 //6015 #define MAX_LIN_ITERATIONCOUNT 80 //80 16 #define MIN_LIN_ITERATIONCOUNT 60 //60 17 17 #define SECANT_ITERATIONCOUNT 2 18 #define MAX_RAY_DEPTH 518 #define MAX_RAY_DEPTH 2 19 19 20 20 /* … … 277 277 float3 V = (IN.wPos - cameraPos); 278 278 279 float Fp = 0.04; 280 float F = Fp + pow(1 - dot(N, -V), 5) * (1 - Fp); 281 279 282 V = normalize(V); 280 283 float3 l; 281 284 float4 Irefr; 282 285 int depth = 0; 283 286 while(depth < MAX_RAY_DEPTH) 284 287 { 285 288 float3 R; 286 // R = normalize(reflect( V, N)); 289 //R = normalize(reflect( V, N)); 290 287 291 288 292 float ri = refIndex; … … 294 298 } 295 299 R = refract( V, N, ri); 296 if(dot(R,R) == 0) R = reflect( V, -N); 300 if(dot(R,R) == 0) R = reflect( V, N); 301 297 302 298 303 float3 Nl; … … 312 317 V = R; 313 318 } 314 /* 319 if(I.a == 0) 320 I = readCubeMap(CubeMap, l); 321 Irefr = I; 322 323 float4 Irefl; 315 324 N = normalize(IN.mNormal); 316 325 x = IN.wPos - lastCenter; … … 331 340 else 332 341 { 333 I = Il * 0.2 + I * 0.8;342 I = Il; 334 343 depth = MAX_RAY_DEPTH; 335 344 } … … 337 346 N = Nl; 338 347 V = R; 339 } */348 } 340 349 341 //if(I.a == 0) 342 // I = readCubeMap(CubeMap, l); 343 350 if(I.a == 0) 351 I = readCubeMap(CubeMap, l); 352 Irefl = I; 353 354 I = Irefl * F + (1.0 - F) * Irefr; 344 355 return I; 345 356 }
Note: See TracChangeset
for help on using the changeset viewer.