POV-Ray : Newsgroups : povray.advanced-users : Override textures/materials? : Re: Override textures/materials? Server Time
20 Apr 2024 05:04:57 EDT (-0400)
  Re: Override textures/materials?  
From: Mike Horvath
Date: 18 Jun 2021 13:50:19
Message: <60ccdcdb$1@news.povray.org>
On 6/18/2021 9:30 AM, clipka wrote:
> Am 18.06.2021 um 14:41 schrieb Mike Horvath:
>> Is there a way to override textures or materials that have already 
>> been declared or applied?
>>
>> I am trying to create a depth map, and need to apply a custom texture 
>> to the entire object.
> 
> 
> If the object in question is a primitive, then I _think_ this should be 
> possible simply by referencing the object in question and specifying a 
> new `texture` block, like so:
> 
>      // original object
>      #declare OriginalObject = sphere { ... texture { ... } };
> 
>      // override texture
>      #declare ClonedObject = object { OriginalObject texture { ... } };
> 
> However, if the object in question is a compound object (merge, union or 
> the like), then I don't think it is possible. At least if the texture is 
> defined at the component level.
> 
> The reason is that the mechanism is designed for use cases in which part 
> of a compound object's textures are defined while others can be 
> overridden later. Think e.g. a car, where you can later apply the 
> texture to use for the car's body, but all the other textures like rims, 
> tyres, headlights, windscreen etc. are already fixed and immutable.
> 
> To achive this, a "texture override" on compound objects only affects 
> those components that have no explicit texture definition of their own, 
> while all other components will cling to their textures like superglue.

It would be nice if I could flag a texture as "important" such that it 
overrides all previously defined textures. I can do this in CSS and it 
is very handy.


Mike


Post a reply to this message

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