Depth buffer
Hello,
I need the depth information of each pixel, so I'm wondering if it is possible to render scenes in the z-buffer representation? (SEE figure at top of wiki article http://en.wikipedia.org/wiki/Depth_buffer ). Thanks, Andy |
Even a method/plug-in for capturing the depth buffer and writing this data to a file would be helpful...
|
You can use a render node to render the scene to a depth texture and display it on screen. Here is a quick example:
Code:
import viz |
This is great! Thanks!
|
Alright, one more question: Is there a way to size the quad so that is fits the exact dimensions of the window? I've tried, but I'm not sure how the 'size' parameter in viz.addTexQuad method translates into window coordinates.
I have tried inserting the following code into what you have written: # Get window size winsize = viz.MainWindow.getSize(viz.WINDOW_PIXELS) # Display depth texture on the screen quad = viz.addTexQuad(viz.SCREEN, size=1 ,align=viz.TEXT_CENTER_CENTER) quad.setPosition(.5,.5,0) quad.scale(winsize[0],winsize[1]) |
If you want to view it fullscreen, then you're better off implementing the shader as a post-process effect:
Code:
import viz |
All times are GMT -7. The time now is 06:46 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC