-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Refactor: DirectionalLightShadowRenderer reduce object allocations #2513
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?
Refactor: DirectionalLightShadowRenderer reduce object allocations #2513
Conversation
| /** | ||
| * Creates a DirectionalLight shadow renderer. More info on the technique at <a | ||
| * href="https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch10.html">https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch10.html</a> | ||
| * Creates a DirectionalLight shadow renderer. This renderer implements the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove the link? Still seems to work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see, you've moved it to the top. Makes sense
jme3-core/src/main/java/com/jme3/shadow/DirectionalLightShadowRenderer.java
Show resolved
Hide resolved
riccardobl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this looks good to me.
I undid some formatting and documentation changes to keep this PR focused on the fix.
This PR refactors the
DirectionalLightShadowRendererclass to improve code clarity, efficiency, and shadow rendering quality:splits,splitsArray, and reusable vectors.finalfor reusable arrays and temporary vectors to reduce allocations.tempVecreusable vector.These changes do not modify functionality but make the codebase easier to maintain and extend, while also promoting efficient memory usage and clearer intent in shadow rendering logic.