[vtkusers] Use depth map from vtkShadowMapBakerPass

Ken Martin ken.martin at kitware.com
Thu Jun 9 09:35:39 EDT 2016


Not sure if this helps (or is your issue) but the depth values are post
light-camera perspective transform. To get them back into world coordinates
you have to apply the inverse of that transform (or something simpler if
you just want the world coordinate distance). It is a non-linear mapping.
If you google zbuffer to world there are usually a number of hits that talk
about this process. To do it you need the  light-camera clipping range from
the original matrix (around line 619 in the shadow  map baker pass)

Thanks
Ken



On Thu, Jun 9, 2016 at 7:05 AM, Maximilian Dankbar <indienator at gmx.de>
wrote:

> Hi everyone,
>
> I try to use the depth maps generated by vtkShadowMapBakerPass to
> determine which objects are occluded by other objects.  To do that I
> download the texture to an unsigned int array.
>
> However I can not figure out how to interpret the values within the map.
> Normalizing with the clipping range values of the corresponding light
> camera only works for one camera position. In that case the direction of
> projection of the camera is (0, 1, 0). In all other cases that I tested the
> near clipping range is far too low and the far clipping range probably too
> high.
>
> Is there any other way to normalize the depth values?
>
> Thank you in advance for your help!
> Max
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
>


-- 
Ken Martin PhD
Chairman & CFO
Kitware Inc.
28 Corporate Drive
Clifton Park NY 12065
518 371 3971

This communication, including all attachments, contains confidential and
legally privileged information, and it is intended only for the use of the
addressee.  Access to this email by anyone else is unauthorized. If you are
not the intended recipient, any disclosure, copying, distribution or any
action taken in reliance on it is prohibited and may be unlawful. If you
received this communication in error please notify us immediately and
destroy the original message.  Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160609/c903fabd/attachment.html>


More information about the vtkusers mailing list