Changeset 1870


Ignore:
Timestamp:
12/08/06 18:52:00 (17 years ago)
Author:
szirmay
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/MetalTeapotNew.hlsl

    r1863 r1870  
    1313} 
    1414 
    15 #define MAX_LIN_ITERATIONCOUNT 40  //80 
    16 #define MIN_LIN_ITERATIONCOUNT 20  //60 
     15#define MAX_LIN_ITERATIONCOUNT 80  //80 
     16#define MIN_LIN_ITERATIONCOUNT 60  //60 
    1717#define SECANT_ITERATIONCOUNT 2 
    18 #define MAX_RAY_DEPTH 5 
     18#define MAX_RAY_DEPTH 2 
    1919 
    2020/* 
     
    277277         float3 V  = (IN.wPos - cameraPos); 
    278278          
     279         float Fp = 0.04; 
     280         float F = Fp + pow(1 - dot(N, -V), 5) * (1 - Fp); 
     281          
    279282         V = normalize(V); 
    280283         float3 l; 
    281           
     284         float4 Irefr; 
    282285         int depth = 0; 
    283286         while(depth < MAX_RAY_DEPTH) 
    284287         { 
    285288           float3 R;   
    286            //  R = normalize(reflect( V, N));      
     289           //R = normalize(reflect( V, N)); 
     290              
    287291           
    288292          float ri = refIndex; 
     
    294298          } 
    295299          R = refract( V, N, ri); 
    296           if(dot(R,R) == 0) R = reflect( V, -N);  
     300          if(dot(R,R) == 0) R = reflect( V, N);  
     301           
    297302                                 
    298303           float3 Nl; 
     
    312317           V = R;                   
    313318        } 
    314         /* 
     319        if(I.a == 0) 
     320       I = readCubeMap(CubeMap, l); 
     321        Irefr = I; 
     322         
     323        float4 Irefl; 
    315324        N = normalize(IN.mNormal); 
    316325        x = IN.wPos - lastCenter; 
     
    331340           else 
    332341           { 
    333                    I = Il * 0.2 + I * 0.8; 
     342                   I = Il; 
    334343                   depth = MAX_RAY_DEPTH; 
    335344           } 
     
    337346           N = Nl; 
    338347           V = R;    
    339         }*/ 
     348        } 
    340349         
    341         //if(I.a == 0) 
    342       // I = readCubeMap(CubeMap, l); 
    343    
     350        if(I.a == 0) 
     351       I = readCubeMap(CubeMap, l); 
     352    Irefl = I; 
     353     
     354    I = Irefl * F + (1.0 - F) * Irefr; 
    344355        return I; 
    345356} 
Note: See TracChangeset for help on using the changeset viewer.