[osg-users] Help: how to getmore than four elements via fragment shader?

2012-01-29 Thread wang shuiying
Hello, I want to record more than four elements by writing to out variable in fragment shader. I notice that FBO can connect to many buffers, so I define two images which are respectively attached to a color buffer and a depth buffer. osg source code are as follows: osg::Image

Re: [osg-users] Help: how to getmore than four elements via fragment shader?

2012-01-29 Thread Sergey Polischuk
Hi try this image for depth - imageDepth-allocateImage((int)subXRes, (int)subYRes, 1, GL_DEPTH_COMPONENT32, GL_UNSIGNED_INT); Also you can use multiple render targets to output up to 4 color textures(rgba), you need to attach buffers to osg::Camera::COLOR_BUFFER0 (1,2 etc) and output