PDA

View Full Version : I need an Edge Dilation Filter GLSL!!



MKDRag0n
08-10-2009, 10:25 AM
People,

I have a trouble. I have an image, and a shadowmap of this image done. Trough the shadowmap and applying a sobel edge filter i could find the contours of the shadowmap. Now my purpose is to dilate them. Unfortunately i could not find any example of this here except this one made by PocketMoon:

http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=223976

Unfortunately i don't have acess to this file, and i can't seem to find any similar example in the internet! Can anyone help me? Here's my project. What do i have to code/do? http://rapidshare.com/files/265864726/Shadow_Mapping_with_GLSL.zip.html

kowal
08-10-2009, 11:07 AM
I have seen dilation fragment shader in OpenGL Super Bible, I don't remember it, but the idea was simple. Take 9 samples (3x3) (if You already have convolution filters it should be easy), and write maximum of them (brightest) as output.

MKDRag0n
08-11-2009, 03:22 PM
Yes, but my main problem is not about knowing how the shader works, but how to transport the framebuffer into a texture that the shader will receive and modify...in this case my program should have 2 shaders, first the sobel filter one, and second the dilation one. I just don't know how to make the interaction between them, wich means i dont know how the dilation filter can receive the result of the sobel filter to make the dilation. How can i code/pseudo code that in GLSL?