POV-Ray : Newsgroups : povray.advanced-users : Override textures/materials? Server Time
24 Sep 2021 13:48:44 EDT (-0400)
  Override textures/materials? (Message 11 to 20 of 31)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Bald Eagle
Subject: Re: Override textures/materials?
Date: 18 Jun 2021 15:40:00
Message: <web.60ccf65deaa343741f9dae3025979125@news.povray.org>
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

From: Mike Horvath
Subject: Re: Override textures/materials?
Date: 18 Jun 2021 16:32:48
Message: <60cd02f0$1@news.povray.org>
On 6/18/2021 2:15 PM, Norbert Kern wrote:
> 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
> 


Could you post some example images? I don't quite understand what this does.


Mike


Post a reply to this message

From: Norbert Kern
Subject: Re: Override textures/materials?
Date: 19 Jun 2021 09:40:00
Message: <web.60cdf304eaa34374d81232a3b7ae6630@news.povray.org>
Mike Horvath <mik### [at] gmailcom> wrote:

> Could you post some example images? I don't quite understand what this does.
>
>
> Mike


If you set every diffuse, specular, phong, ambient, emission and reflection
value as zero, you get a black material.
A white fog turns this to an inverse depthmap. Then you can adapt the color_map
of your blurring file or you can invert it via Photoshop and co to get a
"regular" depthmap.
Here is a depthmap of my last image.

Norbert


Post a reply to this message


Attachments:
Download 'mountain_forest_depth.jpg' (285 KB)

Preview of image 'mountain_forest_depth.jpg'
mountain_forest_depth.jpg


 

From: clipka
Subject: Re: Override textures/materials?
Date: 19 Jun 2021 10:38:08
Message: <60ce0150$1@news.povray.org>
Am 19.06.2021 um 15:37 schrieb Norbert Kern:

> If you set every diffuse, specular, phong, ambient, emission and reflection
> value as zero, you get a black material.
> A white fog turns this to an inverse depthmap. Then you can adapt the color_map
> of your blurring file or you can invert it via Photoshop and co to get a
> "regular" depthmap.
> Here is a depthmap of my last image.

Some caveats of this approach:

- The brightness will not depend on the Z coordinate, but on the 
distance to the camera; this may or may not be what you want.

- The image value will not represent the distance itself, but rather an 
exponential-ish function thereof, something like:

     f(d) = 1 - p^d

where p is a value < 1. Again, this may or may not be what you want.


Also, like with every other thing where you want to get a per-pixel 
value out of the render rather than a color, the topic of gamma needs 
attention, and also precision, i.e. bit depth.


Post a reply to this message

From: Alain Martel
Subject: Re: Override textures/materials?
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

From: Mike Horvath
Subject: Re: Override textures/materials?
Date: 19 Jun 2021 15:36:53
Message: <60ce4755$1@news.povray.org>
On 6/18/2021 2:53 PM, clipka wrote:
> 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

>> 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.

What is `cutaway_textures`? I have never head of it.


Mike


Post a reply to this message

From: Mike Horvath
Subject: Re: Override textures/materials?
Date: 19 Jun 2021 15:38:43
Message: <60ce47c3$1@news.povray.org>
On 6/19/2021 10:38 AM, clipka wrote:
> Am 19.06.2021 um 15:37 schrieb Norbert Kern:
> 
>> If you set every diffuse, specular, phong, ambient, emission and 
>> reflection
>> value as zero, you get a black material.
>> A white fog turns this to an inverse depthmap. Then you can adapt the 
>> color_map
>> of your blurring file or you can invert it via Photoshop and co to get a
>> "regular" depthmap.
>> Here is a depthmap of my last image.
> 
> Some caveats of this approach:
> 
> - The brightness will not depend on the Z coordinate, but on the 
> distance to the camera; this may or may not be what you want.
> 
> - The image value will not represent the distance itself, but rather an 
> exponential-ish function thereof, something like:
> 

> 
> where p is a value < 1. Again, this may or may not be what you want.
> 
> 
> Also, like with every other thing where you want to get a per-pixel 
> value out of the render rather than a color, the topic of gamma needs 
> attention, and also precision, i.e. bit depth.

Would it work better if depth maps were an engine feature versus a bunch 
of tricks/hacks with pigments or fog?


Mike


Post a reply to this message

From: Mike Horvath
Subject: Re: Override textures/materials?
Date: 19 Jun 2021 15:40:18
Message: <60ce4822$1@news.povray.org>
On 6/19/2021 3:38 PM, Mike Horvath wrote:
> On 6/19/2021 10:38 AM, clipka wrote:
>> Am 19.06.2021 um 15:37 schrieb Norbert Kern:
>>
>>> If you set every diffuse, specular, phong, ambient, emission and 
>>> reflection
>>> value as zero, you get a black material.
>>> A white fog turns this to an inverse depthmap. Then you can adapt the 
>>> color_map
>>> of your blurring file or you can invert it via Photoshop and co to get a
>>> "regular" depthmap.
>>> Here is a depthmap of my last image.
>>
>> Some caveats of this approach:
>>
>> - The brightness will not depend on the Z coordinate, but on the 
>> distance to the camera; this may or may not be what you want.
>>
>> - The image value will not represent the distance itself, but rather 
>> an exponential-ish function thereof, something like:
>>

>>
>> where p is a value < 1. Again, this may or may not be what you want.
>>
>>
>> Also, like with every other thing where you want to get a per-pixel 
>> value out of the render rather than a color, the topic of gamma needs 
>> attention, and also precision, i.e. bit depth.
> 
> Would it work better if depth maps were an engine feature versus a bunch 
> of tricks/hacks with pigments or fog?
> 
> 
> Mike

Not saying you should implement it. 3D photos (see other thread) don't 
seem to actually work that well except in a minority of specific cases.


Mike


Post a reply to this message

From: Bald Eagle
Subject: Re: Override textures/materials?
Date: 19 Jun 2021 15:50:00
Message: <web.60ce4961eaa343741f9dae3025979125@news.povray.org>
Mike Horvath <mik### [at] gmailcom> wrote:

> What is `cutaway_textures`? I have never head of it.

It's a keyword
http://www.povray.org/documentation/view/3.6.1/362/


Post a reply to this message

From: Bald Eagle
Subject: Re: Override textures/materials?
Date: 19 Jun 2021 15:55:00
Message: <web.60ce4b7feaa343741f9dae3025979125@news.povray.org>
Is this the same as:

http://news.povray.org/povray.advanced-users/thread/%3C5e52bde0%241%40news.povray.org%3E/

http://news.povray.org/povray.newusers/thread/%3Cweb.5c90a6ab69c1cfb51d791a250%40news.povray.org%3E/

?

I have done a similar thing for 3D printing, and simply used a gradient texture,
scaled and translated to contain the entire scene within the 0-1 range.


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

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