Changeset 2327


Ignore:
Timestamp:
04/16/07 18:15:52 (17 years ago)
Author:
szirmay
Message:
 
Location:
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPParticles
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPParticles/GTP_HPS.hlsl

    r2024 r2327  
    313313 
    314314float4 HPS_Large_Depth_Illum_PS(VS_OUT_DEPTH_ILLUM IN, 
     315                                                uniform float nearPlane, 
    315316                                                uniform sampler2D Texture  : register(s0), 
    316317                                                uniform sampler2D depthTexture : register(s1), 
     
    337338                float frontDepth = IN.cPosition.z + size * (f - 0.5); 
    338339                float backDepth = IN.cPosition.z +  size * (b - 0.5); 
    339                  
    340                 alpha = (sceneDepth - frontDepth) / (backDepth - frontDepth); 
     340                float B = min(sceneDepth, backDepth); 
     341                float F = max(frontDepth, nearPlane); 
     342                float ds = B - F; 
     343                alpha = ds / (backDepth - frontDepth); 
    341344                alpha = saturate(alpha) * impostor.a; 
    342345        } 
  • GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPParticles/GTP_Particles.material

    r2315 r2327  
    226226                        fragment_program_ref GTP/HPS/Large_Depth_Illum_PS 
    227227                        {  
    228                          
     228                                param_named_auto nearPlane near_clip_distance 
    229229                        }                        
    230230                        //impostor texture 
Note: See TracChangeset for help on using the changeset viewer.