POV-Ray : Newsgroups : povray.general : Details on layered textures/materials : Re: Details on layered textures/materials Server Time
3 May 2024 04:05:07 EDT (-0400)
  Re: Details on layered textures/materials  
From: Chris R
Date: 28 Mar 2024 13:10:00
Message: <web.6605a33b5a5579644d6accde5cc1b6e@news.povray.org>
"Chris R" <car### [at] comcastnet> wrote:
> I was looking at using the Dakota Red Granite macro from Thomas de Groot in a
> scene that I am working on and found that it generates a material{}.  I had been
> under the mistaken notion that you couldn't layer materials, until I read the
> details on what they are, which made me happy.
>
> But I started wondering how all of the components of a layered material actually
> work and couldn't find a concise explanation.
>
> The pigment part of the texture in a material makes sense to me, and I
> understand that the filter/transmit values determine how to mix the texture
> starting from the bottom to the top layer.  The other parts are not so clear to
> me.
>
> Normals:  Do upper layers add or replace the normal in the lower layer(s)?  It
> doesn't seem that pigment transparency would have any effect on mixing the
> normals from the various layers.
>
> Finish: Same question, does it add or replace the finish from the lower layers?
> If it replaces, does it only replace the elements of the finish not declared in
> lower layers, or does it replace the entire finish?  I am pretty sure pigment
> transparency doesn't affect this either, or else the standard layering tactic to
> make the top layer a completely transparent pigment with the finish you want
> wouldn't work.
>
> Interior: This is what just recently occurred to me, and I have no idea what
> happens here.  Again, do subsequent interior statements replace prior ones, or
> just add what wasn't previously declared?
>
> For most of my interiors I am only concerned with ior, so replacement makes
> sense, but what about interior fading and media?
>
> -- Chris R

I started doing some experiments to try and determine empirically how the
layering works.  I did not devise anything yet to test what layered interior
statements do; I focused on the textures part first.

As expected, and explained in documentation, the pigment{} portions of layered
textures are blended together based on filter/transmit settings of the layers
above the base layer.

Normals, also seem to be blended, and it appears the pigment
transparency/filtering is used to determine how to blend them.  I'm not sure how
the implementation works, but possibly the normal is applied to the pigment
first, and then the layers are blended together?

Finish: this is the hairiest one to figure out.
Specular seems to be additive.  I created a solid pigment layer with specular
1.0 and default for everything else.  I created a completely transparent pigment
layer with specular 1.0 and everything else default.  The specular highlight on
the layered object was twice as bright as the highlight on the base-only object.
 It's a little hard to tell what's happening when you have a partially
transparent layer.

I think roughness is somehow combined, but it isn't additive.  Not sure how its
done.

Diffuse seems to be a blend based on the transparency of the upper pigment, but
again, it is a little hard to determine what its doing with my small
experiments.

Reflection seems to be the most confusing.  If the lower layer has no
reflection, and the upper layer has reflection, the whole object has the upper
layer reflection, regardless of the pigment filter/transmit of the upper layer.

However, I did some experiments where the base layer had a reflection of 1, and
the upper layer had a reflection of 0.  In this case, the parts of the base
layer that show through the pigment filter/transmit have reflection, but the
parts of the upper layer that are visible have no reflection.

I haven't looked into things like metallic, crand, etc.

-- Chris R


Post a reply to this message

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