Quote:Original post by orenk
Quote:Original post by agi_shi
I can't see any obvious errors, but:
1) why does finalColor += 1.0 / (1.0f + (occlusion * occlusion) * 0.1); have that multiply by 0.1? What if you remove it?
2) for the depth shader, what happens if you interpolate the view-space position to the pixel shader and then take the length there? I believe that's why you can actually "see" the triangle edges
3) what does g_fDistanceScale look like?
hi 'agi_shi' thanks for replaying
i read your thread with geoff wilson on gamedev, i hope you could help me as much as you help him :)
I'll try [smile]
Quote:
i also saw your 'disorder engine' pics, the ssao look very good, how did you do it?
I released my SSAO as a complete demo over at Ogre3D's forums:
here. Feel free to inspect and dissect the source [grin]. The ssao shader itself is found in /data/ssao.cg - the code is infact very, very similar to your's, and that is why I cannot spot any obvious errors.
Quote:
1. the 0.1 is a scale factor on the depth diff, this allows me to control how it will influence the result.
if i remove it the scene will be brighter.
I believe you should remove it and only play with the distance scale.
Quote:
2. i tried that but it did not give me better results
Alright, just checking, because I usually encounter odd depth discontinuities by interpolate the depth instead of the view-space vector.
Quote:
3. fDistanceScale is scale factor like in (1), allows me to control it from the app, basically i can remove the 0.1 from finalColor += ... and set fDistanceScale = 0.1 you are right - this will save me a mul :)
What units are you using? 1 unit = 1 meter, or 1 unit = 1 inch, or..? My scene uses meters, and my distance scale is ~50 units.
Like I said, though, I can't really spot any obvious errors in there that would just "pop out", you know what I mean? And thus, something that would help us make sure that the data you're feeding your SSAO is correct:
1) a screen shot of se - just output se.xyzz to the final colour for debugging
2) a screen shot of In.vViewDirToFrustumCorner - same way as above
3) a screen shot of normal - again, same way
Anyways, good luck!