Changeset 2832 for GTP


Ignore:
Timestamp:
07/10/08 23:10:18 (16 years ago)
Author:
mattausch
Message:

debug version: noise multipler does not work so well (but would with temporal smoothing)

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

Legend:

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

    r2830 r2832  
    256256//static CGparameter sSamplesParam;  
    257257static CGparameter sSamplesParamSsao;  
     258static CGparameter sNoiseMultiplierParam;;  
    258259 
    259260 
     
    537538                sNormalsTexParamSsao = cgGetNamedParameter(sCgSsaoProgram, "normals");   
    538539                sNoiseTexParamSsao = cgGetNamedParameter(sCgSsaoProgram, "noiseTexture"); 
     540                sNoiseMultiplierParam = cgGetNamedParameter(sCgSsaoProgram, "noiseMultiplier"); 
     541                 
    539542                cgGLDisableTextureParameter(sNoiseTexParamSsao); 
    540543 
     
    19171920                cgGLEnableTextureParameter(sNoiseTexParamSsao); 
    19181921                cgGLSetTextureParameter(sNoiseTexParamSsao, noiseTex); 
     1922 
     1923                cgGLSetParameter1f(sNoiseMultiplierParam, RandomValue(3.0f, 7.0f)); 
    19191924        } 
    19201925        else 
     
    20472052        // generates poisson distribution on disc 
    20482053        float factor = 1.0f; 
    2049         float minDist = factor * sqrt((float)NUM_SAMPLES) / 2; 
     2054        float minDist = factor / (sqrt((float)NUM_SAMPLES) * 2.0f); 
    20502055 
    20512056        cout << "minDist= " << minDist << endl; 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg

    r2830 r2832  
    5050           uniform sampler2D noiseTexture, 
    5151           uniform float2 samples[NUM_SAMPLES], 
    52            uniform float3 currentNormal 
    53            ) 
     52           uniform float3 currentNormal, 
     53           uniform float noiseMultiplier) 
    5454{ 
    5555  // the current world position 
     
    7272     
    7373    //sample noisetex; r stores costheta, g stores sintheta 
    74     float2 noise = tex2D(noiseTexture, IN.texCoord.xy * 7.0f).xy * 2.0f - 1.0f; 
     74    float2 noise = tex2D(noiseTexture, IN.texCoord.xy * noiseMultiplier).xy * 2.0f - 1.0f; 
    7575         
    7676    // rotation 
     
    144144               uniform sampler2D normals, 
    145145               uniform sampler2D noiseTexture, 
    146                uniform float2 samples[NUM_SAMPLES]) 
     146               uniform float2 samples[NUM_SAMPLES], 
     147               uniform float noiseMultiplier) 
    147148{ 
    148149  pixel OUT; 
     
    155156 
    156157  float4 col = shade(IN, colors, positions, normal, amb); 
    157   float ao = ssao(IN, positions, noiseTexture, samples, normal); 
     158  float ao = ssao(IN, positions, noiseTexture, samples, normal, noiseMultiplier); 
    158159   
    159160   //OUT.color = ao; 
Note: See TracChangeset for help on using the changeset viewer.