Blender Git Commit Log
Git Commits -> Revision 4213eca
Revision 4213eca by Benoit Bolsee (master) October 20, 2012, 22:28 (GMT) |
BGE VideoTexture: add depth buffer access to ImageViewport and ImageRender. 2 new attributes to ImageViewport and ImageRender object: depth: set to True to retrieve the depth buffer as an array of float (not suitable for texture source). zbuff: set to True to retrieve the depth buffer as a grey scale pixel array (suitable for texture source). A new mode 'F' is added to VideoTexture.imageToArray() to allow returning the image buffer as a one dimensional array of float. This mode should only be used to retrieve the depth buffer of ImageViewport and ImageRender objects. Example: viewport = VideoTexture.ImageViewport() viewport.depth = True depth = VideoTexture.imageToArray(viewport,'F') # show depth of bottom left pixel # 1.0 = infinite, 0.0 = on near clip plane. print(depth[0]) |
Commit Details:
Full Hash: 4213eca5fc3b5f2c2b23945e9462b38e13f843c4
SVN Revision: 51469
Parent Commit: 7deb8d8
Lines Changed: +204, -5
7 Modified Paths:
/doc/python_api/rst/bge.texture.rst (+22, -1) (Diff)
/source/gameengine/VideoTexture/FilterBase.h (+4, -0) (Diff)
/source/gameengine/VideoTexture/FilterSource.h (+59, -1) (Diff)
/source/gameengine/VideoTexture/ImageBase.cpp (+60, -0) (Diff)
/source/gameengine/VideoTexture/ImageBase.h (+21, -1) (Diff)
/source/gameengine/VideoTexture/ImageRender.cpp (+4, -0) (Diff)
/source/gameengine/VideoTexture/ImageViewport.cpp (+34, -2) (Diff)
/source/gameengine/VideoTexture/FilterBase.h (+4, -0) (Diff)
/source/gameengine/VideoTexture/FilterSource.h (+59, -1) (Diff)
/source/gameengine/VideoTexture/ImageBase.cpp (+60, -0) (Diff)
/source/gameengine/VideoTexture/ImageBase.h (+21, -1) (Diff)
/source/gameengine/VideoTexture/ImageRender.cpp (+4, -0) (Diff)
/source/gameengine/VideoTexture/ImageViewport.cpp (+34, -2) (Diff)