Changeset 2985 for GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders
- Timestamp:
- 10/01/08 11:35:23 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg
r2984 r2985 82 82 83 83 OUT.color = col; 84 84 85 OUT.color.w = color.w; 86 85 87 86 88 //////////// 87 89 //-- write out logaritmic luminance for tone mapping 88 90 /* 89 91 float4 oldColor = tex2Dlod(colors, float4(IN.texCoord.xy, 0, MAX_LOD_LEVEL)); 90 92 … … 101 103 else 102 104 OUT.color.w = logLumScaled; 103 105 */ 104 106 return OUT; 105 107 } -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
r2982 r2985 36 36 */ 37 37 float2 ssao(fragment IN, 38 uniform sampler2D positions,38 uniform sampler2D colors, 39 39 uniform sampler2D noiseTexture, 40 40 uniform float2 samples[NUM_SAMPLES], 41 41 uniform float3 currentNormal, 42 42 uniform float4 centerPosition, 43 uniform float scaleFactor 44 //,uniform float3 currentViewDir 43 uniform float scaleFactor, 44 uniform float3 viewDir, 45 uniform float3 eyePos 45 46 ) 46 47 { … … 59 60 //////////////////// 60 61 // add random noise: reflect around random normal vector (warning: slow!) 62 61 63 float2 mynoise = tex2D(noiseTexture, IN.texCoord.xy).xy; 62 64 const float2 offsetTransformed = myreflect(offset, mynoise); … … 71 73 72 74 // sample downsampled texture in order to speed up texture accesses 73 float3 sample_position = tex2Dlod(positions, float4(texcoord, 0, SSAO_MIPMAP_LEVEL)).xyz; 74 //float3 sample_position = tex2D(positions, texcoord).xyz; 75 float eyeSpaceDepth = tex2Dlod(colors, float4(texcoord, 0, SSAO_MIPMAP_LEVEL)).w; 76 77 float3 sample_position = eyePos - viewDir * eyeSpaceDepth; 78 75 79 76 80 float3 vector_to_sample = sample_position - centerPosition.xyz; … … 112 116 const uniform float4x4 oldModelViewProj, 113 117 uniform float maxDepth, 114 uniform float temporalCoherence 118 uniform float temporalCoherence, 119 uniform float3 eyePos 115 120 ) 116 121 { … … 129 134 const float currentDepth = centerPosition.w; 130 135 131 const float2 ao = ssao(IN, positions, noiseTexture, samples, normal, centerPosition, w);//, viewDir); 136 /// the current view direction 137 float3 viewDir = normalize(IN.view); 138 139 const float2 ao = ssao(IN, colors, noiseTexture, samples, normal, centerPosition, w, viewDir, eyePos); 132 140 133 141
Note: See TracChangeset
for help on using the changeset viewer.