Skip to content

Refactor: PointLightShadowRenderer reduce object allocations #2514

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

capdevon
Copy link
Contributor

@capdevon capdevon commented Jun 23, 2025

This PR refactors the PointLightShadowRenderer class to improve readability and maintainability. Key changes include:

  • Replaces repeated inline vector negations (e.g., Vector3f.UNIT_X.mult(-1f)) with clearly named constants (X_NEG, Y_NEG, Z_NEG).
  • Updates camera axis assignments in updateShadowCams() to use these new constants, reducing code duplication and potential errors.
  • Minor improvements to JavaDoc for clarity and consistency.

These changes make the codebase cleaner and easier to understand without altering any functionality.

@richardTingle
Copy link
Member

richardTingle commented Jun 26, 2025

(Apart from the author change) looks good. Makes sense to avoid pointless negative vector allocations

@capdevon
Copy link
Contributor Author

capdevon commented Jul 11, 2025

Hi guys,
Could you tell me why there is an error in the Screenshot Test? I just restored the original name of the class author after a previous change that passed the test.

@riccardobl
Copy link
Member

Hi guys, Could you tell me why there is an error in the Screenshot Test? I just restored the original name of the class author after a previous change that passed the test.

looks like a timeout, sometime github action is a bit flaky, i've rerunned it

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.

3 participants