Skip to content
Menu
Mob City
  • Home
  • Contact
  • About
Mob City

Drawing opaque and semi-transparent pixels in the shader

Posted on November 30, 2024

I was making a selection marker decal and to make it appear smoothly, I noticed a broader issue when rendering alpha-0 and alpha non-0 pixels in the shader.

I had to adjust my frag shader to draw opaque pixels in a separate pipeline from semi-transparent pixels:

Later, I encountered a smaller issue of y-sorting it correctly with respect to the environment (buildings, pavement) and the pawn.

After fixing both issues, the final version looked smoothed enough:

  • decal
  • shader

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • Rendering 120k+ entities
  • Modular building graphics
  • Lit up mode in night time
  • Night mode (tinting with shaders)
  • Traffic system and cars
©2025 Mob City