Skip to content

Conversation

capdevon
Copy link
Contributor

@capdevon capdevon commented Jun 7, 2025

Refactor: Optimize Shadow Utility & Enhance Javadoc

This PR introduces significant improvements to the ShadowUtil class, focusing on performance optimization, code refinement, and comprehensive Javadoc documentation.

Key changes include:

  • Reduced Object Allocations: Minimized the creation of new Vector3f and other temporary objects, especially within performance-critical loops in methods like updateFrustumPoints and computeBoundForPoints, by leveraging TempVars. This aims to reduce garbage collection overhead and improve runtime performance.
  • Refined OccludersExtractor: The OccludersExtractor inner 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.
  • Comprehensive Javadoc: Added detailed Javadoc comments to all public methods, private helper methods, and the OccludersExtractor class. This improves code readability and maintainability for future development.
  • Minor Code Clean-up: Removed commented-out code and applied minor formatting adjustments for better consistency.

These changes collectively make the ShadowUtil class more efficient, maintainable, and easier to understand for anyone working with shadow mapping in the engine, directly benefiting the performance of LightShadowRenderer and LightShadowFilter

@capdevon capdevon changed the title Refactor: Optimize Shadow Utility Refactor: Optimize Shadow Utility and reduce object allocations Jun 7, 2025
@yaRnMcDonuts yaRnMcDonuts added this to the v3.9.0 milestone Jun 8, 2025
@capdevon capdevon changed the title Refactor: Optimize Shadow Utility and reduce object allocations Refactor: optimize ShadowUtility and reduce object allocations Jun 13, 2025
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.

2 participants