PDA

View Full Version : Image Outline



Tomsi
09-26-2011, 04:44 AM
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?

http://www.blodyavenger.com/imageoutline.png

I'm using SOIL library to load textures.

aqnuep
09-26-2011, 05:05 AM
Why don't you put the outline into the asset itself?

Tomsi
09-26-2011, 05:42 AM
I can do that, I was just wondering if there's a way to do this dynamically with opengl.

Thanks

ZbuffeR
09-27-2011, 02:36 AM
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.