Closed GuoLei1990 closed 2 months ago
The changes introduce a new public property shadowNearPlaneOffset
to the DirectLight
class, replacing the deprecated shadowNearPlane
in the Light
class. Several private getter methods for shadow projection matrices have been removed across multiple light classes, indicating a shift in shadow handling. Additionally, the CascadedShadowCasterPass
class has been updated to utilize the new shadowNearPlaneOffset
parameter. Import statements have been adjusted to remove unused dependencies, streamlining the codebase.
File Path | Change Summary |
---|---|
packages/core/src/lighting/DirectLight.ts |
Added property shadowNearPlaneOffset ; removed method _shadowProjectionMatrix . |
packages/core/src/lighting/Light.ts |
Marked shadowNearPlane as deprecated; removed abstract getter _shadowProjectionMatrix . |
packages/core/src/lighting/PointLight.ts |
Removed private getter _shadowProjectionMatrix . |
packages/core/src/lighting/SpotLight.ts |
Removed private getter _shadowProjectionMatrix . |
packages/core/src/shadow/CascadedShadowCasterPass.ts |
Updated parameter from light.shadowNearPlane to light.shadowNearPlaneOffset . |
sequenceDiagram
participant User
participant DirectLight
participant Light
participant CascadedShadowCasterPass
User->>DirectLight: Create instance
DirectLight->>DirectLight: Initialize shadowNearPlaneOffset
User->>Light: Access shadow properties
Light->>Light: Return deprecated shadowNearPlane
User->>CascadedShadowCasterPass: Call shadow casting function
CascadedShadowCasterPass->>DirectLight: Use shadowNearPlaneOffset
🐇 In the meadow, shadows play,
A new offset leads the way.
Light shines bright, artifacts flee,
Hopping forward, wild and free!
With each change, we dance and cheer,
A brighter world is drawing near! 🌟
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Please check if the PR fulfills these requirements
Summary by CodeRabbit
New Features
shadowNearPlaneOffset
, to enhance shadow generation and reduce artifacts in low polygon models.Deprecations
shadowNearPlane
property as deprecated, advising users to transition toshadowNearPlaneOffset
.Bug Fixes
These changes aim to enhance the lighting and shadow rendering capabilities within the application.