@polygonjs/polygonjs
Version:
node-based WebGL 3D engine https://polygonjs.com
209 lines (208 loc) • 16.6 kB
TypeScript
/**
* Creates a Mesh Physical Material, which can be extended with GL nodes.
*
* @remarks
* This node can create children, which will be GL nodes. The GLSL code generated by the nodes will extend the Material.
*
* Note that when overriding some properties like metalness and roughness from the output node, the values will be mutliplied with the material top level parameters. You may therefore want to set those to 1 to have predictable results.
*
*/
import { NodeParamsConfig } from '../utils/params/ParamsConfig';
import { UniformsTransparencyControllers } from './utils/UniformsTransparencyController';
import { AdvancedCommonControllers } from './utils/AdvancedCommonController';
import { TextureMapControllers } from './utils/TextureMapController';
import { TextureAlphaMapControllers } from './utils/TextureAlphaMapController';
import { TextureBumpMapControllers } from './utils/TextureBumpMapController';
import { TextureEmissiveMapControllers } from './utils/TextureEmissiveMapController';
import { TextureEnvMapControllers } from './utils/TextureEnvMapController';
import { TextureAOMapControllers } from './utils/TextureAOMapController';
import { TextureNormalMapControllers } from './utils/TextureNormalMapController';
import { TextureMetalnessRoughnessMapControllers } from './utils/TextureMetalnessRoughnessMapController';
import { TextureLightMapControllers } from './utils/TextureLightMapController';
import { MeshPhysicalControllers } from './utils/MeshPhysicalController';
import { TextureDisplacementMapControllers } from './utils/TextureDisplacementMapController';
import { TypedBuilderMatNode } from './_BaseBuilder';
import { ShaderAssemblerPhysical } from '../gl/code/assemblers/materials/Physical';
import { AssemblerName } from '../../poly/registers/assemblers/_BaseRegister';
import { UniformFogControllers } from './utils/UniformsFogController';
import { WireframeShaderMaterialControllers } from './utils/WireframeShaderMaterialController';
import { PCSSControllers } from './utils/PCSSController';
import { Material } from 'three';
import { MeshPhysicalMaterial } from 'three';
import { CustomMaterialName, IUniforms } from '../../../core/geometry/Material';
import { MatType } from '../../poly/registers/nodes/types/Mat';
interface MeshPhysicalBuilderMaterial extends MeshPhysicalMaterial {
vertexShader: string;
fragmentShader: string;
uniforms: IUniforms;
customMaterials: {
[key in CustomMaterialName]?: Material;
};
}
interface MeshPhysicalBuilderControllers extends AdvancedCommonControllers, PCSSControllers, TextureAlphaMapControllers, TextureAOMapControllers, TextureBumpMapControllers, TextureDisplacementMapControllers, TextureEmissiveMapControllers, TextureEnvMapControllers, TextureLightMapControllers, TextureMapControllers, TextureMetalnessRoughnessMapControllers, TextureNormalMapControllers, MeshPhysicalControllers, UniformFogControllers, UniformsTransparencyControllers, WireframeShaderMaterialControllers {
}
declare const MeshPhysicalBuilderMatParamsConfig_base: {
new (...args: any[]): {
overrideCustomMaterials: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
createCustomMatDistance: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
createCustomMatDepth: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
createCustomMatDepthDOF: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
};
} & {
new (...args: any[]): {
shadowPCSS: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
shadowPCSSFilterSize: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.FLOAT>;
useFog: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
wireframe: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
wireframeLinewidth: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.FLOAT>;
doubleSided: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
front: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
overrideShadowSide: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
shadowDoubleSided: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
shadowFront: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
colorWrite: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
depthWrite: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
depthTest: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
premultipliedAlpha: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
blending: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.INTEGER>;
dithering: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
polygonOffset: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
polygonOffsetFactor: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.INTEGER>;
polygonOffsetUnits: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.INTEGER>;
setBuilderNode: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
builderNode: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.NODE_PATH>;
};
} & {
new (...args: any[]): {
advanced: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.FOLDER>;
};
} & {
new (...args: any[]): {
clearcoat: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.FLOAT>;
useClearCoatMap: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
clearcoatMap: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.NODE_PATH>;
useClearCoatNormalMap: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
clearcoatNormalMap: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.NODE_PATH>;
clearcoatNormalScale: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.VECTOR2>;
clearcoatRoughness: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.FLOAT>;
useClearCoatRoughnessMap: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
clearcoatRoughnessMap: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.NODE_PATH>;
useSheen: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
sheen: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.FLOAT>;
sheenRoughness: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.FLOAT>;
sheenColor: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.COLOR>;
useIridescence: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
iridescence: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.FLOAT>;
iridescenceIOR: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.FLOAT>;
iridescenceThicknessRange: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.VECTOR2>;
useIridescenceMap: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
iridescenceMap: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.NODE_PATH>;
useIridescenceThicknessMap: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
iridescenceThicknessMap: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.NODE_PATH>;
transmission: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.FLOAT>;
useTransmissionMap: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
transmissionMap: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.NODE_PATH>;
ior: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.FLOAT>;
thickness: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.FLOAT>;
useThicknessMap: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
thicknessMap: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.NODE_PATH>;
attenuationDistance: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.FLOAT>;
attenuationColor: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.COLOR>;
dispersion: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.FLOAT>;
};
} & {
new (...args: any[]): {
useMetalnessMap: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
metalnessMap: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.NODE_PATH>;
metalness: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.FLOAT>;
useRoughnessMap: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
roughnessMap: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.NODE_PATH>;
roughness: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.FLOAT>;
};
} & {
new (...args: any[]): {
useNormalMap: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
normalMap: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.NODE_PATH>;
normalMapType: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.INTEGER>;
normalScale: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.VECTOR2>;
normalScaleMult: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.FLOAT>;
};
} & {
new (...args: any[]): {
useLightMap: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
lightMap: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.NODE_PATH>;
lightMapIntensity: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.FLOAT>;
};
} & {
new (...args: any[]): {
useEnvMap: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
envMap: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.NODE_PATH>;
envMapIntensity: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.FLOAT>;
envMapRotation: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.VECTOR3>;
};
} & {
new (...args: any[]): {
emissive: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.COLOR>;
useEmissiveMap: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
emissiveMap: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.NODE_PATH>;
emissiveIntensity: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.FLOAT>;
};
} & {
new (...args: any[]): {
useDisplacementMap: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
displacementMap: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.NODE_PATH>;
displacementScale: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.FLOAT>;
displacementBias: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.FLOAT>;
};
} & {
new (...args: any[]): {
useBumpMap: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
bumpMap: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.NODE_PATH>;
bumpScale: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.FLOAT>;
bumpBias: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.FLOAT>;
};
} & {
new (...args: any[]): {
useAOMap: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
aoMap: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.NODE_PATH>;
aoMapIntensity: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.FLOAT>;
};
} & {
new (...args: any[]): {
useAlphaMap: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
alphaMap: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.NODE_PATH>;
};
} & {
new (...args: any[]): {
useMap: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
map: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.NODE_PATH>;
};
} & {
new (...args: any[]): {
textures: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.FOLDER>;
};
} & {
new (...args: any[]): {
transparent: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
opacity: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.FLOAT>;
alphaTest: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.FLOAT>;
};
} & {
new (...args: any[]): {
default: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.FOLDER>;
};
} & typeof NodeParamsConfig;
declare class MeshPhysicalBuilderMatParamsConfig extends MeshPhysicalBuilderMatParamsConfig_base {
}
export declare class MeshPhysicalBuilderMatNode extends TypedBuilderMatNode<MeshPhysicalBuilderMaterial, ShaderAssemblerPhysical, MeshPhysicalBuilderMatParamsConfig> {
paramsConfig: MeshPhysicalBuilderMatParamsConfig;
static type(): MatType;
usedAssembler(): Readonly<AssemblerName.GL_MESH_PHYSICAL>;
protected _createAssemblerController(): import("../gl/code/Controller").GlAssemblerController<ShaderAssemblerPhysical> | undefined;
customMaterialRequested(customName: CustomMaterialName): boolean;
readonly controllers: MeshPhysicalBuilderControllers;
protected controllersList: any[];
createMaterial(): MeshPhysicalBuilderMaterial;
cook(): Promise<void>;
}
export {};