POV-Ray : Newsgroups : povray.binaries.images : brain_attack.jpg Server Time
23 Dec 2024 22:44:24 EST (-0500)
  brain_attack.jpg (Message 12 to 21 of 21)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Samuel B 
Subject: Re: brain_attack.jpg
Date: 8 Aug 2023 19:35:00
Message: <web.64d2d099a73d0cdff8c47d526e741498@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "Samuel B." <stb### [at] hotmailcom> wrote:
>
> > One idea for the outlines is to build a new object out of several copies, like
> > so (I attached an image of the result):
>
> OK, now that is about the coolest damned thing I've seen in a while.
> Really clever.

Thanks, Bald Eagle. (Btw, the hardest part - the Fermat spiral algorithm - isn't
mine. I think I found it on Stack Exchange or something.)

> The lighting needs to be right, and I'll bet there's all sorts of interesting
> things that can be accomplished with the proper combination of texture and
> interior_texture.

Not sure how the lighting needs to be right, since the effect focuses only on
the outline...

I was hoping to get a cel-shaded look by adjusting the transmission and maybe
filtering, but it didn't pan out. One might need to make a color_mapped slope
pattern based on light sources instead, but it wouldn't take into account
radiosity and reflections, unfortunately.

> Also, you never use Seed.  Was there a plan to use that somewhere, or is it just
> an unused line of code?
>
> - BW

Haha, no plans for it. It was a vestige from another piece of code, and I just
sort of forgot it was there  '._ .

Sam


Post a reply to this message

From: Bald Eagle
Subject: Re: brain_attack.jpg
Date: 8 Aug 2023 20:55:00
Message: <web.64d2e2bfa73d0cdf1f9dae3025979125@news.povray.org>
"Samuel B." <stb### [at] hotmailcom> wrote:

> Not sure how the lighting needs to be right, since the effect focuses only on
> the outline...

I had a bad light_source / camera combo, and it looked bad. (at 90 deg to each
other)
The light_source in line with the camera_location to look_at vector works very
nicely.

Using a large sphere with emission 1 gave me a jet black object with no outline.

I'll have to experiment with other light sources like zebra / dot lighting for
visualizing curvature, or maybe multiple point lights.


onion scale 0.1 gives a nice dotted / psychedelic / vibrating effect with an rgb
0 rgbt 1 color map.  I haven't puzzled out the boxed pattern yet.

interior_texture {pigment {onion color_map {[0.0 rgb 0][0.5 rgb 0][0.5 rgbt
1][1.0 rgbt 1]}} scale 0.05}


- BW


Post a reply to this message

From: Mike Miller
Subject: Re: brain_attack.jpg
Date: 9 Aug 2023 00:05:00
Message: <web.64d30feaa73d0cdfc9deb24ddabc9342@news.povray.org>
"Samuel B." <stb### [at] hotmailcom> wrote:
> "Mike Miller" <mil### [at] gmailcom> wrote:
> > "Bald Eagle" <cre### [at] netscapenet> wrote:
> > > "Mike Miller" <mil### [at] gmailcom> wrote:
> > > > Brain Attack pulp style cover using brain bots, pipes and tanks. [...]
> > >
> > > Pretty cool PS post-render effects.
> > >
> > > I'm wondering what can be done in that respect directly in POV-Ray, [...]
> >
> > Not sure how to get the edge and cel-shade look directly from POV.
>
> One idea for the outlines is to build a new object out of several copies, like
> so (I attached an image of the result):
>
> #declare Obj =
>  union{
>   #local W = .3;
>   #local Obj_ =
>    merge{
>     cylinder{-x, x, W}
>     sphere{-x, W}
>     sphere{x, W}
>    }
>   object{Obj_}
>   object{Obj_ rotate y*90}
>   object{Obj_ rotate z*90}
>  }
>
> // object without outlines
> object{
>  Obj
>  pigment{rgb .7}
> }
>
> // outlines
> merge{
>  // change these two things
>  #local NPts = 8;
>  #local LineThickness = 0.03;
>
>  // golden spiral points on sphere
>  #local Inc = pi * (3 - sqrt(5));
>  #local Off = 2 / NPts;
>  #local Seed = seed(1001);
>  #for(K, 0, NPts-1)
>   #local Y = K * Off - 1 + (Off / 2);
>   #local R = sqrt(1 - Y*Y);
>   #local Phi = K * Inc;
>   object{
>    Obj
>    translate LineThickness*<cos(Phi)*R, Y, sin(Phi)*R>
>   }
>  #end
>  texture{pigment{rgbt 1}}
>  interior_texture{pigment{rgb 0}}
>  interior{ior 1.0001}
>  no_shadow
>  no_reflection
> }
>
> ^That technique requires some things to be merged.
>
> Another idea is to keep using whatever post-process effect you have been using
> up til now, but feed it a simpler image without reflections, shadows, etc. Maybe
> give it an image rendered with +q0 or something. The problem with that, however,
> is some areas will not have lines because the adjacent colors will be the same.
> The only fix I know for that is to give different areas slightly different
> colors, so that the line algorithm has something to work with. (I hope that
> makes sense ;P)
>
> > Attached is styled with posterized shadows with a 1/2 tone process dot per Sam's
> > suggestion - thanks Sam. I'm liking the comic book feel. I also removed the
> > reflection pass to reduce the busyness, especially in the pipes. Will continue
> > to play with this.
> > Mike.
>
> It's looking good!
>
> Sam

