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

[CSG]: Renderer overhaul & fixes #146

Merged
merged 227 commits into from
Aug 10, 2022

Conversation

Cloud7050
Copy link
Contributor

This fourth CSG PR focuses on the module's renderer and its related systems. It brings improvements (including to performance) while fixing some bugs.

The main changes include:

  • Overhauling the renderer as a stateful renderer class, in anticipation for multi-canvas support. Each renderer now has its own camera & controls state composed among/within other newly added systems
  • Properly managing and recovering from WebGL context loss. The renderer is able to start, pause, resume, and stop as needed. The user is informed elegantly while waiting for the browser to restore the context
  • Fixing simultaneous animation loops. Frame requests are now properly cancelled the moment the component unmounts
  • Boosting performance. Frames are only requested when the content expected to be depicted changes (essentially from user control input), or to put content back on a dead canvas. The JSCAD libraries have been updated which also brings some optimisations
  • Fixing pointer movements being ignored in certain situations
  • Tracking and removing various canvas listeners when appropriate
  • Handling reported linter problems, and cleaning up many ESLint, Prettier & TS comments throughout the repo given the merging of the updated linter config & other big PRs
  • Enhanced logging to track & detect problems with the renderer
  • Misc refactoring, code tidying & other smaller changes

image

Subsequent PRs are still planned. The next will likely be about the new Scenes system

LiuMC-SG and others added 30 commits January 24, 2022 19:34
Some testing for regl-renderer but no use. Render hooks on but no image is shown
…ix shiftKey build error, fix regl ts types, add dev comments
…) and change in error encountered, issue with module tab lies elsewhere
…defined potentialShape from destructuring, misc refactoring
…t old renderer & abstract jscad functions, tidy & trim down typings
…ker, frame performance savings, code improvements, misc fixes
Copy link
Contributor

@Anonymxtrix Anonymxtrix left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks a lot for helping to fix the problems :)

@martin-henz martin-henz merged commit 46c7513 into source-academy:master Aug 10, 2022
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.

4 participants