Hi J.P, > >> I'm sure you will see that there is no magic to my current > >> implementation. The difficult part is to figure out when to enable it. > > > > Can we not just do it when COLOR_BUFFER1 upwards are enabled? > > Problem is that enabling MRT with just COLOR_BUFFER0 and then using > glFragData[0] in a shader is also a valid use of glDrawBuffers. I know > this is a special case (MRT with one buffer), but it's useful when e.g. > automatically generating code.
OK. I see the issue now. > If we ban or don't expect this type of use, then enabling MRT when > COLOR_BUFFER1 upwards are enabled should be fine. Rather than ban this type of usage perhaps we could come up with another scheme. Would making COLOR_BUFFER0 be separate from COLOR_BUFFER be a way around this, i.e. if the use wants MRT then they COLOR_BUFFER0+i, if they just want standard then just use COLOR_BUFFER. The other possibility would be to explictly enable MRT support via an option in osg::Camera. My concern about having both Camera::setDrawBuffers and the BufferComponent attachments is that its more code and open for people making mistakes in the implementation i.e. they two are set without being properly matched. Robert. _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org