refactor(skylighting): simplify skylightingSH initialization#2139
Conversation
📝 WalkthroughWalkthroughThe grass pixel shader's skylighting spherical-harmonics workflow is simplified by eliminating pre-initialized compile-time basis constants and directly initializing the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
No actionable suggestions for changed features. |
|
✅ A pre-release build is available for this PR: |
…ty-shaders#2139) (cherry picked from commit 03e2014)
This pull request refactors how the
skylightingSHvariable is initialized and used in theRunGrass.hlslshader. The main improvement is to only declare and assignskylightingSHwhen skylighting is actually sampled, simplifying the code and reducing unnecessary variable declarations.Shader logic simplification:
skylightingSH(unitSH_grass1andunitSH_grass2) and now declares and assignsskylightingSHonly when skylighting is sampled, making the code cleaner and reducing unnecessary assignments. (package/Shaders/RunGrass.hlsl, [1] [2]Summary by CodeRabbit
Bug Fixes
Refactor