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
sf::RenderTexture stencil and multisampling support #1285
Conversation
d374d67
to
83f614b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My review didn't even work!
@binary1248 I wish SFML was already pre-compiled with these changes. |
See the CI artifact builds |
@eXpl0it3r Thanks. Unfortunately I see nothing. I compiled the PR example, but nothing looks to render. It's all black... I'm using MingW 32.. |
@binary1248 Thanks very much for this. It didn't work here :/. It's entirely black and when I press any key, nothing happens too. |
if (m_multisampleFrameBuffer) | ||
{ | ||
glCheck(GLEXT_glBindFramebuffer(GLEXT_GL_DRAW_FRAMEBUFFER, m_frameBuffer)); | ||
glCheck(GLEXT_glBlitFramebuffer(0, 0, m_width, m_height, 0, 0, m_width, m_height, GL_COLOR_BUFFER_BIT, GL_NEAREST)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't GL_LINEAR give smoother results? Or is the parameter irrelevant, because the textures have the same size?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the odd case the driver is stupid, this is faster and imposes no loss of quality.
Hi there! |
GLint samples = 0; | ||
glGetIntegerv(GLEXT_GL_MAX_SAMPLES, &samples); | ||
|
||
if(settings.antialiasingLevel > samples) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest something like this here: err() << "Impossible to create render texture (unsupported anti-aliasing level, maximum supported samples: " << samples << " )" << std::endl;
It's a good point. For the RenderWindow we just fallback to the minimal setting if the config doesn't match and return the difference on |
I'd rather not spam the console with warnings that can be avoided with the necessary precaution. The problem with RenderWindow and this in its current state is that there is no way to check the maximum AA that is supported. It would be simple to do in both cases, but would necessitate adding static functions to both classes. |
Well I don't know I wouldn't consider it spam, since it informs the user why the creation of the RenderTexture failed. Also pretty much every other error case in |
So you don't want to add any message @binary1248? Can you rebase it as well? |
1596508
to
f4edff2
Compare
Updated. |
…to sf::RenderTexture.
f4edff2
to
421e8bb
Compare
SFML Tasks
Added support for creation of a stencil attachment and multisampling to sf::RenderTexture. (#1274)
Test with this: