This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/doc/python_api/rst/bge.texture.rst
T
Benoit Bolsee 4213eca5fc 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])
2012-10-20 22:28:44 +00:00

12 KiB

Sphinx Warnings

Traceback (most recent call last):
  File "/var/lib/gitea/custom/sphinx/venv/bin/sphinx-build", line 5, in <module>
    from sphinx.cmd.build import main
ModuleNotFoundError: No module named 'sphinx'

Note the preview is not accurate and warnings may not indicate real issues.