Ignore:
Timestamp:
10/01/08 01:10:22 (16 years ago)
Author:
mattausch
Message:

added eye space depth

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/mrt.cg

    r2982 r2984  
    6868                          uniform sampler2D dirtTex, 
    6969                          uniform float maxDepth, 
    70                           uniform sampler2D tex) 
     70                          uniform sampler2D tex, 
     71                          uniform float3 currentPos) 
    7172{ 
    7273        pixel pix; 
     
    9394 
    9495        // hack: squeeze some information about ambient into the texture 
    95         pix.col.w = glstate.material.emission.x; 
    96         //pix.col.w = length(currentPos - IN.worldPos) 
     96        //pix.col.w = glstate.material.emission.x; 
     97        pix.col.w = length(currentPos - IN.worldPos); 
    9798 
    9899        return pix; 
     
    100101 
    101102 
    102 pixel frag(fragin IN,  
    103                    uniform float maxDepth) 
     103pixel frag(fragin IN, uniform float maxDepth, uniform float3 currentPos) 
    104104{ 
    105105        pixel pix; 
     
    117117         
    118118        // hack: squeeze some information about the ambient term into the target 
    119         pix.col.w = glstate.material.emission.x; 
     119        //pix.col.w = glstate.material.emission.x; 
     120        pix.col.w = length(currentPos - IN.worldPos); 
    120121 
    121122        return pix; 
Note: See TracChangeset for help on using the changeset viewer.