-
-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use built RenderList and RenderLists (#989)
* Add examples * Add Nodes * Update patch * Delete examples * Add RenderList and RenderLists
- Loading branch information
1 parent
e176d6d
commit e28b7a7
Showing
5 changed files
with
96 additions
and
0 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
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,62 @@ | ||
import { BufferGeometry, Camera, GeometryGroup, Light, Material, Object3D } from "three"; | ||
import { LightsNode } from "../../nodes/Nodes.js"; | ||
export interface Bundle { | ||
object: Object3D; | ||
camera: Camera; | ||
renderList: RenderList; | ||
} | ||
export interface RenderItem { | ||
id: number | null; | ||
object: Object3D | null; | ||
geometry: BufferGeometry | null; | ||
material: Material | null; | ||
groupOrder: number | null; | ||
renderOrder: number | null; | ||
z: number | null; | ||
group: GeometryGroup | null; | ||
} | ||
declare class RenderList { | ||
renderItems: RenderItem[]; | ||
renderItemsIndex: number; | ||
opaque: RenderItem[]; | ||
transparent: RenderItem[]; | ||
bundles: Bundle[]; | ||
lightsNode: LightsNode; | ||
lightsArray: Light[]; | ||
occlusionQueryCount: number; | ||
constructor(); | ||
begin(): this; | ||
getNextRenderItem( | ||
object: Object3D, | ||
geometry: BufferGeometry, | ||
material: Material, | ||
groupOrder: number, | ||
z: number, | ||
group: GeometryGroup | null, | ||
): RenderItem; | ||
push( | ||
object: Object3D, | ||
geometry: BufferGeometry, | ||
material: Material, | ||
groupOrder: number, | ||
z: number, | ||
group: GeometryGroup | null, | ||
): void; | ||
unshift( | ||
object: Object3D, | ||
geometry: BufferGeometry, | ||
material: Material, | ||
groupOrder: number, | ||
z: number, | ||
group: GeometryGroup | null, | ||
): void; | ||
pushBundle(group: Bundle): void; | ||
pushLight(light: Light): void; | ||
getLightsNode(): LightsNode; | ||
sort( | ||
customOpaqueSort: ((a: RenderItem, b: RenderItem) => number) | null, | ||
customTransparentSort: ((a: RenderItem, b: RenderItem) => number) | null, | ||
): void; | ||
finish(): void; | ||
} | ||
export default RenderList; |
10 changes: 10 additions & 0 deletions
10
types/three/examples/jsm/renderers/common/RenderLists.d.ts
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,10 @@ | ||
import { Camera, Object3D } from "three"; | ||
import ChainMap from "./ChainMap.js"; | ||
import RenderList from "./RenderList.js"; | ||
declare class RenderLists { | ||
lists: ChainMap<readonly [Object3D, Camera], RenderList>; | ||
constructor(); | ||
get(scene: Object3D, camera: Camera): RenderList; | ||
dispose(): void; | ||
} | ||
export default RenderLists; |