Ignore:
Timestamp:
09/20/08 23:35:20 (16 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r2958 r2960  
    6767pixel fragtex(fragin IN,  
    6868                          uniform sampler2D tex,  
    69                           uniform float maxDepth,  
    70                           uniform float4 ambient,  
    71                           uniform float4 diffuse) 
     69                          uniform float maxDepth) 
    7270{ 
    7371        pixel pix; 
    7472 
    7573        // save color in first render target 
    76         pix.col = (ambient + diffuse) * tex2D(tex, IN.texCoord.xy); 
     74        // hack: use comination of emmisive + diffuse (emmisive used as constant ambient term) 
     75        pix.col = (glstate.material.emission + glstate.material.diffuse) * tex2D(tex, IN.texCoord.xy); 
    7776         
    7877        // save world position in second render target 
     
    8281 
    8382        // hack: squeeze some information about ambient into the texture 
    84         pix.norm.w = ambient.x; 
     83        pix.norm.w = glstate.material.emission.x; 
    8584        // store projection coordinates with positions (used for ssao) 
    8685        pix.pos.w = IN.projPos.w; 
     
    9897 
    9998pixel frag(fragin IN,  
    100                    uniform float maxDepth,  
    101                    uniform float4 ambient,  
    102                    uniform float4 diffuse 
    103                    ) 
     99                   uniform float maxDepth) 
    104100{ 
    105101        pixel pix; 
    106102 
    107         pix.col = diffuse; 
     103        // hack: use comination of emmisive + diffuse (emmisive used as constant ambient term) 
     104        pix.col = glstate.material.diffuse + glstate.material.emission; 
    108105        pix.pos = IN.worldPos * maxDepth; 
    109106 
     
    111108         
    112109        // hack: squeeze some information about the ambient term into the target 
    113         pix.norm.w = ambient.x; 
     110        pix.norm.w = glstate.material.emission.x; 
    114111        pix.pos.w = IN.mypos.w; 
    115112         
Note: See TracChangeset for help on using the changeset viewer.