POV-Ray : Newsgroups : povray.general : Details on layered textures/materials : Re: Details on layered textures/materials Server Time
3 May 2024 04:50:48 EDT (-0400)
  Re: Details on layered textures/materials  
From: Chris R
Date: 29 Mar 2024 10:30:00
Message: <web.6606d00e5a55796433dbb0635cc1b6e@news.povray.org>
Thomas de Groot <tho### [at] degrootorg> wrote:
> Op 28-3-2024 om 18:55 schreef Chris R:
> > [snip]
> >
> > In my particular use case, I was hoping to have an object that is partially
> > polished, and partially unpolished, as if the polish had worn away in some
> > places, but there is no way to "unpack" the texture from the material, so I will
> > have to take the macro code and modify it to return a texture instead of a
> > material if I want to do this.
> >
> >
> It has been a long time since I last looked at the granite code... Your
> analysis is right I guess, your questions are sensible, but I do not
> have the necessary insight into  the particular/individual
> working/interactions of all the elements in POV-Ray to answer them
> properly. As you may perhaps remember, the project initiated from an
> individual need at the time, and - as happens often - inflated and
> became more complex as work progressed. Your particular wish was not
> considered or thought of then, I am afraid.
>
> I guess you will have to do as you suggest above. I don't know what
> would be the most sensible approach. Probably to pull the code apart and
> re-assemble it as two separate textures, or as one texture macro with a
> polished/dull switch. The material envelop can always be added later if
> necessary.
>
> If I get a smart idea I shall come back. Time and energy are rather at a
> low level though... :-(
>
> --
> Thomas
I took a crack at breaking it into two macros.  The bulk is your original macro,
renamed, but instead of declaring a material at the end of it that encloses all
of the textures with an interior, I just returned the layered texture.  I then
added a new version of DakotaRedGranite that declares a material with the
texture returned by the new macro and an interior { ior 1.6 }.  That way if I
want the original behavior, I still just call your macro name.  If I need to
include the texture in a pattern, I call just the texture version of it.

There were a few other tweaks due to some parser errors that I still don't quite
understand, but I got it to work.

-- Chris R


Post a reply to this message

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