Ignore:
Timestamp:
10/08/08 14:26:31 (16 years ago)
Author:
mattausch
Message:

removed eyepos from sssao shader, played around with maxdepth

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

Legend:

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

    r3009 r3014  
    6464                   uniform sampler2D normals, 
    6565                   uniform float3 lightDir 
    66                   //, uniform sampler2D oldColors 
    6766                   ) 
    6867{ 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/globillum.cg

    r3010 r3014  
    6464                                   uniform float3 centerPosition, 
    6565                                   float w, 
    66                                    uniform float3 eyePos, 
    6766                                   uniform float3 bl, 
    6867                                   uniform float3 br, 
     
    107106                //-- reconstruct world space position from sample 
    108107 
    109                 float4 sample = tex2Dlod(colors, float4(texcoord, 0, 0)); 
     108                const float4 sample = tex2Dlod(colors, float4(texcoord, 0, 0)); 
     109 
    110110                const float eyeSpaceDepth = sample.w; 
    111111                //float3 rotView = normalize(Interpol(texcoord, bl, br, tl, tr)); 
    112112                float3 rotView = Interpol(texcoord, bl, br, tl, tr); 
    113113                 
    114                  
    115                 const float3 sample_position = eyePos - rotView * eyeSpaceDepth; 
     114                const float3 sample_position = - rotView * eyeSpaceDepth; 
    116115                const float3 sample_color = sample.xyz; 
    117116 
     
    181180        const float eyeDepth = tex2Dlod(colors, float4(IN.texCoord.xy, 0, 0)).w; 
    182181         
     182        const float3 eyeSpacePos = -viewDir * eyeDepth; 
     183 
    183184        float3 centerPosition; 
    184185        centerPosition.xyz = eyePos - viewDir * eyeDepth; 
     
    190191        //-- compute color bleeding + ao 
    191192 
    192         GiStruct gi = globIllum(IN, colors, noiseTexture, samples, normal, centerPosition, w, eyePos, bl, br, tl, tr); 
     193        GiStruct gi = globIllum(IN, colors, noiseTexture, samples, normal, eyeSpacePos, w, bl, br, tl, tr); 
    193194         
    194195 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg

    r3010 r3014  
    4646 
    4747// reconstruct world space position 
    48 inline float3 ReconstructSamplePosition(float3 eyePos,  
     48inline float3 ReconstructSamplePosition( 
    4949                                                                                uniform sampler2D colors, 
    5050                                                                                float2 texcoord,  
     
    5656        float3 rotView = Interpol(texcoord, bl, br, tl, tr); 
    5757         
    58         float3 samplePos = eyePos - rotView * eyeSpaceDepth; 
     58        float3 samplePos = -rotView * eyeSpaceDepth; 
    5959#else 
    6060        float3 samplePos = tex2Dlod(colors, float4(texcoord, 0, SSAO_MIPMAP_LEVEL)).xyz; 
     
    7373                   uniform float3 centerPosition, 
    7474                   uniform float scaleFactor, 
    75                    uniform float3 eyePos, 
    7675                   uniform float3 bl, 
    7776                   uniform float3 br, 
     
    107106                //if ((texcoord.x <= 1.0f) && (texcoord.x >= 0.0f) && (texcoord.y <= 1.0f) && (texcoord.y >= 0.0f))++ numSamples; 
    108107 
    109                 float3 samplePos = ReconstructSamplePosition(eyePos, colors, texcoord, bl, br, tl, tr); 
     108                float3 samplePos = ReconstructSamplePosition(colors, texcoord, bl, br, tl, tr); 
    110109 
    111110 
     
    124123                // the distance to a sample approaches zero 
    125124                const float intensity =  
    126                         (SAMPLE_INTENSITY * DISTANCE_SCALE) / (DISTANCE_SCALE + lengthSample * lengthSample); 
     125                        //(SAMPLE_INTENSITY * DISTANCE_SCALE) / (DISTANCE_SCALE + lengthSample * lengthSample); 
     126                        SAMPLE_INTENSITY / (DISTANCE_SCALE + lengthSample * lengthSample); 
    127127 
    128128#if 0 
     
    173173        const float eyeDepth = tex2Dlod(colors, float4(IN.texCoord, 0, 0)).w; 
    174174 
     175        const float3 eyeSpacePos = -viewDir * eyeDepth; 
     176 
    175177        float3 centerPosition; 
    176178        centerPosition.xyz = eyePos - viewDir * eyeDepth; 
    177179 
    178         const float2 ao = ssao(IN, colors, noiseTexture, samples, normal, centerPosition, w, eyePos, bl, br, tl, tr); 
     180        const float2 ao = ssao(IN, colors, noiseTexture, samples, normal, eyeSpacePos, w, bl, br, tl, tr); 
    179181#else 
    180182 
     
    182184        const float3 centerPosition = tex2Dlod(positions, float4(IN.texCoord, 0, 0)).xyz; 
    183185 
    184         const float2 ao = ssao(IN, positions, noiseTexture, samples, normal, centerPosition, w, eyePos, bl, br, tl, tr); 
     186        const float2 ao = ssao(IN, positions, noiseTexture, samples, normal, centerPosition, w, bl, br, tl, tr); 
    185187 
    186188#endif 
     
    262264        float4 ao = tex2Dlod(ssaoTex, float4(IN.texCoord, 0, 0)); 
    263265 
    264         OUT.illum_col = col * ao.x; 
    265         //OUT.illum_col = float4(ao.x,ao.x,ao.x, ao.w); 
     266        //OUT.illum_col = col * ao.x; 
     267        OUT.illum_col = float4(ao.x,ao.x,ao.x, ao.w); 
    266268        OUT.illum_col.w = col.w; 
    267269 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/tonemap.cg

    r3010 r3014  
    5151                                  uniform float2 downSampleOffs[NUM_DOWNSAMPLES]): COLOR 
    5252{     
     53        //return tex2Dlod(colors, float4(IN.texCoord, 0, 0)); 
     54 
    5355    float4 average = .0f; 
    5456 
Note: See TracChangeset for help on using the changeset viewer.