|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 6/18/2021 8:41 AM, Mike Horvath wrote:
> 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
Specifying an empty texture
texture {}
to the original object does not seem to do the trick.
Mike
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Mike Horvath <mik### [at] gmailcom> wrote:
> Is there a way to override textures or materials that have already been
> declared or applied?
What if you union everything together and do an intersection with a box that is
the size of the union's bounding box? The intersection ought to be its own
object that you can give a fresh texture to.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 6/18/2021 1:33 PM, Bald Eagle wrote:
> Mike Horvath <mik### [at] gmailcom> wrote:
>> Is there a way to override textures or materials that have already been
>> declared or applied?
>
> What if you union everything together and do an intersection with a box that is
> the size of the union's bounding box? The intersection ought to be its own
> object that you can give a fresh texture to.
>
>
>
Interesting. I will try this.
Mike
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Mike Horvath <mik### [at] gmailcom> wrote:
> 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
Hi Mike,
for depth_maps I use a variable to change every finish ( e.g. finish {specular
dfac*0.3 roughness 0.0003 diffuse dfac*0.6 reflection {dfac*0.03, dfac*0.1}}.
For the "normal" render dfac is defined as 1 and for depthmaps or other
effectmaps dfac is 0.
Together with a white fog you get your depthmap.
Norbert
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Am 18.06.2021 um 19:33 schrieb Bald Eagle:
> Mike Horvath <mik### [at] gmailcom> wrote:
>> Is there a way to override textures or materials that have already been
>> declared or applied?
>
> What if you union everything together and do an intersection with a box that is
> the size of the union's bounding box? The intersection ought to be its own
> object that you can give a fresh texture to.
That's a smart idea.
You may need to specify `cutaway_textures` though, and I'm not sure
whether it does indeed work with objects that are already explicitly
textured.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
clipka <ano### [at] anonymousorg> wrote:
> That's a smart idea.
Thanks. This specific issue has been bouncing around in my head for a long
time.
> You may need to specify `cutaway_textures` though, and I'm not sure
> whether it does indeed work with objects that are already explicitly
> textured.
Yes, I figured I'd get into cutaway_textures if there were problems, as I know
it doesn't always work as I expect it to.
The other idea I had was to use either the object texture, or to turn the object
into an isosurface, which should completely scrub any texture information - CSG
or not - since it's an object that gets generated from scratch.
One other option, albeit more challenging, is to generate a mesh from the object
- like Chris Young did with his Christmas ornament for 3D printing, and use the
resulting mesh.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |