simongeilfus / Cinder

Cinder is a community-developed, free and open source library for professional-quality creative coding in C++.
http://libcinder.org
Other
4 stars 1 forks source link

TexturesAndFbos: Changes and Notes #2

Open simongeilfus opened 8 years ago

simongeilfus commented 8 years ago

https://github.com/simongeilfus/Cinder/tree/TexturesAndFbos

Changes / Additions

gl/Texture
Function Target Desktop ES Cinder Proposed Feature Name
glTexImage2DMultisample GL_TEXTURE_2D_MULTISAMPLE GL3.2 CINDER_GL_HAS_TEXTURE_MULTISAMPLE
glTexImage3DMultisample GL_TEXTURE_2D_MULTISAMPLE_ARRAY GL3.2 CINDER_GL_HAS_TEXTURE_MULTISAMPLE
glTexStorage2DMultisample GL_TEXTURE_2D_MULTISAMPLE GL4.3 ES3.1 CINDER_GL_HAS_TEXTURE_2D_STORAGE_MULTISAMPLE
glTexStorage3DMultisample GL_TEXTURE_2D_MULTISAMPLE_ARRAY GL4.3 CINDER_GL_HAS_TEXTURE_2D_STORAGE_MULTISAMPLE
thyrrestrup commented 6 years ago

It would be a very welcome update to get at least some of these changes merged into Cinder. Nice work!

totalgee commented 6 years ago

Thanks, it's great Fbo is getting some love. (-;

Not sure this is useful "generally", but for my purposes it would have been useful to have:

BTW, above, when I say "what I needed," I mean: the ability to blit the resolved part of a multisampled Fbo to a different (non-multisampled) Fbo. In my case, I was doing that using an OpenGL extension blit function (glMulticastBlitFramebufferNV()) to transfer it between GPUs.

In my case, I'm not using any extra (color) attachments, so I didn't need to change read/draw buffers for the Fbo blit stuff I was doing (using glDrawBuffers() or glReadBuffer()). However, it might be necessary in some cases, if you had multiple attachments. Is it possible to get/enumerate the attachments (mAttachments* entries) once you've created an Fbo? Doesn't seem to be. (NOTE: This is not important for me in this case, mainly just a curiosity...don't worry about it!)

I'm not sure any of this warrants complicating Fbo -- e.g. for different bind cases for READ vs DRAW -- but just thought I'd add my comments here in case they are useful or spark any thoughts. Thanks!