Forum: Poser - OFFICIAL


Subject: Underwater submarine

Helgard opened this issue on Jun 26, 2010 ยท 195 posts


kawecki posted Fri, 09 July 2010 at 9:32 PM

Quote - Sorry, but everything you said after the underlined sentence is not true. What you describe is the Z-Depth, but that's not the "x" that DepthCue is using. It is using the exact straight line distance from the camera to the object. Nothing about the camera rotation or focal length or perspective mode matters at all. It is doing exactly what it is supposed to do, as you said in the second sentence above.

Poser does all the calculation internally, you only can set the start and end point of depth cue in Poser will do by itself all the calculation of distances and attenuate the light I suppose in linear way.
But if you want to change the attenuation function to be different what Poser does internally you must calculate the distances by yourself and apply your transfer function.
There are only two ways to calculate distances, no matter if you or Poser does.
You can calculate distance in the World Space or in the Camera Space.

In World Space you need the x,y,z values for the Camera and the x,y,z for each point of the objects in scene.
For the distance calculation you must perform three substractions, three squares and one square root for each vertex of the scene, something very time consuming.

In Camera Space to calculate distances you only need to know the z value of the camera and the z value for each point, values that you get from the Z buffer.
With a linear Z buffer the distance is nothing more than the difference of z values.
For a perspective Z buffer you must first perform a division and then the difference of the z values, is more time consuming than a linear Z buffer.
Even so, all is very must faster than in the World Space because you only need to calculate distances for each pixel of the scene and not all vertices of all objects. You calculate only what you see and not what is obscured by other objects.
Of course that Poser must do it internally in the Camera Space.

In either case you also need to know the scale factor of the World or Camera Space and in case of the perspective Z buffer also the Camera parameters.

Stupidity also evolves!