Changeset 1897 for GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs
- Timestamp:
- 12/15/06 12:36:42 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/MetalTeapotNew.hlsl
r1885 r1897 89 89 dt = 1.0 / dt; 90 90 91 float t = 0.01; //dt;91 float t = 0.01; 92 92 if(min > length(x)) 93 93 { 94 94 95 float a = 1; 95 96 float b = 2 * dot(R, x); … … 97 98 98 99 float dis = b*b - 4*a*c; 99 float t1 = (-b + sqrt(dis))/ 2 * a;100 float t2 = (-b - sqrt(dis))/ 2 * a;100 float t1 = (-b + sqrt(dis))/ 2.0 * a; 101 float t2 = (-b - sqrt(dis))/ 2.0 * a; 101 102 102 103 if(t1 > 0 && (t2 < 0 || t1 < t2)) 103 t = t1 / ( a + t1);104 t = 1.0;//t1 / ( a + t1); 104 105 else if(t2 > 0) 105 t = t2 / ( a + t2); 106 t = 1.0;//t2 / ( a + t2); 107 //t = 0.011; 106 108 } 107 109 … … 173 175 samplerCUBE mp3Color, 174 176 samplerCUBE mp3Dist, 177 float min, 175 178 float min1, 176 179 float min2, … … 192 195 if(!valid1 && ! valid2) 193 196 { 194 linearSearch(x, R, N, mp3Dist, 0, p, dl, dp, llp, ppp);197 linearSearch(x, R, N, mp3Dist, min, p, dl, dp, llp, ppp); 195 198 Il.a = 1; 196 199 secantSearch(x, R, mp3Dist, dl, dp, llp, ppp, p); … … 252 255 uniform float3 lastCenter, 253 256 uniform float refIndex, 257 float min, 254 258 float min1, 255 259 float min2 … … 276 280 float3 Nl; 277 281 float4 Il; 278 float3 l = Hit(x, R, N, NormDistMap1, NormDistMap2, CubeMap, DistanceMap, min 1, min2, Il, Nl);282 float3 l = Hit(x, R, N, NormDistMap1, NormDistMap2, CubeMap, DistanceMap, min, min1, min2, Il, Nl); 279 283 if(Il.a == 0) 280 284 Il = readCubeMap(CubeMap, l); … … 293 297 uniform float3 lastCenter, 294 298 uniform float refIndex, 299 float min, 295 300 float min1, 296 301 float min2) … … 318 323 float3 Nl; 319 324 float4 Il; 320 l = Hit(x, R, N, NormDistMap1, NormDistMap2, CubeMap, DistanceMap, min 1, min2, Il, Nl);325 l = Hit(x, R, N, NormDistMap1, NormDistMap2, CubeMap, DistanceMap, min, min1, min2, Il, Nl); 321 326 if(Il.a == 0) 322 327 { … … 333 338 334 339 } 335 if(I.a == 0)336 I = readCubeMap(CubeMap, l); 340 /* if(I.a == 0) 341 I = readCubeMap(CubeMap, l);*/ 337 342 Irefl = I; 338 343 … … 363 368 float3 Nl; 364 369 float4 Il; 365 l = Hit(x, R, N, NormDistMap1, NormDistMap2, CubeMap, DistanceMap, min 1, min2, Il, Nl);370 l = Hit(x, R, N, NormDistMap1, NormDistMap2, CubeMap, DistanceMap, min, min1, min2, Il, Nl); 366 371 if(Il.a == 0) 367 372 { … … 396 401 uniform float SingleBounce, 397 402 uniform float refIndex, 403 uniform float4 min, 398 404 uniform float4 min1, 399 405 uniform float4 min2 400 406 ):COLOR 401 407 { 402 min1.x = 1.0 / min1.x;403 min2.x = 1.0 / min2.x;408 // min1.x = 1.0 / min1.x; 409 // min2.x = 1.0 / min2.x; 404 410 float4 Color = 1.0; 405 411 if(SingleBounce == 1) 406 Color = SingleReflectionPS(IN,cameraPos, CubeMap, DistanceMap, NormDistMap1,NormDistMap2,lastCenter,refIndex, min 1.x, min2.x);412 Color = SingleReflectionPS(IN,cameraPos, CubeMap, DistanceMap, NormDistMap1,NormDistMap2,lastCenter,refIndex, min.w, min1.w, min2.w); 407 413 else 408 Color = MultipleReflectionPS(IN,cameraPos, CubeMap, DistanceMap, NormDistMap1,NormDistMap2,lastCenter,refIndex, min 1.x, min2.x);414 Color = MultipleReflectionPS(IN,cameraPos, CubeMap, DistanceMap, NormDistMap1,NormDistMap2,lastCenter,refIndex, min.w, min1.w, min2.w); 409 415 410 416 return Color;
Note: See TracChangeset
for help on using the changeset viewer.