Changeset 2989
- Timestamp:
- 10/02/08 12:22:32 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
r2985 r2989 947 947 cgGLBindProgram(RenderState::sCgMrtFragmentProgram); 948 948 949 Vector3 pos = camera->GetPosition();949 const Vector3 pos = camera->GetPosition(); 950 950 cgGLSetParameter3f(sCurrentPosParam, pos.x, pos.y, pos.z); 951 951 cgGLSetParameter3f(sCurrentPosParamTex, pos.x, pos.y, pos.z); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/mrt.cg
r2988 r2989 95 95 // hack: squeeze some information about ambient into the texture 96 96 //pix.col.w = glstate.material.emission.x; 97 pix.col.w = length( (currentPos - IN.worldPos) * maxDepth);97 pix.col.w = length(currentPos - IN.worldPos) * maxDepth; 98 98 99 99 return pix; … … 118 118 // hack: squeeze some information about the ambient term into the target 119 119 //pix.col.w = glstate.material.emission.x; 120 pix.col.w = length( (currentPos - IN.worldPos) * maxDepth);120 pix.col.w = length(currentPos - IN.worldPos) * maxDepth; 121 121 122 122 return pix; -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
r2988 r2989 91 91 uniform float3 viewDir, 92 92 uniform float3 eyePos, 93 uniform sampler2D positions,94 93 uniform float3 bl, 95 94 uniform float3 br, … … 127 126 // sample downsampled texture in order to speed up texture accesses 128 127 float eyeSpaceDepth = tex2Dlod(colors, float4(texcoord, 0, SSAO_MIPMAP_LEVEL)).w; 129 130 float2 newOffs = 0.5f + offsetTransformed * 0.5f; 131 132 float3 rotView = normalize(Interpol(newOffs, bl, br, tl, tr)); 128 129 // reconstruct world space position 130 float3 rotView = normalize(Interpol(texcoord, bl, br, tl, tr)); 133 131 float3 sample_position = eyePos - rotView * eyeSpaceDepth; 132 134 133 //float3 sample_position = tex2Dlod(positions, float4(texcoord, 0, SSAO_MIPMAP_LEVEL)).xyz; 135 134 … … 191 190 // the current world position 192 191 const float4 centerPosition = tex2D(positions, IN.texCoord.xy); 193 194 const float eyeDepth = tex2D(colors, IN.texCoord.xy).w;195 float3 view2 = normalize(Interpol(IN.texCoord.xy, bl, br, tl, tr)); 196 192 /// the current view direction 193 float3 viewDir = normalize(IN.view); 194 195 /*const float eyeDepth = tex2D(colors, IN.texCoord.xy).w; 197 196 float4 centerPosition2; 198 197 centerPosition2.xyz = eyePos - view2 * eyeDepth; 198 */ 199 199 200 // the current depth 200 201 const float currentDepth = centerPosition.w; 201 202 202 /// the current view direction203 float3 viewDir = normalize(IN.view);204 205 203 //const float2 ao = ssao(IN, positions, noiseTexture, samples, normal, centerPosition, w, viewDir, eyePos); 206 const float2 ao = ssao(IN, colors, noiseTexture, samples, normal, centerPosition2, w, viewDir, eyePos, positions, 207 bl, br, tl, tr); 204 const float2 ao = ssao(IN, colors, noiseTexture, samples, normal, centerPosition, w, viewDir, eyePos, bl, br, tl, tr); 208 205 209 206
Note: See TracChangeset
for help on using the changeset viewer.