Friday, September 15, 2017

opengl es2 - How can I make a shader effect that looks like a lightly shaded pencil drawing?


I want to make a shader effect using OpenGL ES 2.0 that looks like this image:


lightly shaded pencil drawing


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!




Answer



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).


No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...