- Timestamp:
- 01/09/07 13:08:46 (18 years ago)
- Location:
- GTP/trunk/App/Demos/Illum/Ogre
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/MetalTeapotNew.hlsl
r1957 r1959 13 13 } 14 14 15 #define MAX_LIN_ITERATIONCOUNT 5//8016 #define MIN_LIN_ITERATIONCOUNT 4//6017 #define SECANT_ITERATIONCOUNT 215 #define MAX_LIN_ITERATIONCOUNT 30 //80 16 #define MIN_LIN_ITERATIONCOUNT 25 //60 17 #define SECANT_ITERATIONCOUNT 1 18 18 #define MAX_RAY_DEPTH 2 19 19 … … 132 132 } 133 133 134 int iterationNeeded = MIN_LIN_ITERATIONCOUNT;// + (dot(normalize(x), R) + 1.0) / 2.0 * (MAX_LIN_ITERATIONCOUNT - MIN_LIN_ITERATIONCOUNT); 134 135 float pa; 135 float dt = (maxT - minT) / MAX_LIN_ITERATIONCOUNT;136 float dt = (maxT - minT) / (float) iterationNeeded ; 136 137 dp = minT; 137 138 //Linear iteration … … 412 413 return I; 413 414 } 414 /* 415 415 416 float4 mainPS(VertOut IN, 416 417 uniform float3 cameraPos, … … 428 429 { 429 430 float2 miniMaxi1; 430 miniMaxi1.x = 1.0 / minmax.x ;431 miniMaxi1.y = minmax.y ;431 miniMaxi1.x = 1.0 / minmax.x / 1.8; 432 miniMaxi1.y = minmax.y * 1.8; 432 433 433 434 float2 miniMaxi2; 434 miniMaxi2.x = 1.0 / minmax1.x ;435 miniMaxi2.y = minmax1.y ;435 miniMaxi2.x = 1.0 / minmax1.x / 1.8; 436 miniMaxi2.y = minmax1.y * 1.8; 436 437 437 438 float2 miniMaxi3; 438 miniMaxi3.x = 1.0 / minmax2.x; 439 miniMaxi3.y = minmax2.y; 440 441 float4 Color = 1.0; 442 if(SingleBounce == 1) 443 Color = SingleReflectionPS(IN,cameraPos, CubeMap, DistanceMap, NormDistMap1,NormDistMap2,lastCenter,refIndex, miniMaxi1, miniMaxi2, miniMaxi3); 444 else 445 Color = MultipleReflectionPS(IN,cameraPos, CubeMap, DistanceMap, NormDistMap1,NormDistMap2,lastCenter,refIndex, miniMaxi1, miniMaxi2, miniMaxi3); 446 447 return Color; 448 }*/ 449 450 451 452 float4 mainPS(VertOut IN, 453 uniform float3 cameraPos, 454 uniform samplerCUBE CubeMap : register(s0), 455 uniform samplerCUBE DistanceMap : register(s1), 456 uniform samplerCUBE NormDistMap1 : register(s2), 457 uniform samplerCUBE NormDistMap2 : register(s3), 458 uniform float3 lastCenter, 459 uniform float SingleBounce, 460 uniform float refIndex, 461 uniform float4 min, 462 uniform float4 min1, 463 uniform float4 min2, 464 uniform float4 max, 465 uniform float4 max1, 466 uniform float4 max2 467 ):COLOR 468 { 469 float2 miniMaxi1; 470 miniMaxi1.x = min.a; 471 miniMaxi1.y = max.a; 439 miniMaxi3.x = 1.0 / minmax2.x / 1.8; 440 miniMaxi3.y = minmax2.y * 1.8; 441 442 float4 Color = 1.0; 443 if(SingleBounce == 1) 444 Color = SingleReflectionPS(IN,cameraPos, CubeMap, DistanceMap, NormDistMap1,NormDistMap2,lastCenter,refIndex, miniMaxi1, miniMaxi2, miniMaxi3); 445 else 446 Color = MultipleReflectionPS(IN,cameraPos, CubeMap, DistanceMap, NormDistMap1,NormDistMap2,lastCenter,refIndex, miniMaxi1, miniMaxi2, miniMaxi3); 472 447 473 float2 miniMaxi2; 474 miniMaxi2.x = min1.a; 475 miniMaxi2.y = max1.a; 476 477 float2 miniMaxi3; 478 miniMaxi3.x = min2.a; 479 miniMaxi3.y = max2.a; 480 481 float4 Color = 1.0; 482 if(SingleBounce == 1) 483 Color = SingleReflectionPS(IN,cameraPos, CubeMap, DistanceMap, NormDistMap1,NormDistMap2,lastCenter,refIndex, miniMaxi1, miniMaxi2, miniMaxi3); 484 else 485 Color = MultipleReflectionPS(IN,cameraPos, CubeMap, DistanceMap, NormDistMap1,NormDistMap2,lastCenter,refIndex, miniMaxi1, miniMaxi2, miniMaxi3); 486 487 return Color; 448 return Color; 488 449 } 489 450 … … 506 467 ):COLOR 507 468 { 469 float2 miniMaxi1; 470 miniMaxi1.x = min.a; 471 miniMaxi1.y = max.a; 472 473 float2 miniMaxi2; 474 miniMaxi2.x = min1.a; 475 miniMaxi2.y = max1.a; 476 477 float2 miniMaxi3; 478 miniMaxi3.x = min2.a; 479 miniMaxi3.y = max2.a; 480 481 float4 Color = 1.0; 482 if(SingleBounce == 1) 483 Color = SingleReflectionPS(IN,cameraPos, CubeMap, DistanceMap, NormDistMap1,NormDistMap2,lastCenter,refIndex, miniMaxi1, miniMaxi2, miniMaxi3); 484 else 485 Color = MultipleReflectionPS(IN,cameraPos, CubeMap, DistanceMap, NormDistMap1,NormDistMap2,lastCenter,refIndex, miniMaxi1, miniMaxi2, miniMaxi3); 486 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 508 float2 miniMaxi1; 509 miniMaxi1.x = min 2.a;510 miniMaxi1.y = max 2.a;509 miniMaxi1.x = min1.a; 510 miniMaxi1.y = max1.a; 511 511 512 512 float4 I = float4(0,0,0,0); … … 519 519 float3 p; 520 520 float dl, dp, llp, ppp; 521 linearSearch( x, R, N, NormDistMap 2, miniMaxi1, p, dl, dp, llp, ppp);521 linearSearch( x, R, N, NormDistMap1, miniMaxi1, p, dl, dp, llp, ppp); 522 522 if( dot(p, p) != 0 ) 523 523 { 524 secantSearch(x, R, NormDistMap2, dl, dp, llp, ppp, p);525 I = readCubeMap(NormDistMap 2, p);524 //secantSearch(x, R, NormDistMap1, dl, dp, llp, ppp, p); 525 I = readCubeMap(NormDistMap1, p); 526 526 } 527 527 I = max1 + 0.000000001 * x.x; 528 528 //I = readCubeMap(NormDistMap1, R)+0.00000000001*x.x; 529 529 return I; -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/MetalTeapot.material
r1955 r1959 131 131 { 132 132 cull_hardware clockwise 133 scene_blend max133 scene_blend_op max 134 134 depth_test off 135 135 polygon_mode points … … 156 156 { 157 157 cull_hardware anticlockwise 158 scene_blend max158 scene_blend_op max 159 159 depth_test off 160 160 polygon_mode points … … 185 185 } 186 186 187 material MetalTeapotMultipleBounce _0187 material MetalTeapotMultipleBounce 188 188 { 189 189 technique … … 328 328 329 329 330 material MetalTeapotMultipleBounce 330 material MetalTeapotMultipleBounce_0 331 331 { 332 332 technique
Note: See TracChangeset
for help on using the changeset viewer.