POV-Ray : Newsgroups : povray.binaries.images : brain_attack.jpg : Re: brain_attack.jpg Server Time
2 Jun 2024 16:26:12 EDT (-0400)
  Re: brain_attack.jpg  
From: Bald Eagle
Date: 9 Aug 2023 15:05:00
Message: <web.64d3e297a73d0cdf1f9dae3025979125@news.povray.org>
> "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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.