Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to clear color buffers other than 0 #398

Open
j-o opened this issue Aug 21, 2017 · 1 comment
Open

Unable to clear color buffers other than 0 #398

j-o opened this issue Aug 21, 2017 · 1 comment
Labels

Comments

@j-o
Copy link
Contributor

j-o commented Aug 21, 2017

ClearStage uses RenderInterface::obtainFBO(size_t index, AbstractRenderTarget * renderTarget) to get an FBO for a specific attachment. This overload does not set draw buffers and neither does the clear stage. This works for color buffer 0, as the default value for the draw buffers array is [GL_COLOR_ATTACHMENT0, GL_NONE, GL_NONE, ...] (see https://computergraphics.stackexchange.com/a/3937), but fails for any additional color buffer.

Who should be responsible for seting the draw buffers?

@Tobias1595
Copy link

About the responsibility for setting the draw buffers: RenderInterface::obtainFBO(size_t index, AbstractRenderTarget * renderTarget) returns the FBO held internally by the RenderInterface (or the default FBO). Therefore each Stage that uses this method has its own FBO with its own draw buffer configuration. Consequently each Stage has to specify which buffers to draw to if the default mentioned above is insufficient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants