Ignore:
Timestamp:
09/05/07 10:54:23 (17 years ago)
Author:
szirmay
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPBasic/GTPShadowMap_PS.hlsl

    r2507 r2550  
    4040  }              
    4141  return light;  
     42} 
     43 
     44float4 shadowMapCameraDepth(LightCPos_OUT IN, 
     45                      uniform sampler2D shadowMap) : COLOR 
     46{ 
     47  float4 light = shadowColor;      
     48         
     49  
     50        float4 pos = (IN.LightVPos / IN.LightVPos.w); 
     51                 
     52        pos.xy = (pos.xy + 1.0) / 2.0; 
     53        pos.y = 1.0 - pos.y; 
     54        float storedDepth = tex2D(shadowMap, pos.xy).r; 
     55        //light = (pos.z - storedDepth.r)*100.0; 
     56        float depth = -IN.LightCPos.z; 
     57        light = max(storedDepth + DEPTH_BIAS > depth, shadowColor2);                     
     58        return storedDepth; 
     59        return light;    
    4260} 
    4361 
Note: See TracChangeset for help on using the changeset viewer.