Ignore:
Timestamp:
04/03/07 12:11:24 (18 years ago)
Author:
szirmay
Message:
 
Location:
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPBasic
Files:
3 edited

Legend:

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

    r2294 r2311  
    8080   }  
    8181   fragment_program_ref GTP/Basic/CDepth_PS 
    82    {     
     82   { 
     83     param_named_auto farplane far_clip_distance 
    8384   }    
    8485  } 
  • GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPBasic/GTPBasic_PS.hlsl

    r2294 r2311  
    3838} 
    3939 
    40 float4 CDepth(CPos_OUT IN) : COLOR 
     40float4 CDepth(CPos_OUT IN, 
     41                                uniform float farplane) : COLOR 
    4142{ 
    42  return -IN.CPos.z;      
     43 return float4(-IN.CPos.z, -IN.CPos.z / farplane, 1, -IN.CPos.z);        
    4344} 
    4445 
  • GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPBasic/GTPShadowMap_PS.hlsl

    r2294 r2311  
    1515#define DEPTH_BIAS_VSM  0.001 
    1616#define DEPTH_EPSILON   0.05 
    17 #define DIST_BIAS       0.005 
    18 #define DIST_BIAS_VSM   0.05 
    19 #define DIST_EPSILON    0.01 
     17#define DIST_BIAS       0.0005 
     18#define DIST_BIAS_VSM   0.0005 
     19#define DIST_EPSILON    0.001 
    2020 
    2121//#define shadowColor float4(0.9,0.9,0.9,1) 
    22 #define shadowColor float4(0.1,0.1,0.1,1) 
     22#define shadowColor float4(0.2,0.2,0.2,1) 
    2323 
    2424float4 shadowMapDepth(LightVPos_OUT IN, 
     
    8787                pos.xy = (pos.xy + 1.0) / 2.0; 
    8888                pos.y = 1.0 - pos.y; 
    89                 float4 storedDist = tex2D(shadowMap, pos.xy); 
    90                 dist -= DIST_BIAS; 
    91                 light = max(dist <= storedDist.r, shadowColor);          
     89                float storedDist = tex2D(shadowMap, pos.xy).r; 
     90                light = max(dist < storedDist + DIST_BIAS, shadowColor);     
     91                light = dist < storedDist + DIST_BIAS; 
    9292    } 
    9393  } 
Note: See TracChangeset for help on using the changeset viewer.