Ignore:
Timestamp:
02/20/07 14:10:19 (17 years ago)
Author:
szirmay
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPAdvancedEnvMap/multibounce/GTPMultipleReflection.hlsl

    r2095 r2131  
    1212 
    1313#define MAX_LIN_ITERATIONCOUNT 50  //80 
    14 #define MIN_LIN_ITERATIONCOUNT 15  //60 
     14#define MIN_LIN_ITERATIONCOUNT 30  //60 
    1515#define SECANT_ITERATIONCOUNT 1 
    16 #define MAX_RAY_DEPTH 4 
     16#define MAX_RAY_DEPTH 2 
    1717 
    1818void linearSearch(  float3 x, float3 R, float3 N, samplerCUBE mp, 
     
    240240          float3 l = Hit(x, R, N, NormDistMap1, NormDistMap2, CubeMap, DistanceMap, Il, Nl); 
    241241          if(Il.a == 0) 
    242           { 
    243                   //I = readCubeMap(CubeMap, l); 
     242          {                
    244243                   depth += 1;            
    245244          } 
     
    252251          N = normalize(Nl); 
    253252          V = R;                    
    254         }   
    255              
     253        }  
     254                 
     255        if(I.a == 0) 
     256        { 
     257         float ri = refIndex;     
     258         if(dot(V,N) > 0) 
     259         { 
     260                ri = 1.0 / ri; 
     261                N = -N;      
     262         } 
     263         float3 R = refract( V, N, ri); 
     264         if(dot(R,R) == 0) R = reflect( V, N); 
     265         I = readCubeMap(CubeMap, R); 
     266        } 
     267         
    256268        I *= (1.0 - F);  
    257269     
     
    307319        }   
    308320        if(I.a == 0) 
    309                 I = 0; 
     321                I = float4(V,1); 
    310322        else 
    311323                I = float4(l,1); 
Note: See TracChangeset for help on using the changeset viewer.