Changeset 3352
- Timestamp:
- 04/14/09 11:59:23 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp
r3350 r3352 563 563 ////////////// 564 564 565 string deferredParams[] = {"colors", "normals", "lightDir", "aoTex" };566 sCgDeferredProgram->AddParameters(deferredParams, 0, 4);565 string deferredParams[] = {"colors", "normals", "lightDir", "aoTex", "useAO"}; 566 sCgDeferredProgram->AddParameters(deferredParams, 0, 5); 567 567 568 568 /////////////////// … … 859 859 } 860 860 861 862 861 //if (mSortSamples) { SortSamples(); } 863 862 //sCgSsaoProgram->SetArray2f(i, (float *)samples2, NUM_SAMPLES); … … 972 971 const Vector3 lightDir = -light->GetDirection(); 973 972 974 sCgDeferredProgram->SetTexture(0, colorsTex); 975 sCgDeferredProgram->SetTexture(1, normalsTex); 976 sCgDeferredProgram->SetValue3f(2, lightDir.x, lightDir.y, lightDir.z); 977 sCgDeferredProgram->SetTexture(3, aoTex); 973 int i = 0; 974 sCgDeferredProgram->SetTexture(i ++, colorsTex); 975 sCgDeferredProgram->SetTexture(i ++, normalsTex); 976 sCgDeferredProgram->SetValue3f(i ++, lightDir.x, lightDir.y, lightDir.z); 977 sCgDeferredProgram->SetTexture(i ++, aoTex); 978 sCgDeferredProgram->SetValue1f(i ++, float(mShadingMethod == SSAO)); 978 979 979 980 DrawQuad(sCgDeferredProgram); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg
r3351 r3352 25 25 uniform float3 normal, 26 26 float3 lightDir, 27 float4 ao) 27 float4 ao, 28 float useAO) 28 29 { 29 30 // diffuse intensity … … 45 46 else 46 47 { 47 outColor = (ambient * ao + diffuse) * color; 48 //outColor = ambient + diffuse * color; 48 if (useAO > 0.5f) 49 outColor = (ambient * ao + diffuse) * color; 50 else 51 outColor = (ambient + diffuse) * color; 49 52 } 50 53 … … 60 63 uniform sampler2D normals, 61 64 uniform float3 lightDir, 62 uniform sampler2D aoTex 65 uniform sampler2D aoTex, 66 uniform float useAO 63 67 ) 64 68 { … … 70 74 71 75 float3 normal = normalize(norm.xyz); 72 float4 col = shade(IN, color, normal, lightDir, ao );76 float4 col = shade(IN, color, normal, lightDir, ao, useAO); 73 77 74 78 OUT.color = col;
Note: See TracChangeset
for help on using the changeset viewer.