Thanks for all the great ideas. Gives me some more things to explore.
Mike


Post a reply to this message

From: Alain Martel
Subject: Re: brain_attack.jpg
Date: 9 Aug 2023 10:23:13
Message: <64d3a151$1@news.povray.org>
Le 2023-08-08 à 17:28, Samuel B. a écrit :
> "Mike Miller" <mil### [at] gmailcom> wrote:
>> "Bald Eagle" <cre### [at] netscapenet> wrote:
>>> "Mike Miller" <mil### [at] gmailcom> wrote:
>>>> Brain Attack pulp style cover using brain bots, pipes and tanks. [...]
>>>
>>> Pretty cool PS post-render effects.
>>>
>>> I'm wondering what can be done in that respect directly in POV-Ray, [...]
>>
>> Not sure how to get the edge and cel-shade look directly from POV.
> 
> One idea for the outlines is to build a new object out of several copies, like
> so (I attached an image of the result):
> 
> #declare Obj =
>   union{
>    #local W = .3;
>    #local Obj_ =
>     merge{
>      cylinder{-x, x, W}
>      sphere{-x, W}
>      sphere{x, W}
>     }
>    object{Obj_}
>    object{Obj_ rotate y*90}
>    object{Obj_ rotate z*90}
>   }
> 
> // object without outlines
> object{
>   Obj
>   pigment{rgb .7}
> }
> 
> // outlines
> merge{
>   // change these two things
>   #local NPts = 8;
>   #local LineThickness = 0.03;
> 
>   // golden spiral points on sphere
>   #local Inc = pi * (3 - sqrt(5));
>   #local Off = 2 / NPts;
>   #local Seed = seed(1001);
>   #for(K, 0, NPts-1)
>    #local Y = K * Off - 1 + (Off / 2);
>    #local R = sqrt(1 - Y*Y);
>    #local Phi = K * Inc;
>    object{
>     Obj
>     translate LineThickness*<cos(Phi)*R, Y, sin(Phi)*R>
>    }
>   #end
>   texture{pigment{rgbt 1}}
>   interior_texture{pigment{rgb 0}}
>   interior{ior 1.0001}
>   no_shadow
>   no_reflection
> }
> 
> ^That technique requires some things to be merged.
> 
> Another idea is to keep using whatever post-process effect you have been using
> up til now, but feed it a simpler image without reflections, shadows, etc. Maybe
> give it an image rendered with +q0 or something. The problem with that, however,
> is some areas will not have lines because the adjacent colors will be the same.
> The only fix I know for that is to give different areas slightly different
> colors, so that the line algorithm has something to work with. (I hope that
> makes sense ;P)
> 
>> Attached is styled with posterized shadows with a 1/2 tone process dot per Sam's
>> suggestion - thanks Sam. I'm liking the comic book feel. I also removed the
>> reflection pass to reduce the busyness, especially in the pipes. Will continue
>> to play with this.
>> Mike.
> 
> It's looking good!
> 
> Sam
> 

Something similar can be achieved using the aoi pattern.


Post a reply to this message

From: Bald Eagle
Subject: Re: brain_attack.jpg
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

