Stack Exchange Network
Stack Exchange network consists of 181 Q&A communities including
Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack Exchange
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It only takes a minute to sign up.
Sign up to join this community
Anybody can ask a question
The best answers are voted up and rise to the top
10 years, 2 months ago
I want to make a shader effect using OpenGL ES 2.0 that looks like this image:
I'm not sure if this image was painted or is the result of some filter, but I want to create a shader that produces images looking similar.
I want to know a Shader algoritm to produce this kind of output!
13.3k 10 10 gold badges 53 53 silver badges 81 81 bronze badges
Jan 15, 2013 at 16:04
Voda Ion Voda Ion
177 1 1 silver badge 6 6 bronze badges
I can't tell if that specific image you linked was painted that way originally or not, but the resulting effect looks
similar to an edge detection filter.
Edge detection post-processing is often done using a
Sobel filter implementation. For example, as seen here (a CPU-side implementation). The effect can be achieved in shaders as well ( here is an HLSL example that is trivially adaptable).
Jan 15, 2013 at 16:13
If you dont mind having little bit more expensive shader (but it has same number of texture fetches as sobel filter), you can implement frei-chen edge detector.
It provides smoother image than sobel filter.
Great article with example implementation:
Feb 2, 2013 at 5:47
6,058 1 1 gold badge 30 30 silver badges 40 40 bronze badges
log in to answer this question.
Not the answer you're looking for? Browse other questions tagged
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our
Accept all cookies
Necessary cookies only