Original Post
Anyone know how this works? I see how a Sobel filter works for edge detection but I'm not so clear on how to generate normals with it.
normal.x = sobel_u( pos );normal.y = scale;normal.z = sobel_v( pos );normalize( normal ) 1 0 -1 3 0 -3 1 0 -1 1 3 1 0 0 0-1 -3 -1Quote:
Original post by Scythen
Anyone know how this works?
I see how a Sobel filter works for edge detection but I'm not so clear on how to generate normals with it.
Quote:
Original post by haegarr
Sobel operator are a kind of 2D filter kernel. So its mathematics is that of 2D discrete convolution
r(x,y) := ∑i,j p(x-i,y-j) * k(i,j)
(if I recall right; please verify it before use) what means that the kernel k is layed over the original image p at the location (x,y), so that one kernel element covers one pixel. Then the "pixelwise" sum over i,j defines the result r at the location (x,y).
In general the one Sobel operator lets remain horizonzal edges, while the other lets remain vertical edges, both in form of (signed) bitmaps. The amplitude of the resulting "pixels" depend in some way on the sharpness of the edges. Looking at both values together one could understand that at a normal w.r.t. to the standard normal straight high.
This topic has been locked by a moderator. New replies are not allowed.
With your permission, GameDev.net uses analytics cookies to understand how people use the platform. You can accept analytics or continue with necessary cookies only. Learn more