|
|
> "Mike Miller" <mil### [at] gmailcom> wrote:
> > Not sure how to get the edge and cel-shade look directly from POV.
So, I found a simple shader that does exactly what I suspected we needed to do -
discretize the color values.
https://www.shadertoy.com/view/XltGR7
float lighting = diffuse + specular;
float toonMap;
//map lighting information to discrete values
if (lighting < 0.256) {
toonMap = 0.195;
} else if (lighting < 0.781) {
toonMap = 0.781;
} else {
toonMap = 0.900;
}
Now, I'm not sure if there's a way to accomplish that through the under-the-hood
raytracer, but the docs provide SDL code to write your own raytracer, and then I
suppose the lighting could be "toon-mapped" to get the desired effect.
W F Pokorny used to have some info on his wiki user page describing making a
stepped function from a smooth function - which I've recently played with while
exploring some noise functions.
Now, since specular is basically AOI, we might be able to to just use the aoi
pattern with an appropriate color map to achieve a decent result.
- BW
Post a reply to this message
|
|