"Oh right, you use a translucent material which sets its opacity based on the comparison of the depth of the destination buffer and the pixel buffer.
If the difference between the depths is larger than a set amount, you set the opacity to 1 otherwise 0.
Set an overlay mesh on top the mesh you want occluded like this, and set it to render in the Foreground channel.
And that's it really. Took a lot of experimentation to get that all working.
The other way to do it, which is cheaper possibly is to use the stencil buffer, but you need access to the source code to do that :P
It has issues that I need to still work out. Because, you can't test where that pixel came from.
So sometimes if the objects go too far away, the depth differences become too small and the occlusion goes away.
The way I'm going to fix it for my project is to make the walls thicker."
-SolidSnake

No comments:
Post a Comment