-
-
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.
LightingModel: New class struct (#758)
- Loading branch information
1 parent
bf36f1d
commit bb4c8d3
Showing
7 changed files
with
95 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import Node from './Node.js'; | ||
import NodeBuilder from './NodeBuilder.js'; | ||
import StackNode from './StackNode.js'; | ||
|
||
export interface LightingModelReflectedLight { | ||
directDiffuse: Node; | ||
directSpecular: Node; | ||
indirectDiffuse: Node; | ||
indirectSpecular: Node; | ||
} | ||
|
||
export interface LightingModelDirectInput { | ||
lightDirection: Node; | ||
lightColor: Node; | ||
reflectedLight: LightingModelReflectedLight; | ||
} | ||
|
||
export interface LightingModelIndirectInput { | ||
radiance: Node; | ||
irradiance: Node; | ||
iblIrradiance: Node; | ||
ambientOcclusion: Node; | ||
reflectedLight: LightingModelReflectedLight; | ||
backdrop: Node; | ||
backdropAlpha: Node; | ||
outgoingLight: Node; | ||
} | ||
|
||
export default class LightingModel { | ||
start(input: LightingModelIndirectInput, stack: StackNode, builder: NodeBuilder): void; | ||
finish(input: LightingModelIndirectInput, stack: StackNode, builder: NodeBuilder): void; | ||
direct(input: LightingModelDirectInput, stack: StackNode, builder: NodeBuilder): void; | ||
indirectDiffuse(input: LightingModelIndirectInput, stack: StackNode, builder: NodeBuilder): void; | ||
indirectSpecular(input: LightingModelIndirectInput, stack: StackNode, builder: NodeBuilder): void; | ||
ambientOcclusion(input: LightingModelIndirectInput, stack: StackNode, builder: NodeBuilder): void; | ||
} |
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
7 changes: 7 additions & 0 deletions
7
types/three/examples/jsm/nodes/functions/PhongLightingModel.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,7 @@ | ||
import LightingModel from '../core/LightingModel.js'; | ||
|
||
export default class PhongLightingModel extends LightingModel { | ||
specular: boolean; | ||
|
||
constructor(specular?: boolean); | ||
} |
25 changes: 17 additions & 8 deletions
25
types/three/examples/jsm/nodes/functions/PhysicalLightingModel.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 |
---|---|---|
@@ -1,11 +1,20 @@ | ||
import { ShaderNode } from '../shadernode/ShaderNode.js'; | ||
import LightingModel from '../core/LightingModel.js'; | ||
import Node from '../core/Node.js'; | ||
|
||
declare const PhysicalLightingModel: { | ||
direct: ShaderNode<{ lightDirection: Node; lightColor: Node; reflectedLight: Node }>; | ||
indirectDiffuse: ShaderNode<{ irradiance: Node; reflectedLight: Node }>; | ||
indirectSpecular: ShaderNode<{ radiance: Node; iblIrradiance: Node; reflectedLight: Node }>; | ||
ambientOcclusion: ShaderNode<{ ambientOcclusion: Node; reflectedLight: Node }>; | ||
}; | ||
export default class PhysicalLightingModel extends LightingModel { | ||
clearcoat: boolean; | ||
sheen: boolean; | ||
iridescence: boolean; | ||
|
||
export default PhysicalLightingModel; | ||
clearcoatRadiance: Node | null; | ||
clearcoatSpecularDirect: Node | null; | ||
clearcoatSpecularIndirect: Node | null; | ||
sheenSpecularDirect: Node | null; | ||
sheenSpecularIndirect: Node | null; | ||
iridescenceFresnel: Node | null; | ||
iridescenceF0: Node | null; | ||
|
||
constructor(clearcoat?: boolean, sheen?: boolean, iridescence?: boolean); | ||
|
||
computeMultiscattering(singleScatter: Node, multiScatter: Node, specularF90?: Node): void; | ||
} |
27 changes: 14 additions & 13 deletions
27
types/three/examples/jsm/nodes/lighting/LightingContextNode.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
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