POV-Ray : Newsgroups : povray.advanced-users : Override textures/materials? : Re: Override textures/materials? Server Time
26 Apr 2024 20:29:15 EDT (-0400)
  Re: Override textures/materials?  
From: Alain Martel
Date: 19 Jun 2021 12:58:57
Message: <60ce2251$1@news.povray.org>
Le 2021-06-18 à 13:52, Mike Horvath a écrit :
> On 6/18/2021 10:44 AM, Alain Martel wrote:
>> Le 2021-06-18 à 08:41, Mike Horvath a écrit :
>>> 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.
>>>
>>> Thanks.
>>>
>>>
>>> Mike
>>
>> In the case of a texture or material that have been declared but not 
>> used yet, a new #declare will completely replace the original with the 
>> new definition.
>> If it have been applied to something, then redefined, then, any object 
>> that received it will keep the original definition.
>>
>> In your case, you need to remove, or at least comment out, any texture 
>> or material from your object. Then, apply your new texture to that 
>> object as a whole.
>>
> 
> Instead of declaring my textures, I may start using macros instead. That 
> way, I can just comment out the texture declaration inside the macro. 
> But might this not consume more memory?
> 
> 
> Mike

Whenever you use a macro, it get expanded every times it's used, so, 
will use more memory while parsing.

When you use a declared texture that is applied in many places, then, 
you can change it everywhere at once by changing the declare.

With a macro, you can do the same by changing the definition of the 
macro. That won't affect the parameters passed to that macro anywhere in 
the scene, but, you can change the macro so that it still accept the 
same parameter but ignore them.


Post a reply to this message

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