mastodon.gamedev.place is one of the many independent Mastodon servers you can use to participate in the fediverse.
Mastodon server focused on game development and related topics.

Server stats:

5.3K
active users

Nikita Lisitsa

Btw, folks, there's this thing when you render transparent textures with mipmapping and they appear to have black outlines due to RGB mixing with black transparent pixels. I know people flood-fill the transparent areas with neighbouring non-transparent color or smth like that, how is this operation called? How do I do it in e.g. GIMP?

@lisyarus Repeatedly dilating and bluring the image on a secondary layer until the transparent space is fully covered (Not a GIMP expert but both operations should be supported) However there is a better approach described by Sean Feeley here youtu.be/MKX45_riWQA?t=2959

@lisyarus not sure if gimp can save pngs with an alpha channel, but how we used to do this back in the day was to move the transparency to an alpha channel and fill the background of rgb with a green that matches the leaves

@lisyarus I'm familiar with this operation being called "dilation". I use the xNormal Photoshop plugin to do it: xnormal.net/

After installing the software the plugin(s) can be found in the "photoshop_plugins" directory. Here's an example result of this operation.

@lisyarus Edge padding or solidify is another name for this operation: wiki.polycount.com/wiki/Edge_p

Flaming Pear's Solidify B Photoshop plugin also produces quite usable results: flamingpear.com/freebies.html

@lisyarus dilation is the common term. You can actually do it easily with a shader as part of your import pipeline, using a simple brute force search for each transparent pixel. Or you can get fancy and generate a distance field with jump flooding, and use the closest pixel as the colour. I do this for runtime generated imposter textures where I need to generate the distance field anyway for imposter reasons.

@lisyarus I've started implementing a FOSS dilation algorithm in Python because it kind of sucks to have this functionality locked into Photoshop. It's odd that even the xNormal program doesn't include it. My algorithm is currently faster and produces higher quality results than the plugin(s) but the script is far from done and has the obvious caveat of the dilation operation not being a convenient menu option in a graphics editor. Thanks for the inspiration.