shapedrawer icon indicating copy to clipboard operation
shapedrawer copied to clipboard

A way to make gradients smoother

Open Klemms opened this issue 2 years ago • 1 comments

Hi,

This is more an help request post than a real issue, but I was wondering if there was any way to make gradients smoother ? Maybe there is a way and I didn't find it ^^

This is the example of a gradient and as you can see, the different colors are very visible. image

Klemms avatar Jan 07 '23 02:01 Klemms

You can apply dithering. I used ShapeRenderer but it's probably much the same process for shapedrawer. This is from an abandoned project and I don't remember if the end result looked any good.

ShaderProgram shader = new ShaderProgram(Gdx.files.internal("dither.vert"), Gdx.files.internal("dither.frag"));
Texture bayer16 = new Texture(Gdx.files.internal("blueTri64_0.png"), Pixmap.Format.RGBA8888, false);
bayer16.setWrap(Texture.TextureWrap.Repeat, Texture.TextureWrap.Repeat);

Download shader/texture files

Frosty-J avatar Jul 23 '23 16:07 Frosty-J