Notifications
Clear all

[Closed] 3dsmax how to access viewport Z-Buffer?

Is there a way, using maxscript or max SDK, to pull the Z-Buffer from a viewport?

There is GraphicsWindow::getDepthValue() http://docs.autodesk.com/3DSMAX/16/ENU/3ds-Max-SDK-Programmer-Guide/index.html?url=files/GUID-EC312B39-5B82-4ED4-8AF2-C4E3779097DD.htm,topicNumber=d30e37117 but doing that for each pixel individually seems very inefficient, and I also think it doesn’t use the actual depth-buffer (like for example when wireframes are rendered using lines) but the depths of the solid surfaces.

The reason is that I need pixel-perfect high-precision depth values for a viewport-preview rendering.

How can this be done?

1 Reply

Capture the Scene a second time with a new material on all objects.
The new material is 100% selillu and should have a fallof in Camera-z axis from black to white.
That should do the trick for you.