Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gui] [vulkan] Surpport for getting depth information for python users. #5410

Merged
merged 8 commits into from
Jul 14, 2022

Conversation

Morcki
Copy link
Member

@Morcki Morcki commented Jul 13, 2022

Usage:

window = ti.ui.Window("Test for getting depth buffer from ggui", (768, 768), vsync=True)
video = ti.tools.VideoManager("OutputDir")

while window.running:
    render_scene()
    # Here depth is a numpy array with shape equals (768, 768)
    depth = window.get_depth_buffer_as_numpy()
    video.write_frame(depth)
    window.show()

@netlify
Copy link

netlify bot commented Jul 13, 2022

Deploy Preview for docsite-preview ready!

Name Link
🔨 Latest commit 61f1308
🔍 Latest deploy log https://app.netlify.com/sites/docsite-preview/deploys/62cebb8559875f0009a4b01d
😎 Deploy Preview https://deploy-preview-5410--docsite-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@taichi-gardener taichi-gardener added this to In progress in GGUI Jul 13, 2022
Copy link
Member

@YuCrazing YuCrazing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@PENGUINLIONG
Copy link
Member

I wonder if it's possible to render world depth directly to the alpha channel?

@Morcki
Copy link
Member Author

Morcki commented Jul 13, 2022

#5410 (comment)

Usually, the depth bit depth is 24 bit or 32 bit. If stored to the alpha channel(8-bit generally), the precise of depth information may not enough for rendering and there will be potential visual bugs especially for complicate scene. (such as shadowing, occlusion information between objects).

@YuCrazing YuCrazing merged commit d4f4abf into taichi-dev:master Jul 14, 2022
GGUI automation moved this from In progress to Done Jul 14, 2022
@Morcki Morcki deleted the taichi-ggui_mesh_instancing branch July 26, 2022 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
GGUI
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants