-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Refactor: optimize ShadowUtility and reduce object allocations #2481
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
base: master
Are you sure you want to change the base?
Conversation
|
Too much review required for too little gain. |
|
🖼️ Screenshot tests have failed. The purpose of these tests is to ensure that changes introduced in this PR don't break visual features. They are visual unit tests. 📄 Where to find the report:
✅ If you did mean to change things: ✨ If you are creating entirely new tests: Note; it is very important that the committed reference images are created on the build pipeline, locally created images are not reliable. Similarly tests will fail locally but you can look at the report to check they are "visually similar". See https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-screenshot-tests/README.md for more information Contact @richardTingle (aka richtea) for guidance if required |
|
I took some time to review this carefully. It actually removes quite a lot of unnecessary allocations, so it's a pretty solid PR. However, it also included a fair amount of refactoring, so I reverted those changes to make the review easier and to avoid potential conflicts with other pending PRs. |
Refactor: Optimize Shadow Utility & Enhance Javadoc
This PR introduces significant improvements to the
ShadowUtilclass, focusing on performance optimization, code refinement, and comprehensive Javadoc documentation.Key changes include:
Vector3fand other temporary objects, especially within performance-critical loops in methods likeupdateFrustumPointsandcomputeBoundForPoints, by leveragingTempVars. This aims to reduce garbage collection overhead and improve runtime performance.OccludersExtractor: TheOccludersExtractorinner class has been enhanced for better clarity and self-containment. Its constructor now explicitly handles all necessary state, making it more robust and easier to use.OccludersExtractorclass. This improves code readability and maintainability for future development.These changes collectively make the
ShadowUtilclass more efficient, maintainable, and easier to understand for anyone working with shadow mapping in the engine, directly benefiting the performance ofLightShadowRendererandLightShadowFilter