![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Jan Dvorak <jan### [at] centrum cz> wrote:
> sirhenjo napsal(a):
> > I am wondering if it's possible to render a depth and/or normal map using
> > povray, instead of a regular scene render.
> >
> > The depth map can be generated by measuring the depth from a reference plane
> > (bounding box for example) and cast rays to the surface of the objects.
> >
> > Is this possible?
> > I know there are other platforms that can do this, just wondering if POV-Ray can
> > be setup to generate such maps.
> >
> >
> depth map:
> set a gradient pigment perpendicular to the camera plane and set ambient
> 1 diffuse 0
Normal map, use combined slope patterns.
-tgq
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
sirhenjo nous apporta ses lumieres en ce 2007/11/15 08:55:
> I am wondering if it's possible to render a depth and/or normal map using
> povray, instead of a regular scene render.
>
> The depth map can be generated by measuring the depth from a reference plane
> (bounding box for example) and cast rays to the surface of the objects.
>
> Is this possible?
> I know there are other platforms that can do this, just wondering if POV-Ray can
> be setup to generate such maps.
>
>
For the depth map:
1 - remove all textures and pigments.
2 - bind everything but the camera in one union.
3 - apply a gradient pattern to your big union scaled to it's depth. Have the
gradient perpendicular to the camera axis.
4 - remove all light_source and use ambient 1 diffuse 0.
For the normal map:
Do the same, but replace the gradient by a slope pattern.
Both are easier with a camera on an axis looking as the origin, but you can have
the camera set at any possible location.
--
Alain
-------------------------------------------------
You know you've been raytracing too long when your idea of a complete computer
is a fast CPU, lots of RAM, and a means of running POVray.
Aaron Gage a.k.a Slartibartfast
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Okay, thank you all. It seems that POV-Ray is indeed capable of doing it.
However, to make it really viable for me, I need some more functionality. During
the raycasting I want to make some extra checks.
For example, I have multiple objects in front of eachother with some space
between them. Instead of writing a depth map of the scene, letting rays end
whenever they hit any object, I may want to write the depth values of an
complete second object.
To achieve this I may need to let the ray keep till it hits the 3rd face,
ignoring the first 2 faces.
Is this possible at all?
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: Zeger Knaepen
Subject: Re: render depth/normal map with povray?
Date: 15 Nov 2007 18:37:35
Message: <473cd83f@news.povray.org>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"sirhenjo" <sir### [at] hotmail com> wrote in message
news:web.473cafc7fcd9bf9af721d5e80@news.povray.org...
> Okay, thank you all. It seems that POV-Ray is indeed capable of doing it.
> However, to make it really viable for me, I need some more functionality.
> During
> the raycasting I want to make some extra checks.
>
> For example, I have multiple objects in front of eachother with some space
> between them. Instead of writing a depth map of the scene, letting rays
> end
> whenever they hit any object, I may want to write the depth values of an
> complete second object.
>
> To achieve this I may need to let the ray keep till it hits the 3rd face,
> ignoring the first 2 faces.
>
> Is this possible at all?
uhm, just remove the blocking object?
I don't get it :)
cu!
--
#macro G(b,e)b+(e-b)*C/50#end#macro _(b,e,k,l)#local C=0;#while(C<50)
sphere{G(b,e)+3*z.1pigment{rgb G(k,l)}finish{ambient 1}}#local C=C+1;
#end#end _(y-x,y,x,x+y)_(y,-x-y,x+y,y)_(-x-y,-y,y,y+z)_(-y,y,y+z,x+y)
_(0x+y.5+y/2x)_(0x-y.5+y/2x) // ZK http://www.povplace.com
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Zeger Knaepen" <zeg### [at] povplace com> wrote:
> "sirhenjo" <sir### [at] hotmail com> wrote in message
> news:web.473cafc7fcd9bf9af721d5e80@news.povray.org...
> > Okay, thank you all. It seems that POV-Ray is indeed capable of doing it.
> > However, to make it really viable for me, I need some more functionality.
> > During
> > the raycasting I want to make some extra checks.
> >
> > For example, I have multiple objects in front of eachother with some space
> > between them. Instead of writing a depth map of the scene, letting rays
> > end
> > whenever they hit any object, I may want to write the depth values of an
> > complete second object.
> >
> > To achieve this I may need to let the ray keep till it hits the 3rd face,
> > ignoring the first 2 faces.
> >
> > Is this possible at all?
>
> uhm, just remove the blocking object?
>
> I don't get it :)
>
> cu!
> --
> #macro G(b,e)b+(e-b)*C/50#end#macro _(b,e,k,l)#local C=0;#while(C<50)
> sphere{G(b,e)+3*z.1pigment{rgb G(k,l)}finish{ambient 1}}#local C=C+1;
> #end#end _(y-x,y,x,x+y)_(y,-x-y,x+y,y)_(-x-y,-y,y,y+z)_(-y,y,y+z,x+y)
> _(0x+y.5+y/2x)_(0x-y.5+y/2x) // ZK http://www.povplace.com
Heheh, should have said "without removing the blocking object".
It may seem like something silly to do, but I have my reasons for this question.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"sirhenjo" <sir### [at] hotmail com> wrote in message
news:web.473d50b6fcd9bf9a1d0a17590@news.povray.org...
> Heheh, should have said "without removing the blocking object".
> It may seem like something silly to do, but I have my reasons for this
> question.
Could you elaborate? 'cause I still don't understand why you need the
blocking object if it won't be visible in the render :)
cu!
--
#macro G(b,e)b+(e-b)*C/50#end#macro _(b,e,k,l)#local C=0;#while(C<50)
sphere{G(b,e)+3*z.1pigment{rgb G(k,l)}finish{ambient 1}}#local C=C+1;
#end#end _(y-x,y,x,x+y)_(y,-x-y,x+y,y)_(-x-y,-y,y,y+z)_(-y,y,y+z,x+y)
_(0x+y.5+y/2x)_(0x-y.5+y/2x) // ZK http://www.povplace.com
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
>
> Heheh, should have said "without removing the blocking object".
> It may seem like something silly to do, but I have my reasons for this question.
If you need it for reflections/shadows/whatever, use no_image.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
sirhenjo nous apporta ses lumieres en ce 2007/11/16 03:11:
> "Zeger Knaepen" <zeg### [at] povplace com> wrote:
>> "sirhenjo" <sir### [at] hotmail com> wrote in message
>> news:web.473cafc7fcd9bf9af721d5e80@news.povray.org...
>>> Okay, thank you all. It seems that POV-Ray is indeed capable of doing it.
>>> However, to make it really viable for me, I need some more functionality.
>>> During
>>> the raycasting I want to make some extra checks.
>>>
>>> For example, I have multiple objects in front of eachother with some space
>>> between them. Instead of writing a depth map of the scene, letting rays
>>> end
>>> whenever they hit any object, I may want to write the depth values of an
>>> complete second object.
>>>
>>> To achieve this I may need to let the ray keep till it hits the 3rd face,
>>> ignoring the first 2 faces.
>>>
>>> Is this possible at all?
>> uhm, just remove the blocking object?
>>
>> I don't get it :)
>>
>> cu!
>> --
>> #macro G(b,e)b+(e-b)*C/50#end#macro _(b,e,k,l)#local C=0;#while(C<50)
>> sphere{G(b,e)+3*z.1pigment{rgb G(k,l)}finish{ambient 1}}#local C=C+1;
>> #end#end _(y-x,y,x,x+y)_(y,-x-y,x+y,y)_(-x-y,-y,y,y+z)_(-y,y,y+z,x+y)
>> _(0x+y.5+y/2x)_(0x-y.5+y/2x) // ZK http://www.povplace.com
>
>
> Heheh, should have said "without removing the blocking object".
> It may seem like something silly to do, but I have my reasons for this question.
>
>
Is it that you wand to see the object in the back trough that in the front?
--
Alain
-------------------------------------------------
You know you have been raytracing for too long when the animation you render
will be finished after yourself.
Urs Holzer
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Alain <ele### [at] netscape net> wrote:
> sirhenjo nous apporta ses lumieres en ce 2007/11/16 03:11:
> > "Zeger Knaepen" <zeg### [at] povplace com> wrote:
> >> "sirhenjo" <sir### [at] hotmail com> wrote in message
> >> news:web.473cafc7fcd9bf9af721d5e80@news.povray.org...
> >>> Okay, thank you all. It seems that POV-Ray is indeed capable of doing it.
> >>> However, to make it really viable for me, I need some more functionality.
> >>> During
> >>> the raycasting I want to make some extra checks.
> >>>
> >>> For example, I have multiple objects in front of eachother with some space
> >>> between them. Instead of writing a depth map of the scene, letting rays
> >>> end
> >>> whenever they hit any object, I may want to write the depth values of an
> >>> complete second object.
> >>>
> >>> To achieve this I may need to let the ray keep till it hits the 3rd face,
> >>> ignoring the first 2 faces.
> >>>
> >>> Is this possible at all?
> >> uhm, just remove the blocking object?
> >>
> >> I don't get it :)
> >>
> >> cu!
> >> --
> >> #macro G(b,e)b+(e-b)*C/50#end#macro _(b,e,k,l)#local C=0;#while(C<50)
> >> sphere{G(b,e)+3*z.1pigment{rgb G(k,l)}finish{ambient 1}}#local C=C+1;
> >> #end#end _(y-x,y,x,x+y)_(y,-x-y,x+y,y)_(-x-y,-y,y,y+z)_(-y,y,y+z,x+y)
> >> _(0x+y.5+y/2x)_(0x-y.5+y/2x) // ZK http://www.povplace.com
> >
> >
> > Heheh, should have said "without removing the blocking object".
> > It may seem like something silly to do, but I have my reasons for this question.
> >
> >
> Is it that you wand to see the object in the back trough that in the front?
>
> --
> Alain
> -------------------------------------------------
> You know you have been raytracing for too long when the animation you render
> will be finished after yourself.
> Urs Holzer
What I want to to write several depth levels to one particular texture, using
the RGBa channels for 4 different depth levels.
I want to store 4 depth levels at 0% 33% 66% and 100% to one texture. Removing
objects in the front won't help me for complex scenes.
Some basic algorithm I need during the raycasting is a counter of intersected
faces and the distance between them.
Can I add some logic/algorithm to the raycasting?
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"sirhenjo" <sir### [at] hotmail com> wrote in message
news:web.47440808fcd9bf9a1d0a17590@news.povray.org...
> Alain <ele### [at] netscape net> wrote:
>> sirhenjo nous apporta ses lumieres en ce 2007/11/16 03:11:
>> > "Zeger Knaepen" <zeg### [at] povplace com> wrote:
>> >> "sirhenjo" <sir### [at] hotmail com> wrote in message
>> >> news:web.473cafc7fcd9bf9af721d5e80@news.povray.org...
>> >>> Okay, thank you all. It seems that POV-Ray is indeed capable of doing
>> >>> it.
>> >>> However, to make it really viable for me, I need some more
>> >>> functionality.
>> >>> During
>> >>> the raycasting I want to make some extra checks.
>> >>>
>> >>> For example, I have multiple objects in front of eachother with some
>> >>> space
>> >>> between them. Instead of writing a depth map of the scene, letting
>> >>> rays
>> >>> end
>> >>> whenever they hit any object, I may want to write the depth values of
>> >>> an
>> >>> complete second object.
>> >>>
>> >>> To achieve this I may need to let the ray keep till it hits the 3rd
>> >>> face,
>> >>> ignoring the first 2 faces.
>> >>>
>> >>> Is this possible at all?
>> >> uhm, just remove the blocking object?
>> >>
>> >> I don't get it :)
>> >>
>> >> cu!
>> >> --
>> >> #macro G(b,e)b+(e-b)*C/50#end#macro _(b,e,k,l)#local C=0;#while(C<50)
>> >> sphere{G(b,e)+3*z.1pigment{rgb G(k,l)}finish{ambient 1}}#local C=C+1;
>> >> #end#end _(y-x,y,x,x+y)_(y,-x-y,x+y,y)_(-x-y,-y,y,y+z)_(-y,y,y+z,x+y)
>> >> _(0x+y.5+y/2x)_(0x-y.5+y/2x) // ZK http://www.povplace.com
>> >
>> >
>> > Heheh, should have said "without removing the blocking object".
>> > It may seem like something silly to do, but I have my reasons for this
>> > question.
>> >
>> >
>> Is it that you wand to see the object in the back trough that in the
>> front?
>>
>> --
>> Alain
>> -------------------------------------------------
>> You know you have been raytracing for too long when the animation you
>> render
>> will be finished after yourself.
>> Urs Holzer
>
> What I want to to write several depth levels to one particular texture,
> using
> the RGBa channels for 4 different depth levels.
>
> I want to store 4 depth levels at 0% 33% 66% and 100% to one texture.
> Removing
> objects in the front won't help me for complex scenes.
>
> Some basic algorithm I need during the raycasting is a counter of
> intersected
> faces and the distance between them.
> Can I add some logic/algorithm to the raycasting?
>
I have to confess that I'm not completely sure what you're asking. What
you've described conjures up the image of you wanting to do something like
take slices through a scene, rendering the top slice (everything in the
scene) in Red, then, on the next render, taking a slice 33% into the scene
and rendering in Green etc.
If you do what Alain suggested in his response of 15th Nov, (create one big
union of all of the objects in the scene), then you can take slices by
differencing the composite object with a plane that you can move forward
through the scene file for each frame. This would mean that the camera will
only 'see' those parts of objects that are beyond a certain 'depth'.
Did I get anywhere close to what you want?
Regards,
Chris B.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |