Changeset 2813 for GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders
- Timestamp:
- 07/04/08 00:51:25 (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
r2812 r2813 67 67 68 68 //const float areaSize = 4.0f; 69 const float areaSize = 4e-3f; 70 const float sampleIntensity = 0.1f; 69 const float areaSize = 5e-1f; 70 //const float areaSize = 1e-4f; 71 const float sampleIntensity = 0.2f; 71 72 72 73 for (int i = 0; i < SAMPLES; i ++) { … … 76 77 float3 noise = tex2D(noiseTexture, IN.texCoord.xy).xyz * 2.0f - 1.0f; 77 78 78 //float2 offsetTransformed = offset;79 float2 offsetTransformed;80 offsetTransformed.x = noise.r*offset.x - noise.g*offset.y;81 offsetTransformed.y = noise.g*offset.x + noise.r*offset.y;79 float2 offsetTransformed = offset; 80 //float2 offsetTransformed; 81 //offsetTransformed.x = noise.r*offset.x - noise.g*offset.y; 82 //offsetTransformed.y = noise.g*offset.x + noise.r*offset.y; 82 83 83 float2 texcoord = IN.texCoord.xy + offsetTransformed * areaSize;// * (1.0f - centerPositionW.w); 84 // weight with projected coordinate to reach similar kernel size for near and far 85 float2 texcoord = IN.texCoord.xy + offsetTransformed * areaSize * centerPositionW.w; 84 86 85 87 float3 sample_position = tex2D(positions, texcoord).xyz; 86 88 87 89 float3 vector_to_sample = sample_position - centerPosition; 88 // vector_to_sample.z = -vector_to_sample.z;89 90 float length_to_sample = length(vector_to_sample); 90 91 float3 direction_to_sample = vector_to_sample / (length_to_sample + 1e-9f); … … 95 96 96 97 // distance between current position and sample position controls AO intensity. 97 const float maxdist = 5e-1f;98 const float maxdist = 1e-1f; 98 99 //const float scale = 50.0f; 99 100 … … 116 117 { 117 118 pixel OUT; 118 //float4 lightDir = float4(1.0f, 1.0f, 1.0f, 0.0f);119 float4 lightDir = float4(0.0f, 1.0f, 0.0f, 0.0f);119 float4 lightDir = float4(1.0f, 1.0f, 1.0f, 0.0f); 120 //float4 lightDir = float4(0.0f, 1.0f, 0.0f, 0.0f); 120 121 121 122 float4 color = tex2D(colors, IN.texCoord.xy); … … 126 127 float4 position = tex2D(positions, IN.texCoord.xy); 127 128 128 float4 ambient = float4(0. 1f);129 float4 ambient = float4(0.3f); 129 130 130 131 // float3 L = normalize(lightPosition - position); … … 135 136 136 137 float ao = ssao(IN, positions, normals, ProjTrafo, noiseTexture); 137 OUT.color = ao; //(ambient + diffuse) * color; 138 //OUT.color = (ambient + diffuse) * color; 138 OUT.color = ao; 139 //OUT.color = ao * (ambient + diffuse) * color; 140 141 //float4 currentPos = tex2D(normals, IN.texCoord.xy) * 0.5f + 0.5f; 142 //float4 currentPos = tex2D(positions, IN.texCoord.xy); 143 //OUT.color = currentPos.w; 139 144 140 //float4 currentPos = tex2D(positions, IN.texCoord.xy); 141 //OUT.color = currentPos; 142 //float4 currentPos = tex2D(normals, IN.texCoord.xy) * 0.5f + 0.5f; 143 //OUT.color = currentPos; 144 145 145 146 return OUT; 146 147 } -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/mrt.cg
r2811 r2813 26 26 float4 texCoord: TEXCOORD0; 27 27 28 float4 dummy: WPOS;28 float4 projPos: WPOS; 29 29 float4 color: COLOR0; 30 30 float4 worldPos: TEXCOORD1; // world position … … 66 66 pix.col = tex2D(tex, IN.texCoord.xy); 67 67 pix.pos = IN.worldPos * maxDepth; 68 pix.pos.w = IN.projPos.w; 68 69 pix.norm = IN.normal; 69 70
Note: See TracChangeset
for help on using the changeset viewer.