Jump to content
  • Advertisement
Sign in to follow this  
vinnyvicious

2D Dithering/Palletization shaders

Recommended Posts

I'm quite a noob when it comes to pixel manipulation shaders, so you will probably understand my fascination with this tool, even though it will look simple for most of you: https://kronbits.itch.io/pixatool

I've been trying to create something similar inside Urho3D for the purpose of giving a retro-look to my particles, but I had no luck with the palletization. Does anyone have any sample shaders that change a texture to match a palette? Is it easier to do on a per-texture basis, or doing a full-screen shader?

Share this post


Link to post
Share on other sites
Advertisement

I was looking at FTE's GLSL renderer for ideas:

https://github.com/mdeguzis/ftequake/blob/a83b8ca825255c343780ffc4fe99d96e9e9bce0c/engine/shaders/glsl/defaultwall.glsl#L97

They emulate Q1 software pretty well. But it's not clear to me how the ramp actually works. Do I have to average each pixel and see which one is closer to the colors available in my palette? Isn't that terribly slow?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!