- Timestamp:
- 01/08/07 13:11:05 (18 years ago)
- Location:
- GTP/trunk/App/Demos/Illum/Ogre/Media/materials
- Files:
-
- 4 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 }*/ -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/Diffuse.material
r1735 r1955 183 183 entry_point DiffuseBumpPS 184 184 target ps_3_0 185 flow_control prefer 185 186 } 186 187 … … 251 252 entry_point EnvMapDiffuseP2PPS 252 253 target ps_3_0 254 flow_control prefer 253 255 } 254 256 -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/MetalTeapot.material
r1929 r1955 185 185 } 186 186 187 material MetalTeapotMultipleBounce 187 material MetalTeapotMultipleBounce_0 188 188 { 189 189 technique … … 324 324 } 325 325 } 326 327 328 329 330 material MetalTeapotMultipleBounce 331 { 332 technique 333 { 334 pass 335 { 336 //cull_hardware none 337 IllumTechniques 338 { 339 RenderTechnique ColorCubeMap 340 { 341 resolution 1024 342 update_interval 0 343 distance_calc false 344 face_angle_calc false 345 update_all_face true 346 347 } 348 RenderTechnique DistanceCubeMap 349 { 350 resolution 1024 351 update_interval 0 352 distance_calc false 353 face_angle_calc false 354 update_all_face true 355 get_minmax true 356 min_var_name min 357 max_var_name max 358 } 359 RenderTechnique ColorCubeMap 360 { 361 resolution 1024 362 layer 1 363 texture_unit_id 2 364 update_interval 0 365 distance_calc false 366 face_angle_calc false 367 update_all_face true 368 render_env false 369 render_self true 370 self_material NormalDistanceCCW 371 get_minmax true 372 min_var_name min1 373 max_var_name max1 374 } 375 RenderTechnique ColorCubeMap 376 { 377 resolution 1024 378 layer 2 379 texture_unit_id 3 380 update_interval 0 381 distance_calc false 382 face_angle_calc false 383 update_all_face true 384 render_env false 385 render_self true 386 self_material NormalDistanceCW 387 get_minmax true 388 min_var_name min2 389 max_var_name max2 390 } 391 } 392 vertex_program_ref DefaultVS 393 { 394 param_named_auto worldViewProj worldviewproj_matrix 395 param_named_auto world world_matrix 396 param_named_auto worldview worldview_matrix 397 param_named_auto worldI inverse_world_matrix 398 399 } 400 fragment_program_ref MetalMultipleBouncePS 401 { 402 param_named_auto cameraPos camera_position 403 //param_named n float3 0.21 0.96 1.17 404 //param_named k float3 4.16 2.57 2.32 405 param_named F0 float3 0.95 0.95 0.95 406 param_named SingleBounce float 0.0 407 param_named refIndex float 0.6667 408 } 409 410 //Cube map of environment 411 texture_unit 412 { 413 //filtering none 414 } 415 //Cube map of environment distances 416 texture_unit 417 { 418 filtering none 419 } 420 421 //Cube map of reflective object's normals and distances CCW 422 texture_unit 423 { 424 filtering none 425 } 426 //Cube map of reflective object's normals and distances CW 427 texture_unit 428 { 429 filtering none 430 } 431 } 432 } 433 }
Note: See TracChangeset
for help on using the changeset viewer.