Changeset 3196 for GTP


Ignore:
Timestamp:
11/29/08 22:14:13 (16 years ago)
Author:
mattausch
Message:

obviously solved filtering problem, but still problems with building edges

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

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaderenv.h

    r3195 r3196  
    1212// for quadratic falloff 
    1313//#define SAMPLE_INTENSITY 0.9f 
    14 #define SAMPLE_INTENSITY 2.0f 
     14//#define SAMPLE_INTENSITY 2.0f 
    1515 
    1616//#define SAMPLE_INTENSITY 0.075f 
    17 //#define SAMPLE_INTENSITY 0.2f 
     17#define SAMPLE_INTENSITY 0.2f 
    1818 
    1919#define SAMPLE_RADIUS 8e-1f 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/combineSsao.cg

    r3195 r3196  
    179179 
    180180        float4 dummy; 
    181         const float xoffs = .5f / 1024.0f; 
    182         const float yoffs = .5f / 768.0f; 
    183  
    184         dummy.x = tex2Dlod(ssaoTex, float4(IN.texCoord + float2(xoffs, 0), 0, 0)).y; 
     181        //const float xoffs = .5f / 1024.0f;    const float yoffs = .5f / 768.0f; 
     182        const float xoffs = 1.0f / 1024.0f;     const float yoffs = 1.0f / 768.0f; 
     183 
     184        dummy.x = tex2Dlod(ssaoTex, float4(IN.texCoord + float2(xoffs, yoffs), 0, 0)).w; 
     185        dummy.y = tex2Dlod(ssaoTex, float4(IN.texCoord + float2(xoffs, -yoffs), 0, 0)).w; 
     186        dummy.z = tex2Dlod(ssaoTex, float4(IN.texCoord + float2(-xoffs, yoffs), 0, 0)).w; 
     187        dummy.w = tex2Dlod(ssaoTex, float4(IN.texCoord + float2(-yoffs, -yoffs), 0, 0)).w; 
     188 
     189        /*dummy.x = tex2Dlod(ssaoTex, float4(IN.texCoord + float2(xoffs, 0), 0, 0)).y; 
    185190        dummy.y = tex2Dlod(ssaoTex, float4(IN.texCoord + float2(0, yoffs), 0, 0)).y; 
    186191        dummy.z = tex2Dlod(ssaoTex, float4(IN.texCoord + float2(-xoffs, 0), 0, 0)).y; 
    187192        dummy.w = tex2Dlod(ssaoTex, float4(IN.texCoord + float2(0, -yoffs), 0, 0)).y; 
    188  
     193*/ 
    189194        const float convergence = min(min(dummy.x, dummy.y), min(dummy.z, dummy.w)); 
    190195        //const float convergence = max(max(dummy.x, dummy.y), max(dummy.z, dummy.w)); 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg

    r3195 r3196  
    296296        pixel pix; 
    297297 
    298         //const float3 normal = normalize(tex2Dlod(normalsTex, float4(IN.texCoord, 0 ,0)).xyz); 
    299         const float3 normal = tex2Dlod(normalsTex, float4(IN.texCoord, 0 ,0)).xyz; 
     298        const float3 normal = normalize(tex2Dlod(normalsTex, float4(IN.texCoord, 0 ,0)).xyz); 
    300299        const float3 difVec = tex2Dlod(diffVals, float4(IN.texCoord, 0 ,0)).xyz; 
    301300 
     
    305304         
    306305        float4 dummy; 
    307         const float xoffs = .5f / 1024.0f; 
    308         const float yoffs = .5f / 768.0f; 
    309  
    310         dummy.x = tex2Dlod(colorsTex, float4(IN.texCoord + float2(xoffs, 0), 0, 0)).w; 
    311         dummy.y = tex2Dlod(colorsTex, float4(IN.texCoord + float2(0, yoffs), 0, 0)).w; 
    312         dummy.z = tex2Dlod(colorsTex, float4(IN.texCoord + float2(-xoffs, 0), 0, 0)).w; 
    313         dummy.w = tex2Dlod(colorsTex, float4(IN.texCoord + float2(0, -yoffs), 0, 0)).w; 
    314         color.w =  max(max(dummy.x, dummy.y), max(dummy.z, dummy.w)); 
     306        //const float xoffs = .5f / 1024.0f; const float yoffs = .5f / 768.0f; 
     307        const float xoffs = 1.0f / 1024.0f; const float yoffs = 1.0f / 768.0f; 
     308 
     309        dummy.x = tex2Dlod(colorsTex, float4(IN.texCoord + float2(xoffs, yoffs), 0, 0)).w; 
     310        dummy.y = tex2Dlod(colorsTex, float4(IN.texCoord + float2(xoffs, -yoffs), 0, 0)).w; 
     311        dummy.z = tex2Dlod(colorsTex, float4(IN.texCoord + float2(-xoffs, yoffs), 0, 0)).w; 
     312        dummy.w = tex2Dlod(colorsTex, float4(IN.texCoord + float2(-yoffs, -yoffs), 0, 0)).w; 
     313        //color.w = min(min(dummy.x, dummy.y), min(dummy.z, dummy.w)); 
     314        //color.w = max(max(dummy.x, dummy.y), max(dummy.z, dummy.w)); 
    315315         
    316316        // store scaled view vector so wie don't have to normalize for e.g., ssao 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg

    r3195 r3196  
    300300                // the distance_scale offset is used to avoid singularity that occurs at global illumination when  
    301301                // the distance to a sample approaches zero 
    302                 const float aoContrib = SAMPLE_INTENSITY / (DISTANCE_SCALE + lengthToSample * lengthToSample); 
     302                //const float aoContrib = SAMPLE_INTENSITY / (DISTANCE_SCALE + lengthToSample * lengthToSample); 
     303                const float aoContrib = SAMPLE_INTENSITY / max(1e-1f, lengthToSample * lengthToSample); 
    303304                //const float aoContrib = (1.0f > lengthToSample) ? occlusionPower(9e-2f, DISTANCE_SCALE + lengthToSample): .0f; 
    304305 
Note: See TracChangeset for help on using the changeset viewer.