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

Fix framebuffer texture capture with texStorage2D bug #292

Merged
merged 1 commit into from
Dec 20, 2023

Conversation

06wj
Copy link
Contributor

@06wj 06wj commented Dec 20, 2023

Bug

Test demo: https://06wj.github.io/test/spectorJSTest/
The picture below is the capture result.The framebuffer display a blank picture.
image

Solution

When using texStorage2D, there is no type value in the texture customData.
image

Because there is no type value in customData, textureType will be set to null, causing an error when readPixels is called, leading to a capture failure.
image

So a change has been made here. When there is no type, the framebuffer's attachmentComponentType is still used.
The picture below is the fixed capture result.
image

@sebavan
Copy link
Member

sebavan commented Dec 20, 2023

@06wj Thanks a lot !!! I had this a couple days back while debugging and it is deadly annoying !!!

@sebavan sebavan merged commit 77da612 into BabylonJS:master Dec 20, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants