POV-Ray : Newsgroups : povray.advanced-users : depth map? Server Time
24 Apr 2024 19:22:00 EDT (-0400)
  depth map? (Message 11 to 12 of 12)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Alain
Subject: Re: depth map?
Date: 12 May 2009 19:59:45
Message: <4a0a0d71$1@news.povray.org>
Chris B nous illumina en ce 2009-05-12 16:44 -->
>> "Marvin" <mto### [at] grfhr> wrote in message
>>> Could you please give an example of a texture with grayscale gradient 
>>> oriented
>>> towards the camera?
> 
> .. but thinking about it, you're probably better off using an 'onion' 
> pattern than a gradient pattern for this so that it fades to black as a 
> function of distance from the camera rather than as a function of the 
> distance from the plane the camera sits on. Note you should scale in all 
> 3 dimensions and you no longer need to reorient the pigment.
> 
> 
>  pigment {
>    onion color_map {
>      [0 color rgb 1]
>      [1 color rgb 0]
>    }
>    scale vlength(Camera_Location-Camera_Lookat)
>    translate Camera_Location
>  }
> 
> 
> Regards,
> Chris B
> 
Even beter, use the spherical pattern.
Have a value of 1 at the origin, that you translate to the camera location, and 
a value of zero at 1 unit radius, scaled to the depth of your scene.
If you scale the onion pattern to small, it goes back to 1 where you want black.


Post a reply to this message

From: Chris B
Subject: Re: depth map?
Date: 13 May 2009 02:16:31
Message: <4a0a65bf@news.povray.org>
"Alain" <ele### [at] netscapenet> wrote in message 
news:4a0a0d71$1@news.povray.org...
> Chris B nous illumina en ce 2009-05-12 16:44 -->
>>> "Marvin" <mto### [at] grfhr> wrote in message
>>>> Could you please give an example of a texture with grayscale gradient
>>
>> .. but thinking about it, you're probably better off using an 'onion'
>
> Even beter, use the spherical pattern.
> Have a value of 1 at the origin, that you translate to the camera 
> location, and a value of zero at 1 unit radius, scaled to the depth of 
> your scene.
> If you scale the onion pattern to small, it goes back to 1 where you want 
> black.

OTOH that makes it easier to spot any mistake if you accidentally scale the 
pattern too small ;)
You could of course use the onion pattern as a test to make sure the deepest 
depth is where you want it and use the spherical pattern for the final 
render (best of both worlds).

Regards,
Chris B.


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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