-
-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Addons: WebGPU CSM shadows - using shadowNode (#1362)
* Addons: WebGPU CSM shadows - using shadowNode * Update three.js * Add examples * Update patch and delete examples * Updates * Add examples * Updates * Update patch and delete examples
- Loading branch information
1 parent
bf87ddd
commit e74cbc9
Showing
5 changed files
with
132 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule three.js
updated
8 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { Camera, DirectionalLightShadow, Light, Object3D } from "three"; | ||
import { Node } from "three/tsl"; | ||
import { CSMFrustum } from "./CSMFrustum.js"; | ||
|
||
export type CSMShadowNodeMode = "uniform" | "logarithmic" | "practical" | "custom"; | ||
|
||
export interface CSMShadowNodeData { | ||
cascades?: number | undefined; | ||
maxFar?: number | undefined; | ||
mode?: CSMShadowNodeMode | undefined; | ||
lightMargin?: number | undefined; | ||
customSplitsCallback?: | ||
| ((cascades: number, cameraNear: number, cameraFar: number, breaks: number[]) => void) | ||
| undefined; | ||
} | ||
|
||
declare class LwLight extends Object3D { | ||
target: Object3D; | ||
shadow?: DirectionalLightShadow; | ||
|
||
constructor(); | ||
} | ||
|
||
declare class CSMShadowNode extends Node { | ||
light: Light; | ||
camera: Camera | null; | ||
cascades: number; | ||
maxFar: number; | ||
mode: CSMShadowNodeMode; | ||
lightMargin: number; | ||
customSplitsCallback: (cascades: number, cameraNear: number, cameraFar: number, breaks: number[]) => void; | ||
|
||
fade: boolean; | ||
|
||
breaks: number[]; | ||
mainFrustum: CSMFrustum | null; | ||
frustums: CSMFrustum[]; | ||
|
||
lights: LwLight[]; | ||
|
||
constructor(light: Light, data?: CSMShadowNodeData); | ||
|
||
updateFrustums(): void; | ||
} | ||
|
||
export { CSMShadowNode }; |