Hi Kai,

I checked RenderStage::runCameraSetUp() source code, and found that
bufferAttachments only have Texture1D, Texture2D, Texture3D,
TextureCubeMap, TextureRetangle, but without TextureArray, and I don`t
know weather OSG using glFramebufferTextureLayer or glFramebufferTexture
when bind TextureArray, cubeMap and Texture3D, if using
glFramebufferTexture, no layer rendering is available. I will try
Texture3D for layer rendering.

BTW,
shadowCamera->attach(osg::Camera::COLOR_BUFFER0, ta, 0, 0);
shadowCamera->attach(osg::Camera::COLOR_BUFFER1, ta, 0, 1);
shadowCamera->attach(osg::Camera::COLOR_BUFFER2, ta, 0, 2);
does not take effects, each color_buffer only accept the rastered
fragments of primitive in first layer, the other 2 in geometry shader does
not shown.

That seems to prove what I was afraid of. Using layered rendering ( glFramebufferTexture() with complex texture and GLSL gl_Layer variable ) is bit differently processed in OpenGL than multiple render targets.

You could probably emulate gl_Layer with custom extra vertex attribute/varying to store layer. Set the value in geometry shader and pass along to vertex & fragment shaders for selection of target draw buffer. But I would rather try to modify OSG to do layered rendering in recommended way. This way you could post your work and others could benefit as well...

Cheers,
Wojtek

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to