Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebGPURenderer: Introduce dispersion #974

Merged
merged 6 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
778 changes: 411 additions & 367 deletions examples-testing/changes.patch

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion three.js
Submodule three.js updated 114 files
1 change: 1 addition & 0 deletions types/three/examples/jsm/nodes/Nodes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ export {
materialClearcoatNormal,
materialClearcoatRoughness,
materialColor,
materialDispersion,
materialEmissive,
materialIridescence,
materialIridescenceIOR,
Expand Down
5 changes: 4 additions & 1 deletion types/three/examples/jsm/nodes/accessors/MaterialNode.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ export type MaterialNodeScope =
| typeof MaterialNode.LINE_GAP_SIZE
| typeof MaterialNode.LINE_WIDTH
| typeof MaterialNode.LINE_DASH_OFFSET
| typeof MaterialNode.POINT_WIDTH;
| typeof MaterialNode.POINT_WIDTH
| typeof MaterialNode.DISPERSION;

export default class MaterialNode extends Node {
static ALPHA_TEST: "alphaTest";
Expand Down Expand Up @@ -74,6 +75,7 @@ export default class MaterialNode extends Node {
static LINE_WIDTH: "linewidth";
static LINE_DASH_OFFSET: "dashOffset";
static POINT_WIDTH: "pointWidth";
static DISPERSION: "dispersion";

scope: MaterialNodeScope;
constructor(scope?: MaterialNodeScope);
Expand Down Expand Up @@ -115,4 +117,5 @@ export const materialLineGapSize: ShaderNodeObject<MaterialNode>;
export const materialLineWidth: ShaderNodeObject<MaterialNode>;
export const materialLineDashOffset: ShaderNodeObject<MaterialNode>;
export const materialPointWidth: ShaderNodeObject<MaterialNode>;
export const materialDispersion: ShaderNodeObject<MaterialNode>;
export const materialAnisotropyVector: ShaderNodeObject<UniformNode<Vector2>>;
1 change: 1 addition & 0 deletions types/three/examples/jsm/nodes/core/PropertyNode.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ export const transmission: ShaderNodeObject<PropertyNode>;
export const thickness: ShaderNodeObject<PropertyNode>;
export const attenuationDistance: ShaderNodeObject<PropertyNode>;
export const attenuationColor: ShaderNodeObject<PropertyNode>;
export const dispersion: ShaderNodeObject<PropertyNode>;
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export default class PhysicalLightingModel extends LightingModel {
iridescence: boolean;
anisotropy: boolean;
transmission: boolean;
dispersion: boolean;

clearcoatRadiance: Node | null;
clearcoatSpecularDirect: Node | null;
Expand All @@ -22,6 +23,7 @@ export default class PhysicalLightingModel extends LightingModel {
iridescence?: boolean,
anisotropy?: boolean,
transmission?: boolean,
dispersion?: boolean,
);

computeMultiscattering(singleScatter: Node, multiScatter: Node, specularF90: Node): void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export default class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial {
thicknessNode: ShaderNodeObject<Node> | null;
attenuationDistanceNode: ShaderNodeObject<Node> | null;
attenuationColorNode: ShaderNodeObject<Node> | null;
dispersionNode: ShaderNodeObject<Node> | null;

anisotropyNode: ShaderNodeObject<Node> | null;

Expand Down Expand Up @@ -78,4 +79,11 @@ export default class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial {
set transmission(value: number);

constructor(parameters?: MeshPhysicalNodeMaterialParameters);

get useClearcoat(): boolean;
get useIridescence(): boolean;
get useSheen(): boolean;
get useAnisotropy(): boolean;
get useTransmission(): boolean;
get useDispersion(): boolean;
}
Loading