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

[Breaking] Quad render class, drawQuadWithShader refactor, Camera render events moved. #4988

Merged
merged 2 commits into from
Jan 19, 2023

Conversation

mvaligursky
Copy link
Contributor

@mvaligursky mvaligursky commented Jan 18, 2023

Breaking change

  • camera.onPreRender and onPostRender used to be called inside the render pass (during rendering to camera's render target), but that would not allow another render pass to execute within those callbacks. The callbacks were moved to execute just before and right after the render pass, allowing use of different render targets. Internally, only cubemap-renderer is affected, as used in RenderCubemap example - it does cubemap postprocessing inside the onPostRender callback.

Other changes

  • new class, QuadRender - renders a quad using the Shader, supports uniform buffers, and does not handle RenderPass set up. Existing drawQuadWithShader now uses it internally. Being able to render multiple quads within a single render pass will speed up WebGL rendering on tiled architecture, allowing some systems to render those inside a single render pass, instead of multiple. For example cookie texture rendering for clustered, and texture based morphing with many targets.
  • GraphicsDevice now owns a copy of quad vertex buffer. We don't create one for drawQuadWithShader, nor one for each post-processing effect instance.
  • RenderPass now has a before function, allowing things to execute before the pass (in addition to existing after)
  • WebGlGraphicsDevice has a simple copy of quadWithShader for its internal purposes, as drawQuadWithShader has moved out of graphics to a scene level, to work with shader processing / shader library, and its not a core graphics functionality as well.
  • fix to MorphInstance to not update normal render target if normals are not allocated (newly added Assert triggered for this issue)
  • extracted processShader function from material, to be able to use it for other shader processing (QuadRender)

@mvaligursky mvaligursky self-assigned this Jan 18, 2023
@mvaligursky mvaligursky added the area: graphics Graphics related issue label Jan 18, 2023
@mvaligursky mvaligursky merged commit 30c18d4 into main Jan 19, 2023
@mvaligursky mvaligursky deleted the mv-quad-render branch January 19, 2023 16:35
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.

3 participants