Changeset 1955 for GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs
- Timestamp:
- 01/08/07 13:11:05 (18 years ago)
- Location:
- GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/GameTools_PostProc.hlsl
r1683 r1955 119 119 120 120 //Color = pow(Color * half4(1.05f, 0.97f, 1.27f, 1.0f), Gain); 121 return Color; 121 //return Color; 122 return float4(tex2D(GlobalLuminanceTexture, IN.texCoord).r, 123 tex2D(GlobalLuminanceTexture, IN.texCoord).r, 124 tex2D(GlobalLuminanceTexture, IN.texCoord).r, 125 1); 122 126 123 127 } -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/MetalTeapotNew.hlsl
r1929 r1955 85 85 86 86 float minT = 0; 87 float maxT = 0; 87 float maxT = 0; 88 88 { 89 89 float a = dot(R,R); … … 134 134 float pa; 135 135 float dt = (maxT - minT) / MAX_LIN_ITERATIONCOUNT; 136 float t= minT;136 dp = minT; 137 137 //Linear iteration 138 while( t<= maxT && !found)138 while(dp <= maxT && !found) 139 139 { 140 dp = t; 141 p = x + R * t; 140 p = x + R * dp; 142 141 pa = readDistanceCubeMap(mp, p); 143 142 … … 161 160 shootL = 0; 162 161 163 t+= dt;162 dp += dt; 164 163 } 165 164 … … 228 227 } 229 228 else 230 Il = float4(0,0,0, 1);229 Il = float4(0,0,0,0); 231 230 } 232 231 else … … 243 242 Il.rgb = Nl.rgb = readCubeMap(mp2, p2).rgb; 244 243 p = p2; 245 } 246 Il.a = 0; 247 } 248 244 } 245 } 249 246 return p; 250 247 } … … 339 336 float4 Irefl; 340 337 int depth = 0; 341 342 338 343 339 while(depth < MAX_RAY_DEPTH) … … 363 359 364 360 } 365 /*if(I.a == 0)366 I = readCubeMap(CubeMap, l); */361 if(I.a == 0) 362 I = readCubeMap(CubeMap, l); 367 363 Irefl = I; 368 364 … … 416 412 return I; 417 413 } 418 414 /* 419 415 float4 mainPS(VertOut IN, 420 416 uniform float3 cameraPos, … … 432 428 { 433 429 float2 miniMaxi1; 434 miniMaxi1.x = 1.0 / minmax.x / sqrt(2.0);430 miniMaxi1.x = 1.0 / minmax.x; 435 431 miniMaxi1.y = minmax.y; 436 432 437 433 float2 miniMaxi2; 438 miniMaxi2.x = 1.0 / minmax1.x / sqrt(2.0);434 miniMaxi2.x = 1.0 / minmax1.x; 439 435 miniMaxi2.y = minmax1.y; 440 436 441 437 float2 miniMaxi3; 442 miniMaxi3.x = 1.0 / minmax2.x / sqrt(2.0);438 miniMaxi3.x = 1.0 / minmax2.x; 443 439 miniMaxi3.y = minmax2.y; 444 440 … … 450 446 451 447 return Color; 452 } 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; 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 float2 miniMaxi1; 509 miniMaxi1.x = min2.a; 510 miniMaxi1.y = max2.a; 511 512 float4 I = float4(0,0,0,0); 513 514 float3 N = normalize(IN.mNormal); 515 float3 x = IN.wPos - lastCenter; 516 float3 V = normalize(IN.wPos - cameraPos); 517 float3 R = normalize(reflect(V, N)); 518 519 float3 p; 520 float dl, dp, llp, ppp; 521 linearSearch( x, R, N, NormDistMap2, miniMaxi1, p, dl, dp, llp, ppp); 522 if( dot(p, p) != 0 ) 523 { 524 secantSearch(x, R, NormDistMap2, dl, dp, llp, ppp, p); 525 I = readCubeMap(NormDistMap2, p); 526 } 527 528 //I = readCubeMap(NormDistMap1, R)+0.00000000001*x.x; 529 return I; 530 }*/
Note: See TracChangeset
for help on using the changeset viewer.