Changeset 3168


Ignore:
Timestamp:
11/25/08 18:58:47 (16 years ago)
Author:
mattausch
Message:

removed bug (second aa output), normsl normalization now during mrt output

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

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp

    r3167 r3168  
    519519 
    520520        // antialiasing of the color buffer 
    521         AntiAliasing(fbo, light); 
     521        //AntiAliasing(fbo, light); 
    522522 
    523523        switch (mShadingMethod) 
     
    546546        // as multisampling is difficult / costly with deferred shading,  
    547547        // at least do some antialiasing 
    548         AntiAliasing(fbo, light); 
     548        //AntiAliasing(fbo, light); 
    549549 
    550550        // just output the latest buffer 
    551         //Output(fbo); 
     551        Output(fbo); 
    552552 
    553553        glEnable(GL_LIGHTING); 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/antialiasing.cg

    r3167 r3168  
    8080        // weight: 0 = no antialiasing, 1 = full antialiasing 
    8181        const float w = (1.0f - de * ne) * kernel.x; 
    82  
    8382        // smoothed color: the offset is big where discontinuities are 
    8483        // (a - c) * w + c = a * w + c * (1 - w) 
     
    9695        //float4 col = float4(de.x, de.x, de.x, 0); 
    9796        //float4 col = float4(w, w, w, 0); 
    98         //float4 col = float4(centerNormal * 0.5f + float3(0.5f), 0); 
    99         //col = step(.0f, col); 
    100         //float4 col = float4(centerNormal, 0); 
    101  
     97         
    10298        // push through the current depth 
    10399        col.w = centerDepth.x; 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/combineSsao.cg

    r3167 r3168  
    180180        //if (col.w < 1e10f) 
    181181        { 
    182                 const float eyeSpaceDepth = col.w; 
    183                 const float distanceScaleWeight = 2.0f; 
     182                //const float eyeSpaceDepth = col.w; const float distanceScaleWeight = 2.0f; 
    184183                //const float distanceScale = distanceScaleWeight / (eyeSpaceDepth + distanceScaleWeight); 
    185184                const float distanceScale = 1.0f; 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg

    r3167 r3168  
    156156        pixel OUT; 
    157157 
    158         float4 norm = tex2D(normals, IN.texCoord.xy); 
    159         const float3 normal = normalize(norm.xyz); 
     158        const float3 normal = tex2D(normals, IN.texCoord.xy); 
    160159 
    161160        float4 color = tex2Dlod(colors, float4(IN.texCoord, 0, 0)); 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/globillum.cg

    r3104 r3168  
    166166        pixel2 OUT; 
    167167 
    168         float4 norm = tex2Dlod(normals, float4(IN.texCoord, 0 ,0)); 
    169         float3 normal = normalize(norm.xyz);     
     168        const float3 normal = tex2Dlod(normals, float4(IN.texCoord, 0 ,0)); 
    170169 
    171170         
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/mrt.cg

    r3136 r3168  
    9494        // multiply with the inverse transpose of T, we multiple with  
    9595        // Transp(Inv(Inv(view))) = Transp(view) 
    96         pix.norm = mul(transpose(viewMatrix), IN.normal).xyz; 
     96        pix.norm = normalize(mul(transpose(viewMatrix), IN.normal).xyz); 
    9797        //pix.norm = IN.normal.xyz; 
    9898        // compute eye linear depth 
     
    116116        // multiplying with inverse view. since transforming normal with T means to  
    117117        // multiply with the inverse transpose of T, we multiple with Transp(Inv(Inv(view))) = Transp(view) 
    118         pix.norm = mul(transpose(viewMatrix), IN.normal).xyz; 
     118        pix.norm = normalize(mul(transpose(viewMatrix), IN.normal).xyz); 
    119119        //pix.norm = IN.normal.xyz; 
    120120        // eye space depth 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/normalMapping.cg

    r3163 r3168  
    124124        // as it is the inverse of a rotation matrix  
    125125        float3x3 tangToWorldTrafo = transpose(float3x3(tangent, bitangent, normal)); 
    126         //float3x3 tangToWorldTrafo = transpose(float3x3(bitangent, tangent, normal)); 
    127         //float3x3 tangToWorldTrafo = transpose(float3x3(tangent, normal, bitangent)); 
    128         //float3x3 tangToWorldTrafo = transpose(float3x3(normal, bitangent, tangent)); 
    129         //float3x3 tangToWorldTrafo = transpose(float3x3(normal, tangent, bitangent)); 
    130  
     126         
    131127        const float3 tangentSpaceNorm = tex2Dlod(normalMap, float4(IN.texCoord.xy, 0, 0)).xyz * 2.0f - float3(1.0f); 
    132         //const float3 tangentSpaceNorm = float3(0, 1, 0); 
    133         //const float3 tangentSpaceNorm = float3(0, 0, 1); 
    134128         
    135129        pix.normal = normalize(mul(tangToWorldTrafo, tangentSpaceNorm)); 
    136         //pix.normal = normalize(tangentSpaceNorm); 
    137         //pix.color.xyz = float3(abs(dot(tangent.xyz, normal.xyz))); 
    138         //pix.color.xyz = float3(abs(dot(bitangent.xyz, tangent.xyz))); 
    139         //pix.color.xyz = float3(abs(dot(normalize(IN.normal.xyz), normalize(IN.tangent.xyz)))); 
    140         //pix.color.xyz = float3(abs(dot(IN.normal.xyz, IN.tangent.xyz))); 
    141         //pix.color.xyz = normal.xyz; 
    142         //pix.color.xyz = IN.tangent.xyz; 
    143         //pix.color.xyz = float3(IN.texCoord.x,0,0); 
    144         //pix.color.xyz = float3(0,IN.texCoord.y,0); 
    145          
     130                 
    146131        return pix; 
    147132} 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao3d.cg

    r3167 r3168  
    124124        pixel OUT; 
    125125 
    126         float4 norm = tex2D(normals, IN.texCoord.xy); 
    127          
    128         // the ambient term 
    129         //const float amb = norm.w; 
    130         // expand normal 
    131         float3 normal = normalize(norm.xyz); 
     126        const float3 normal = tex2D(normals, IN.texCoord.xy); 
    132127        /// the current view direction 
    133         float3 viewDir;// = normalize(IN.view); 
    134  
     128        float3 viewDir = normalize(IN.view); 
    135129        // the current world position 
    136130        const float4 centerPosition = tex2D(positions, IN.texCoord.xy); 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/treeanimation.cg

    r3155 r3168  
    9999        OUT.eyePos += offs; 
    100100 
    101         OUT.normal = mul(glstate.matrix.invtrans.modelview[0], IN.normal); 
     101        OUT.normal = normalize(mul(glstate.matrix.invtrans.modelview[0], IN.normal)); 
    102102         
    103103        // hack: no translational component anyway 
Note: See TracChangeset for help on using the changeset viewer.