#Generating filter or mipmaps for a shader generated image?

2 messages · Page 1 of 1 (latest)

stoic citrus
#

I have a shader for generating a healthbar with segments. The main issue atm is that the shader is shown without any form of filtering, making it very sharp and uneven when zoomed out. Does anyone have any idea how I would go about fixing this?

Those two healthbars in the picture should look identical, yet they look very different.

main sequoia
#

the approaches I know of:

  • implement important stuff in terms of a texture lookup, which will do filtering for you (in this case, literally make a Square With A Border texture, then use your shader to repeat it and tint it as appropriate)
  • do your filtering/antialiasing in the shader itself by hand
  • use the shader to render to a texture at a fixed size without aliasing issues, then render that texture into your scene

I strongly recommend the first one, it tends to be the easiest and the most artist-friendly