The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates. | Twitter

+3 votes

Hi. I've been working on a game (2D) that uses a handful of canvasitem shaders, and I realized that they all look jagged, especially when looking at text. I've looked in a few places for solutions to this, but couldn't find anything. I was wondering if I could do some sort of supersampling, so shaders have more than 1 pixel to draw from and end up with a less binary, more smoothed out result.

Attached should be a screenshot of the game.
Thank you in advance.
screenshot. note the character's eyes and the curves on the text

Godot version 3.3.2
in Engine by (31 points)

1 Answer

+1 vote

The 3D Viewport Scaling demo showcases how to do supersampling. Despite only being shown for 3D, the technique works in both 3D and 2D.

That said, global supersampling is expensive at high resolutions, so performing selective supersampling in the shader may be a better way to solve this particular problem.

by (12,878 points)

Thank you for taking the time to respond. I tried using the first solution because it looked very intuitive, and I am extremely new to shaders (all I did so far was take shaders from YouTube tutorials and reconnect wires until the game looks like what I want). but for some reason it didn't seem to do anything but zoom in and out. I then tried to read the article but I had no idea on how to apply anything that I read.

I was expecting there to be a simple setting on the engine that I could change, given that there's "Shrink" on the project settings, which seems to do literally the exact opposite of what I want to do. I tried changing that in code, since the engine doesn't let me go to negative numbers in the UI, but it looks like that can't be changed once the game is running.

I guess I'll just have to export the final game like this. maybe in a future project I'll know what I'm doing. Or not.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.