Ignore:
Timestamp:
09/25/08 18:37:03 (16 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r2965 r2974  
    7575 
    7676        // save color in first render target 
    77         // hack: use comination of emmisive + diffuse (emmisive used as constant ambient term) 
     77        // hack: use combination of emmisive + diffuse (emmisive used as constant ambient term) 
    7878        pix.col = (glstate.material.emission + glstate.material.diffuse) * texColor;  
    7979         
    8080        // save world position in second render target 
    8181        pix.pos = IN.worldPos * maxDepth; 
    82         // save normal in third rt 
     82        // save world space normal in third rt 
    8383        pix.norm.xyz = IN.normal; 
    8484 
    85         // hack: squeeze some information about ambient into the texture 
    86         pix.norm.w = glstate.material.emission.x; 
    8785        // store projection coordinates with positions (used for ssao) 
    88         pix.pos.w = IN.projPos.w; 
     86        pix.norm.w = IN.projPos.w; 
     87        // write the depth 
     88        pix.pos.w = IN.mypos.z / IN.mypos.w; 
    8989 
    9090        // account for alpha blending 
     
    9292                discard; 
    9393 
    94         // write the depth 
    95         pix.col.w = IN.mypos.z / IN.mypos.w; 
     94        // hack: squeeze some information about ambient into the texture 
     95        pix.col.w = glstate.material.emission.x; 
    9696 
    9797        return pix; 
     
    110110        pix.norm.xyz = IN.normal; 
    111111         
     112        // store projection coordinates with positions (used for ssao) 
     113        pix.norm.w = IN.mypos.w; 
     114        // the projected depth 
     115        pix.pos.w = IN.mypos.z / IN.mypos.w; 
     116         
    112117        // hack: squeeze some information about the ambient term into the target 
    113         pix.norm.w = glstate.material.emission.x; 
    114         pix.pos.w = IN.mypos.w; 
    115          
    116         // the projected depth 
    117         pix.col.w = IN.mypos.z / IN.mypos.w; 
     118        pix.col.w = glstate.material.emission.x; 
    118119 
    119120        return pix; 
Note: See TracChangeset for help on using the changeset viewer.