@polygonjs/polygonjs
Version:
node-based WebGL 3D engine https://polygonjs.com
170 lines (169 loc) • 11.3 kB
TypeScript
/**
* Creates a Mesh Toon 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.
*
*/
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 { TypedBuilderMatNode } from './_BaseBuilder';
import { ShaderAssemblerToon } from '../gl/code/assemblers/materials/Toon';
import { AssemblerName } from '../../poly/registers/assemblers/_BaseRegister';
import { UniformFogControllers } from './utils/UniformsFogController';
import { WireframeShaderMaterialControllers } from './utils/WireframeShaderMaterialController';
import { TextureAOMapControllers } from './utils/TextureAOMapController';
import { TextureGradientMapControllers } from './utils/TextureGradientMapController';
import { TextureLightMapControllers } from './utils/TextureLightMapController';
import { TextureEmissiveMapControllers } from './utils/TextureEmissiveMapController';
import { TextureBumpMapControllers } from './utils/TextureBumpMapController';
import { TextureDisplacementMapControllers } from './utils/TextureDisplacementMapController';
import { TextureNormalMapControllers } from './utils/TextureNormalMapController';
import { PCSSControllers } from './utils/PCSSController';
import { CustomMaterialName, IUniforms } from '../../../core/geometry/Material';
import { Material, MeshToonMaterial } from 'three';
import { MatType } from '../../poly/registers/nodes/types/Mat';
interface MeshToonBuilderMaterial extends MeshToonMaterial {
vertexShader: string;
fragmentShader: string;
uniforms: IUniforms;
customMaterials: {
[key in CustomMaterialName]?: Material;
};
}
interface MeshToonBuilderControllers extends AdvancedCommonControllers, PCSSControllers, TextureAlphaMapControllers, TextureAOMapControllers, TextureBumpMapControllers, TextureDisplacementMapControllers, TextureEmissiveMapControllers, TextureGradientMapControllers, TextureLightMapControllers, TextureMapControllers, TextureNormalMapControllers, UniformFogControllers, UniformsTransparencyControllers, WireframeShaderMaterialControllers {
}
declare const MeshToonBuilderMatParamsConfig_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>;
};
} & {
new (...args: any[]): {
useFog: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
};
} & {
new (...args: any[]): {
wireframe: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
wireframeLinewidth: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.FLOAT>;
};
} & {
new (...args: any[]): {
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>;
};
} & {
new (...args: any[]): {
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[]): {
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[]): {
useGradientMap: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.BOOLEAN>;
gradientMap: import("../utils/params/ParamsConfig").ParamTemplate<import("../../index_all").ParamType.NODE_PATH>;
};
} & {
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 MeshToonBuilderMatParamsConfig extends MeshToonBuilderMatParamsConfig_base {
}
export declare class MeshToonBuilderMatNode extends TypedBuilderMatNode<MeshToonBuilderMaterial, ShaderAssemblerToon, MeshToonBuilderMatParamsConfig> {
paramsConfig: MeshToonBuilderMatParamsConfig;
static type(): MatType;
usedAssembler(): Readonly<AssemblerName.GL_MESH_TOON>;
protected _createAssemblerController(): import("../gl/code/Controller").GlAssemblerController<ShaderAssemblerToon> | undefined;
customMaterialRequested(customName: CustomMaterialName): boolean;
readonly controllers: MeshToonBuilderControllers;
protected controllersList: any[];
cook(): Promise<void>;
}
export {};