- Timestamp:
- 10/08/08 14:26:31 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
r3012 r3014 569 569 RenderState::sTexParam = cgGetNamedParameter(RenderState::sCgMrtFragmentTexProgram, "tex"); 570 570 571 cgGLSetParameter1f(sMaxDepthParamTex, MAX_DEPTH_CONST / farDist); 571 //const float maxDepth = MAX_DEPTH_CONST / farDist; 572 const float maxDepth = 1.0f; 573 574 cgGLSetParameter1f(sMaxDepthParamTex, maxDepth); 572 575 573 576 sTLParamTex = cgGetNamedParameter(RenderState::sCgMrtFragmentTexProgram, "tl"); … … 594 597 sEyePosParam = cgGetNamedParameter(RenderState::sCgMrtFragmentTexProgram, "eyePos"); 595 598 596 cgGLSetParameter1f(sMaxDepthParam, MAX_DEPTH_CONST / farDist); 599 //const float maxDepth = MAX_DEPTH_CONST / farDist; 600 const float maxDepth = 1.0f; 601 602 cgGLSetParameter1f(sMaxDepthParam, maxDepth); 597 603 598 604 sTLParam = cgGetNamedParameter(RenderState::sCgMrtFragmentProgram, "tl"); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaderenv.h
r3010 r3014 15 15 #define AREA_SIZE 8e-1f 16 16 17 //#define DISTANCE_SCALE 1e-4f18 #define DISTANCE_SCALE 1e-6f17 #define DISTANCE_SCALE 1e-4f 18 //#define DISTANCE_SCALE 1e-6f 19 19 20 20 #define ILLUM_INTENSITY 5e-1f; -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg
r3009 r3014 64 64 uniform sampler2D normals, 65 65 uniform float3 lightDir 66 //, uniform sampler2D oldColors67 66 ) 68 67 { -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/globillum.cg
r3010 r3014 64 64 uniform float3 centerPosition, 65 65 float w, 66 uniform float3 eyePos,67 66 uniform float3 bl, 68 67 uniform float3 br, … … 107 106 //-- reconstruct world space position from sample 108 107 109 float4 sample = tex2Dlod(colors, float4(texcoord, 0, 0)); 108 const float4 sample = tex2Dlod(colors, float4(texcoord, 0, 0)); 109 110 110 const float eyeSpaceDepth = sample.w; 111 111 //float3 rotView = normalize(Interpol(texcoord, bl, br, tl, tr)); 112 112 float3 rotView = Interpol(texcoord, bl, br, tl, tr); 113 113 114 115 const float3 sample_position = eyePos - rotView * eyeSpaceDepth; 114 const float3 sample_position = - rotView * eyeSpaceDepth; 116 115 const float3 sample_color = sample.xyz; 117 116 … … 181 180 const float eyeDepth = tex2Dlod(colors, float4(IN.texCoord.xy, 0, 0)).w; 182 181 182 const float3 eyeSpacePos = -viewDir * eyeDepth; 183 183 184 float3 centerPosition; 184 185 centerPosition.xyz = eyePos - viewDir * eyeDepth; … … 190 191 //-- compute color bleeding + ao 191 192 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); 193 194 194 195 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
r3010 r3014 46 46 47 47 // reconstruct world space position 48 inline float3 ReconstructSamplePosition( float3 eyePos,48 inline float3 ReconstructSamplePosition( 49 49 uniform sampler2D colors, 50 50 float2 texcoord, … … 56 56 float3 rotView = Interpol(texcoord, bl, br, tl, tr); 57 57 58 float3 samplePos = eyePos -rotView * eyeSpaceDepth;58 float3 samplePos = -rotView * eyeSpaceDepth; 59 59 #else 60 60 float3 samplePos = tex2Dlod(colors, float4(texcoord, 0, SSAO_MIPMAP_LEVEL)).xyz; … … 73 73 uniform float3 centerPosition, 74 74 uniform float scaleFactor, 75 uniform float3 eyePos,76 75 uniform float3 bl, 77 76 uniform float3 br, … … 107 106 //if ((texcoord.x <= 1.0f) && (texcoord.x >= 0.0f) && (texcoord.y <= 1.0f) && (texcoord.y >= 0.0f))++ numSamples; 108 107 109 float3 samplePos = ReconstructSamplePosition( eyePos,colors, texcoord, bl, br, tl, tr);108 float3 samplePos = ReconstructSamplePosition(colors, texcoord, bl, br, tl, tr); 110 109 111 110 … … 124 123 // the distance to a sample approaches zero 125 124 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); 127 127 128 128 #if 0 … … 173 173 const float eyeDepth = tex2Dlod(colors, float4(IN.texCoord, 0, 0)).w; 174 174 175 const float3 eyeSpacePos = -viewDir * eyeDepth; 176 175 177 float3 centerPosition; 176 178 centerPosition.xyz = eyePos - viewDir * eyeDepth; 177 179 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); 179 181 #else 180 182 … … 182 184 const float3 centerPosition = tex2Dlod(positions, float4(IN.texCoord, 0, 0)).xyz; 183 185 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); 185 187 186 188 #endif … … 262 264 float4 ao = tex2Dlod(ssaoTex, float4(IN.texCoord, 0, 0)); 263 265 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); 266 268 OUT.illum_col.w = col.w; 267 269 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/tonemap.cg
r3010 r3014 51 51 uniform float2 downSampleOffs[NUM_DOWNSAMPLES]): COLOR 52 52 { 53 //return tex2Dlod(colors, float4(IN.texCoord, 0, 0)); 54 53 55 float4 average = .0f; 54 56
Note: See TracChangeset
for help on using the changeset viewer.