Changeset 2832 for GTP/trunk/App
- Timestamp:
- 07/10/08 23:10:18 (16 years ago)
- 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 256 256 //static CGparameter sSamplesParam; 257 257 static CGparameter sSamplesParamSsao; 258 static CGparameter sNoiseMultiplierParam;; 258 259 259 260 … … 537 538 sNormalsTexParamSsao = cgGetNamedParameter(sCgSsaoProgram, "normals"); 538 539 sNoiseTexParamSsao = cgGetNamedParameter(sCgSsaoProgram, "noiseTexture"); 540 sNoiseMultiplierParam = cgGetNamedParameter(sCgSsaoProgram, "noiseMultiplier"); 541 539 542 cgGLDisableTextureParameter(sNoiseTexParamSsao); 540 543 … … 1917 1920 cgGLEnableTextureParameter(sNoiseTexParamSsao); 1918 1921 cgGLSetTextureParameter(sNoiseTexParamSsao, noiseTex); 1922 1923 cgGLSetParameter1f(sNoiseMultiplierParam, RandomValue(3.0f, 7.0f)); 1919 1924 } 1920 1925 else … … 2047 2052 // generates poisson distribution on disc 2048 2053 float factor = 1.0f; 2049 float minDist = factor * sqrt((float)NUM_SAMPLES) / 2;2054 float minDist = factor / (sqrt((float)NUM_SAMPLES) * 2.0f); 2050 2055 2051 2056 cout << "minDist= " << minDist << endl; -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg
r2830 r2832 50 50 uniform sampler2D noiseTexture, 51 51 uniform float2 samples[NUM_SAMPLES], 52 uniform float3 currentNormal 53 )52 uniform float3 currentNormal, 53 uniform float noiseMultiplier) 54 54 { 55 55 // the current world position … … 72 72 73 73 //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; 75 75 76 76 // rotation … … 144 144 uniform sampler2D normals, 145 145 uniform sampler2D noiseTexture, 146 uniform float2 samples[NUM_SAMPLES]) 146 uniform float2 samples[NUM_SAMPLES], 147 uniform float noiseMultiplier) 147 148 { 148 149 pixel OUT; … … 155 156 156 157 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); 158 159 159 160 //OUT.color = ao;
Note: See TracChangeset
for help on using the changeset viewer.