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
Graphics: Set anti-aliasing at RenderTexture #1274
Comments
@eXpl0it3r @LaurentGomila Yea, could you guys look this? |
I'd rather ask @binary1248 his opinion about it. |
See the comment on the forum: https://en.sfml-dev.org/forums/index.php?topic=22147.msg156426#msg156426 |
I'll throw my hat in as someone who's wanted this for a while and would make use of it - I also know of others who would appreciate it. If the answer is still "It's too much effort", then I'm happy to put effort in to work on an implementation |
The TL;DR of my posts is: you don't have to supersample your intermediate surfaces if you make sure that aliasing can't happen when rendering to them. If you supersample both intermediate surfaces and final framebuffer you will end up losing more image quality than if you only did it in the final render pass. This is like video editing: You don't compress your source video and edit the compressed clips into a final output. You work at the native resolution in some raw uncompressed format and only compress right before publishing it. |
I did something like that with the green circle example. I drew the circle on a render-texture without anti-aliasing settings, then did get the render-texture's texture after drawn and drew it on a render-window. No anti-aliasing did happen at the end... In order to enable anti-aliasing samples, someone suggested me to use context-settings on a context, making sure the render-texture is the active context. Though I couldn't compile my test code because the |
I'd also love to have this because my whole game is on a RenderTexture, I draw that to RenderWindow. |
@naezith Are you applying some full screen post-processing or is there another reason that you need to do this? |
@binary1248 Yes, vignette effect shader. |
Try #1285 branch feature/rendertexture_stencil_multisample. |
@binary1248 Your test works nicely. I tried it in my game, it's not good for me. It makes the tiles bleed as you see in this GIF: Also I expected my water shader to look smoother but it does not help on that. Can you explain why? |
@naezith If with "bleed" you mean the seams that appear in between tiles, that is a side-effect of drawing them on individual polygons with multi-sampling enabled. OpenGL is working as intended... if the tiles are supposed to align with each other they need to share vertices among other things so the rasterizer can resolve the samples properly based on the correct data. As for your water shaders... you need to describe a bit more what I am supposed to be seeing... because I don't notice anything out of the ordinary... |
@binary1248 Yeah everything seems to work as it is supposed to work as you said. Just not a good option for me unlike I thought. About water shader, Those bright white lines are normally rectangles drawn first. Then that area is passed to a frag shader. Then water bends and twists the background as you see there. The end result is pixelated, I expected AA to draw them smoother but I guess AA works only for the polygon's edge pixels. |
@naezith Man, that's nice! |
Implemented with #1285 |
It should be possible to control the anti-aliasing like on
RenderWindow
. Smooth changed in nothing.My reason: I simply need to cache a
Drawable
. OnRenderWindow
I'm able to explain the anti-aliasing amount withContextSettings
. Is it possible to draw a Drawable and get a bitmap from it?.The text was updated successfully, but these errors were encountered: