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

PassReader updates for View Modes #3828

Merged
merged 4 commits into from
Jan 16, 2025
Merged

PassReader updates for View Modes #3828

merged 4 commits into from
Jan 16, 2025

Conversation

AlexandruPopovici
Copy link
Contributor

Description & motivation

This PR makes it possible to read the depth image data when in other view modes. The only view mode that does not support this is "Shaded" mode, aka BasitMode

Changes:

  • Implemented reading framebuffer contents for framebuffers with multiple attachements. The current version of three.js that we are using does not support this. Because we still need to drag along WebGL 1.0 support, only attachement 0 can be read for now, which does not bother us.
  • DepthNormalPass now specifies it's MRT output target as the outputTarget
  • PassReader's read function is now overloaded and it can take a pass name as a string or a GPass | GPass[]
  • Had to add a small type augmentation since the current version of types-three library does a poor job when it comes to WebGLMultipleRenderTargets
  • Updated PassReader extension in frontend and updated the call to read in order to make sure depth reading works in other view modes that write depth. The only view mode that does not draw to depth is Shaded mode

To-do before merge:

Screenshots:

Validation of changes:

Checklist:

  • My pull request follows the guidelines in the Contributing guide?
  • My pull request does not duplicate any other open Pull Requests for the same update/change?
  • My commits are related to the pull request and do not amend unrelated code or documentation.
  • My code follows a similar style to existing code.
  • I have added appropriate tests.
  • I have updated or added relevant documentation.

References

…rlying viewer library updates

Implemented reading framebuffer contents for framebuffers with multiple attachements. The current version of three.js that we are using does not support this. Because we still need to drag along WebGL 1.0 support, only attachement 0 can be read for now, which does not bother us.
DepthNormalPass now specifies it's MRT output target as the outputTarget
PassReader's read function is now overloaded and it can take a pass name as a string or a GPass | GPass[]
Had to add a small type augmentation since the current version of types-three library does a poor job when it comes to WebGLMultipleRenderTargets
Updated PassReader extension in frontend and updated the call to read in order to make sure depth reading works in other view modes that write depth. The only view mode that does not draw to depth is Shaded mode
Copy link

linear bot commented Jan 15, 2025

didimitrie
didimitrie previously approved these changes Jan 15, 2025
Copy link
Member

@didimitrie didimitrie left a comment

Choose a reason for hiding this comment

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

i fully understand everything and i approve

Copy link
Contributor

📸 Preview service has generated an image.

Copy link
Contributor

📸 Preview service has generated an image.

Copy link
Contributor

📸 Preview service has generated an image.

Copy link
Contributor

📸 Preview service has generated an image.

@AlexandruPopovici AlexandruPopovici merged commit b4deade into main Jan 16, 2025
42 of 44 checks passed
@AlexandruPopovici AlexandruPopovici deleted the alex/WEB-2467 branch January 16, 2025 11:59
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