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

Fallback Webgl1 solution for depth grab is replaced by a RenderPassDepth #5671

Merged
merged 2 commits into from
Sep 25, 2023

Conversation

mvaligursky
Copy link
Contributor

@mvaligursky mvaligursky commented Sep 25, 2023

For WebGL1, we no longer use a custom Depth layer with render target and some manual handling of visible mesh instances under the hood, but have a render pass that is scheduled to run before the camera's render pass to render the depth.

  • The main camera's render pass is no longer split into two, saving performance
  • This removes last warning of this type inside the engine: DEPRECATED: pc.Layer#renderTarget
  • new RenderPassDepth will be extended in the future to provide depth rendering before the camera for other effects, such as Screen space ambient occlusion should only affect indirect light #4844

New public API:

GraphicsDevice.isWebGL1
GraphicsDevice.isWebGL2

to match existing

GraphicsDevice.isWebGPU

@mvaligursky mvaligursky self-assigned this Sep 25, 2023
@mvaligursky mvaligursky added the area: graphics Graphics related issue label Sep 25, 2023
Comment on lines 387 to +389
this.webgl2 = typeof WebGL2RenderingContext !== 'undefined' && gl instanceof WebGL2RenderingContext;
this.isWebGl2 = this.webgl2;
this.isWebGl1 = !this.webgl2;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should webgl2 be moved to deprecated.js?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, I will do in a separate PR as it will have many changes.

Co-authored-by: Will Eastcott <will@playcanvas.com>
@mvaligursky mvaligursky merged commit fd2c376 into main Sep 25, 2023
@mvaligursky mvaligursky deleted the mv-grabpass-webgl1 branch September 25, 2023 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: graphics Graphics related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants