- Timestamp:
- 07/14/08 18:17:50 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
r2835 r2836 2095 2095 cgGLSetParameter1f(sNoiseMultiplierParam, RandomValue(3.0f, 17.0f)); 2096 2096 2097 //GenerateSamples(); cgGLSetParameterArray2f(sSamplesParamSsao, 0, NUM_SAMPLES, (const float *)samples);2097 GenerateSamples(); cgGLSetParameterArray2f(sSamplesParamSsao, 0, NUM_SAMPLES, (const float *)samples); 2098 2098 } 2099 2099 else -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/default.env
r2830 r2836 5 5 maxBatchSize=50 6 6 trianglesPerVirtualLeaf=500 7 keyForwardMotion= 30.0f7 keyForwardMotion=20.0f 8 8 keyRotation=1.5f 9 9 winWidth=1024 … … 12 12 useFullScreen=0 13 13 numSsaoSamples=8 14 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg
r2835 r2836 7 7 //#define SAMPLE_INTENSITY 0.125f 8 8 // rule of thumb: approx 1 / NUM_SAMPLES 9 #define SAMPLE_INTENSITY 0. 16//0.0625f9 #define SAMPLE_INTENSITY 0.22 //0.0625f 10 10 11 11 #define AREA_SIZE 5e-1f … … 14 14 struct fragment 15 15 { 16 float4 pos: WPOS; // normalized screen position 17 float4 texCoord: TEXCOORD0; 18 float3 view: COLOR0; 16 // normalized screen position 17 float4 pos: WPOS; 18 float4 texCoord: TEXCOORD0; 19 float3 view: COLOR0; 19 20 }; 20 21 … … 68 69 69 70 const float areaSize = 5e-1f; 70 //const float areaSize = 3e-1f;71 //const float sampleIntensity = 0.2f;72 71 73 72 for (int i = 0; i < NUM_SAMPLES; i ++) … … 164 163 (SAMPLE_INTENSITY * distanceScale) / (distanceScale + length_to_sample * length_to_sample); 165 164 165 const float view_correction_scale = 0.5f; 166 166 // if normal perpenticular to view dir, only half of the samples count 167 float view_correction = 1.0f + 0.5f* (1.0f - dot(currentViewDir, currentNormal));167 float view_correction = 1.0f + view_correction_scale * (1.0f - dot(currentViewDir, currentNormal)); 168 168 169 169 total_ao += cos_angle * distance_intensity * view_correction; 170 total_color += cos_angle * distance_intensity * view_correction * sample_color ;170 total_color += cos_angle * distance_intensity * view_correction * sample_color * 0.3f; 171 171 } 172 172 … … 234 234 float ao = new_col.w; 235 235 236 //float4 attenuated_color = ao * col + new_col;237 float4 attenuated_color = ao * col;236 float4 attenuated_color = ao * col + new_col; 237 //float4 attenuated_color = ao * col; 238 238 239 239 //OUT.color = ao; 240 //OUT.color = ao * col; 240 //OUT.color = ao * col; 241 //float4 col1 = attenuated_color; 242 243 const float x = 0.1f; 244 241 245 float4 dummy = centerPosition * maxDepth; 242 246 dummy.w = 1.0f; 247 243 248 float4 oldPos = mul(oldModelViewProj, dummy); 244 249 245 250 float newDepth = oldPos.z / oldPos.w; 246 251 247 const float x = 0.1f;248 249 252 float2 tex = (oldPos.xy / oldPos.w) * 0.5f + 0.5f; 250 253 float4 col1 = tex2D(oldTex, tex); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/mrt.cg
r2834 r2836 78 78 pix.pos = IN.worldPos * maxDepth; 79 79 pix.norm.xyz = IN.normal * 0.5f + 0.5f; 80 80 81 // hack: squeeze some information about ambient into the texture 81 82 pix.norm.w = ambient.x; 82 83 // hack: store projection coordinate for scaling ssao 83 84 pix.pos.w = IN.projPos.w; 85 86 if (pix.col.w < 0.9f) 87 discard; 88 84 89 pix.col.w = IN.mypos.z / IN.mypos.w; 85 90
Note: See TracChangeset
for help on using the changeset viewer.