Ignore:
Timestamp:
09/19/08 23:13:47 (16 years ago)
Author:
mattausch
Message:

preetham working but big hack

Location:
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders
Files:
2 edited

Legend:

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

    r2954 r2959  
    3333                         uniform float4 position, 
    3434                         uniform float3 normal, 
    35                          uniform float amb, 
     35                         uniform float emmisive, 
    3636                         float3 lightDir) 
    3737{ 
     
    5050        const float4 ambient = glstate.light[0].ambient; 
    5151         
    52         return (ambient + diffuse) * color * (1.0f - amb) + amb * color; 
     52        //return (saturate(((ambient + diffuse))) * (1.0f - emmisive) + emmisive) * color; 
     53        return saturate((((ambient + diffuse)) * (1.0f - emmisive) + emmisive) * color); 
    5354} 
    5455 
     
    152153        const float angle = saturate(dot(normal, lightDir));  
    153154        //float4 lightDiffuse = float4(1.0f, 1.0f, 0.9f, 1.0f); 
    154         float4 lightDiffuse = glstate.light[0].diffuse; 
     155        const float4 lightDiffuse = glstate.light[0].diffuse; 
    155156        //float4(1.0f, 1.0f, 0.9f, 1.0f); 
    156157 
     
    178179         
    179180        // base lighting 
    180         OUT.color = (ambient + diffuse) * color * (1.0f - emmisive) + emmisive * color; 
     181        OUT.color = (emmisive < 0.95) ? (ambient + diffuse) * color : color; 
    181182 
    182183        // also write out depth component 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/sky_preetham.cg

    r2958 r2959  
    2727 
    2828 
    29 struct PixelOutput 
     29 
     30struct pixel 
    3031{ 
    31         float4 color: SV_TARGET0; 
     32  float4 col: COLOR0; 
     33  float4 pos: COLOR1; 
     34  float4 norm: COLOR2; 
    3235}; 
    3336 
     37// fragment input 
     38struct fragin 
     39{ 
     40        float4 color: COLOR0;   
     41        float4 position: POSITION; // eye space 
     42        float4 texCoord: TEXCOORD0;     
    3443 
    35  
     44        float4 projPos: WPOS; 
     45        float4 worldPos: TEXCOORD1; // world position 
     46        float3 normal: TEXCOORD2; 
     47        float4 mypos: TEXCOORD3; 
     48}; 
    3649//-------------------------------------------------------------------------------------- 
    3750// Vertex Shaders 
     
    91104 
    92105 
    93 pixel frag_skydome(fragin IN,  
    94                                    uniform float maxDepth) 
     106pixel frag_skydome(fragin IN) 
    95107{ 
    96108        pixel pix; 
    97109 
    98110        pix.col = IN.color; 
    99         pix.pos = IN.worldPos;// * maxDepth; 
     111        pix.pos = IN.worldPos * 1e20;// * maxDepth; 
    100112 
    101113        pix.norm.xyz = IN.normal; 
    102114         
    103115        // hack: squeeze some information about the ambient term into the target 
    104         pix.norm.w = 0; 
     116        pix.norm.w = 1; 
    105117        pix.pos.w = IN.mypos.w; 
    106118         
Note: See TracChangeset for help on using the changeset viewer.