Joined: 19 Apr 2017
|Posted: Wed Jul 19, 2017 9:44 am Post subject:
Multi layer effect rendering problem on depthbuffer
I have implemented the intersection effect between a block mesh and a geometry (kind of like capping effect)by multi-pass render as used in other osgFx::effect.
Now I have lots of blocks with different depth, I add each block and the same geometry into an effect node, as shown below:
--block mesh1 + geomBox
--blcok mesh2 + geomBox
--block mesh18 + geomBox
all effect nodes could be individual rendered in right way, but the depth of different nodes are totally messed.
Regardless of their actual depth values, the subsequent nodes always overwrite the previous nodes.
I think it is because I forced to write the block depth into the depth buffer during the effect process.
So I want to know how can I render each effect into different depth buffer but combine those depth buffer at rootnode to decide the color buffer?