Image Outline

Hello everyone.

I was wondering if there is a way to create let’s say 1px outline around a transparent (PNG) texture that is mapped on opengl quad. I’m using 32-bit png images. Is it possible without using shaders?

I’m using SOIL library to load textures.

Why don’t you put the outline into the asset itself?

I can do that, I was just wondering if there’s a way to do this dynamically with opengl.

Thanks

It is possible, the idea is to render the sprite with a GLSL fragment shader doing something resembling a blur filter, then store the result in a texture.

Without shaders, it can be done for example by doing jittered passes to fill a stencil buffer, then render red quad to pass only on some values of stencil.

Search the web for these keywords, then ask for details if needed.