[osg-users] Multi layer effect rendering problem on depthbuffer

neman meng neman.meng at gmail.com
Wed Jul 19 02:44:18 PDT 2017

hi all,

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:

	--effect node1 
		--block mesh1 + geomBox
	--effect node2
		--blcok mesh2 + geomBox
	--effct node18
		--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? 

Thank you!


Read this topic online here:

More information about the osg-users mailing list