Changeset 2815 for GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders
- Timestamp:
- 07/04/08 03:38:22 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg
r2814 r2815 70 70 // the normal on the current position 71 71 float3 centerNormal = tex2D(normals, IN.texCoord.xy).xyz; 72 normalize(centerNormal);72 //normalize(centerNormal); 73 73 74 74 // Check in a circular area around the current position. … … 81 81 const float areaSize = 5e-1f; 82 82 //const float areaSize = 1e-4f; 83 const float sampleIntensity = 0. 2f;83 const float sampleIntensity = 0.1f; 84 84 85 85 for (int i = 0; i < SAMPLES; i ++) { … … 130 130 { 131 131 pixel OUT; 132 float4 lightDir = float4(1.0f, 1.0f, 1.0f, 0.0f); 133 //float4 lightDir = float4(0.0f, 1.0f, 0.0f, 0.0f); 132 133 float4 lightDir = float4(0.8f, 1.0f, 1.5f, 0.0f); 134 float4 lightDir2 = float4(-0.5f, 0.5f, 0.4f, 0.0f); 134 135 135 136 float4 color = tex2D(colors, IN.texCoord.xy); 136 137 float3 normal = tex2D(normals, IN.texCoord.xy).xyz; 138 137 139 // expand normal 138 140 normal = normal * 2.0f - 1.0f; … … 144 146 // float3 L = normalize(lightPosition - position); 145 147 float3 light = normalize(lightDir.xyz); 148 float3 light2 = normalize(lightDir.xyz); 146 149 147 150 float diffuseLight = max(dot(normal, light), 0.0f); 148 float diffuse = diffuseLight; 151 float diffuseLight2 = max(dot(normal, light2), 0.0f); 152 153 float diffuse = diffuseLight + diffuseLight2; 149 154 150 155 float ao = ssao(IN, positions, normals, ProjTrafo, noiseTexture); 151 OUT.color = ao;152 //OUT.color = ao * (ambient + diffuse) * color;156 //OUT.color = ao; 157 OUT.color = ao * (ambient + diffuse) * color; 153 158 154 159 //float4 currentPos = tex2D(normals, IN.texCoord.xy) * 0.5f + 0.5f;
Note: See TracChangeset
for help on using the changeset viewer.