Ignore:
Timestamp:
07/07/06 17:01:28 (18 years ago)
Author:
szirmay
Message:
 
File:
1 edited

Legend:

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

    r1060 r1102  
    2323{ 
    2424        float dist = length(IN.Position.xyz); 
    25         return float4(dist, dist, dist, 1);      
     25        return float4(dist, dist, dist, 1); 
     26        //return 1;      
    2627} 
    2728 
     
    5960        float4 shadowColor = float4(0.6, 0.6, 0.6, 1.0); 
    6061 
    61         float4 light1 = 1; 
    62         float4 light2 = 1; 
    63         float weight1 = 1; 
    64         float weight2 = 1; 
     62        float4 light1 = float4(1,1,1,1); 
    6563         
    6664        float4 lightCamPos1 = mul(lightView, IN.Position); 
     
    7270        float4 storedDepth1 = tex2D(depthShadowMap, lightScreenPos1.xy); 
    7371                if(storedDepth1.r + bias < d1) 
    74                         light1=0; 
     72                        light1 = shadowColor;    
    7573         
    7674         
    77         float4 lightCamPos2 = mul(lightView2, IN.Position); 
    78         float d2 = length(lightCamPos2.xyz); 
    79          
    80                          
    81         float4 lightScreenPos2 = mul(lightViewProj2, IN.Position); 
    82         lightScreenPos2 = lightScreenPos2 / lightScreenPos2.w ;  
    83  
    84         if(abs(lightScreenPos2.x) < 0.99 && abs(lightScreenPos2.y) < 0.99 ) 
    85         { 
    86                 lightScreenPos2 = ( lightScreenPos2 + 1.0 ) / 2.0; 
    87                 lightScreenPos2.y = 1.0 - lightScreenPos2.y; 
    88                 float4 storedDepth2 = tex2D(depthShadowMap2, lightScreenPos2.xy); 
    89                         if(storedDepth2.r + bias < d2) 
    90                                 light2=0;        
    91         } 
    92         else 
    93                 weight2 = 0; 
    94                  
    95         weight1 = 1 - weight2;   
    96                  
    97         return saturate((light1*weight1 + light2*weight2) + shadowColor);        
     75        return light1;   
    9876} 
    9977 
Note: See TracChangeset for help on using the changeset viewer.