Hi, Robert Osfield wrote: > Hi Guy and J.P, > > Still struggling to keep up, partly cause I'm a bit cold on the > subject, and partly because I've gone done with a rather pesky cold... > > On Wed, Apr 2, 2008 at 10:47 AM, J.P. Delport <[EMAIL PROTECTED]> wrote: >> Selecting glDrawBuffer/s according to the attachment map does make >> sense; however, Like Guy, I'm not sure if multiple attachments would >> always imply the intention to use MRT and for this reason I added the >> explicit setDrawBuffers call. The explicit call also lessens the risk >> for code breakage of current uses of the attachment map. > > The BufferComponent's in the AttachmentMap area meant to be reasonable > unambiguous, COLOR_BUFFER1 upwards all require MRT to be implemented, > they can't be implement in any other way, so I don't think > implementing the backend to use MRT automatically would be > inappropriate or break previous code. > > enum BufferComponent > { > DEPTH_BUFFER, > STENCIL_BUFFER, > COLOR_BUFFER, > COLOR_BUFFER0 = COLOR_BUFFER, > COLOR_BUFFER1 = COLOR_BUFFER+1, > COLOR_BUFFER2 = COLOR_BUFFER+2, > COLOR_BUFFER3 = COLOR_BUFFER+3, > COLOR_BUFFER4 = COLOR_BUFFER+4, > COLOR_BUFFER5 = COLOR_BUFFER+5, > COLOR_BUFFER6 = COLOR_BUFFER+6, > COLOR_BUFFER7 = COLOR_BUFFER+7 > }; > >> 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. If we ban or don't expect this type of use, then enabling MRT when COLOR_BUFFER1 upwards are enabled should be fine. jp > > Robert. > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support. _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org