From: Bald Eagle
Subject: Re: brain_attack.jpg
Date: 9 Aug 2023 15:40:00
Message: <web.64d3eae3a73d0cdf1f9dae3025979125@news.povray.org>
It took a little bit of fiddling, but it seems that certain color map thresholds
work best, and eliminating the light source to get rid of the ray-traced shadows
and making the object visible using an emissive finish get a fairly passable
effect.

#version 3.8;

global_settings {assumed_gamma 1.0}

camera {
 location <0, -1, -3>/1.25
 look_at <0, 0, 0>
 right x*image_width/image_height
 up y
}

sky_sphere {pigment {rgb 1} }

torus {1, 0.25
 //texture {pigment {rgb 0.5} finish {specular 0.3}}
 texture {
  pigment {
   aoi
   color_map {
    [0.000 rgb 0.000]
    [0.350 rgb 0.000]

    [0.350 rgb 0.195]
    [0.556 rgb 0.195]

    [0.556 rgb 0.781]
    [0.681 rgb 0.781]

    [0.681 rgb 0.881]
    [0.881 rgb 0.881]

    [0.881 rgb 0.950]
    [1.000 rgb 0.950]
   } // end color map
  } // end pigment
  finish {emission 0.7}
 } // end texture
}


Post a reply to this message


Attachments:
Download 'cel-shading.png' (14 KB)

Preview of image 'cel-shading.png'
cel-shading.png


 

From: jr
Subject: Re: brain_attack.jpg
Date: 9 Aug 2023 15:45:00
Message: <web.64d3ecb9a73d0cdf80c03e9d6cde94f1@news.povray.org>
hi,

"Bald Eagle" <cre### [at] netscapenet> wrote:
> ...
> 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.

by some weird coincidence, I have SharkD's page on that open :-)
<https://wiki.povray.org/content/HowTo:Turn_a_continuous_function_into_a_stepped_function>


(the "donut" is cool)


regards, jr.


Post a reply to this message

From: Samuel B 
Subject: Re: brain_attack.jpg
Date: 9 Aug 2023 20:55:00
Message: <web.64d43474a73d0cdff8c47d526e741498@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "Samuel B." <stb### [at] hotmailcom> wrote:
>
> > Not sure how the lighting needs to be right, since the effect focuses only on
> > the outline...
>
> I had a bad light_source / camera combo, and it looked bad.
> [..and other scene differences..]

Huh, maybe I should have posted the entire scene! I figured the basic setup
would have been enough, but I guess there were other factors involved. If I
explore the idea again, I'll definitely make a new thread with a full scene
definition.

Sam


Post a reply to this message

From: Samuel B 
Subject: Re: brain_attack.jpg
Date: 9 Aug 2023 21:05:00
Message: <web.64d4373ca73d0cdff8c47d526e741498@news.povray.org>
Alain Martel <kua### [at] videotronca> wrote:

> > "Mike Miller" <mil### [at] gmailcom> wrote:
> >> "Bald Eagle" <cre### [at] netscapenet> wrote:
> >>> "Mike Miller" <mil### [at] gmailcom> wrote:
> >>>> Brain Attack pulp style cover using brain bots, pipes and tanks. [...]
> >>>
> >>> Pretty cool PS post-render effects.
> >>>
> >>> I'm wondering what can be done in that respect directly in POV-Ray, [...]
> >>
> >> Not sure how to get the edge and cel-shade look directly from POV.
> >
> > One idea for the outlines is to build a new object out of several copies, like
> > so [...]:
> > [...]
>
> Something similar can be achieved using the aoi pattern.

Yeah, but when objects have a hard edge, the aoi pattern will fail :(

Sam


Post a reply to this message

From: Samuel B 
Subject: Re: brain_attack.jpg
Date: 9 Aug 2023 21:20:00
Message: <web.64d43a1aa73d0cdff8c47d526e741498@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> > "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
>
> [GLSL code]
>
> 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.

All the values we need are not provided in POV's SDL, I think :(

> 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

I'm not sure specular is basically just AOI. And the AOI pattern is ok for
getting the edges for curved objects, but it produces varied results based on
objects' curvature, with sharp-edged objects failing completely. To get
everything, we would need to render things in at least two passes, with the
edge-finding pass evaluating a function...

Sam


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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