import * as THREE from 'three'; import { Component, ConstructorProps, ContextManager, Observable } from '@zcomponent/core'; /** * A base class for all materials. */ export declare class Material extends Component { element: THREE.Material; private _bindingsByInstance; /** * Constructs a new material. * @param contextManager - Context manager. * @param props - Properties. * @param element - The material. */ constructor(contextManager: ContextManager, props: ConstructorProps, element: THREE.Material); private _attach; /** * Disposes the material and releases all resources. */ dispose(): never; /** * The name of a material in the parent node for this node to attach to. Use this if you're overriding a named material in a GLTF component, for example. * * @zprop * @zgroup Material * @zgrouppriority 10 * @zvalues parentmaterials * @zdefault */ attachTo: Observable; /** * Sets the alpha value to be used when running an alpha test. * The material will not be rendered if the opacity is lower than this value. Default is 0. * @zprop * @zgroup Material * @zgrouppriority 10 * @ztype proportion * @zdefault 0 */ alphaTest: Observable; /** * * Enables alpha to coverage. * Can only be used with MSAA-enabled contexts (meaning when the renderer was created with antialias parameter set to true). Default is false. * @zprop * @zgroup Material Advanced * @zgrouppriority 5 * @zdefault false */ alphaToCoverage: Observable; /** * Blending destination. * The material's blending must be set to CustomBlending for this to have any effect. * @zprop * @zgroup Material Advanced * @zgrouppriority 5 * @zdefault NormalBlending */ blending: Observable; /** * Blending destination. * The material's blending must be set to CustomBlending for this to have any effect. * @zprop * @zgroup Custom Blending * @zgrouppriority 4 * @zdefault OneMinusSrcAlphaFactor */ blendDst: Observable; /** * The transparency of the .blendDst. Uses .blendDst value if null. * @zprop * @zgroup Custom Blending * @zgrouppriority 4 * @zdefault null */ blendDstAlpha: Observable; /** * Blending Source. * The material's blending must be set to `CustomBlending` for this to have any effect. * * @zprop * @zgroup Custom Blending * @zgrouppriority 4 * @zdefault SrcAlphaFactor */ blendSrc: Observable; /** * The transparency of the .blendSrc. Uses .blendSrc value if null. Default is null. * @zprop * @zgroup Custom Blending * @zgrouppriority 4 * @zdefault null */ blendSrcAlpha: Observable; /** * Blending equation to use when applying blending. Default is AddEquation. * * The material's blending must be set to CustomBlending for this to have any effect. * @zprop * @zgroup Custom Blending * @zgrouppriority 4 * @zdefault AddEquation */ blendEquation: Observable; /** * The transparency of the .blendEquation. * * Uses .blendEquation value if null. Default is null. * @zprop * @zgroup Custom Blending * @zgrouppriority 4 * @zdefault null */ blendEquationAlpha: Observable; /** * Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union. * @zprop * @zgroup Material Advanced * @zgrouppriority 5 * @zdefault false */ clipIntersection: Observable; /** * Defines whether to clip shadows according to the clipping planes specified on this material. * @zprop * @zgroup Material Advanced * @zgrouppriority 5 * @zdefault false */ clipShadows: Observable; /** * Whether to render the material's color. * * This can be used in conjunction with a mesh's renderOrder property to create invisible objects that occlude other objects. * @zprop * @zgroup Material * @zgrouppriority 10 * @zdefault true */ colorWrite: Observable; /** * * Whether to have depth test enabled when rendering this material. * * When the depth test is disabled, the depth write will also be implicitly disabled. * @zprop * @zgroup Material * @zgrouppriority 10 * @zdefault true */ depthTest: Observable; /** * * Whether rendering this material has any effect on the depth buffer. * * When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts. * @zprop * @zgroup Material * @zgrouppriority 10 * @zdefault true */ depthWrite: Observable; /** * Which depth function to use. * * @zprop * @zgroup Material * @zgrouppriority 10 * @zdefault LessEqualDepth */ depthFunc: Observable; /** * Whether stencil operations are performed against the stencil buffer. * * In order to perform writes or comparisons against the stencil buffer this value must be true. * @zprop * @zgroup Material Advanced * @zgrouppriority 5 * @zdefault false */ stencilWrite: Observable; /** * The bit mask to use when writing to the stencil buffer. * @zprop * @zgroup Material Advanced * @zgrouppriority 5 * @zdefault 0xFF */ stencilWriteMask: Observable; /** * Float in the range of 0.0 - 1.0 indicating how transparent the material is. * * A value of 0.0 indicates fully transparent, 1.0 is fully opaque. * If the material's transparent property is not set to true, the material will remain fully opaque and this value will only affect its color. * @zprop * @zgroup Material * @zgrouppriority 10 * @ztype proportion * @zdefault 1 */ opacity: Observable; /** * Whether to use polygon offset. * * This corresponds to the `GL_POLYGON_OFFSET_FILL` WebGL feature. * @zprop * @zgroup Material Advanced * @zgrouppriority 5 * @zdefault false */ polygonOffset: Observable; /** * Sets the polygon offset factor. * @zprop * @zgroup Material Advanced * @zgrouppriority 5 * @zdefault 0 */ polygonOffsetFactor: Observable; /** * Sets the polygon offset units * @zprop * @zgroup Material Advanced * @zgrouppriority 5 * @zdefault 0 */ polygonOffsetUnits: Observable; /** * Whether to premultiply the alpha (transparency) value. * @zprop * @zgroup Material Advanced * @zgrouppriority 5 * @zdefault false */ premultipliedAlpha: Observable; /** * Whether to apply dithering to the color to remove the appearance of banding. * @zprop * @zgroup Material Advanced * @zgrouppriority 5 * @zdefault false */ dithering: Observable; /** * Defines whether this material is tone mapped according to the renderer's toneMapping setting. * @zprop * @zgroup Material Advanced * @zgrouppriority 5 * @zdefault true */ toneMapped: Observable; /** * * Defines whether this material is transparent. * * This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. * When set to true, the extent to which the material is transparent is controlled by setting its opacity property. * @zprop * @zgroup Material * @zgrouppriority 10 * @zdefault false */ transparent: Observable; /** * * Defines whether vertex coloring is used. * * The engine supports RGB and RGBA vertex colors depending on whether a three (RGB) or four (RGBA) component color buffer attribute is used. * @zprop * @zgroup Material Advanced * @zgrouppriority 5 * @zdefault false */ vertexColors: Observable; /** * Defines whether this material is visible. * @zprop * @zgroup Material * @zgrouppriority 10 * @zdefault true */ visible: Observable; /** * Defines which side of faces will be rendered - front, back or both. * @zprop * @zgroup Material * @zgrouppriority 10 * @zdefault FrontSide */ side: Observable; /** * Defines which side of faces cast shadows. * @zprop * @zgroup Material Advanced * @zgrouppriority 5 * @zdefault null */ shadowSide: Observable; } /** * Blending types. */ export declare enum Blending { /** * No blending. */ NoBlending = "NoBlending", /** * Normal blending. */ NormalBlending = "NormalBlending", /** * Additive blending. */ AdditiveBlending = "AdditiveBlending", /** * Subtractive blending. */ SubtractiveBlending = "SubtractiveBlending", /** * Multiply blending. */ MultiplyBlending = "MultiplyBlending", /** * Custom blending. */ CustomBlending = "CustomBlending" } export declare function translateBlending(blending: Blending): THREE.Blending; /** * Enum for blending destination factors in graphics rendering. * Provides options for how the destination color is factored into blending equation. */ export declare enum BlendingDstFactor { ZeroFactor = "ZeroFactor", OneFactor = "OneFactor", SrcColorFactor = "SrcColorFactor", OneMinusSrcColorFactor = "OneMinusSrcColorFactor", SrcAlphaFactor = "SrcAlphaFactor", OneMinusSrcAlphaFactor = "OneMinusSrcAlphaFactor", DstAlphaFactor = "DstAlphaFactor", OneMinusDstAlphaFactor = "OneMinusDstAlphaFactor", DstColorFactor = "DstColorFactor", OneMinusDstColorFactor = "OneMinusDstColorFactor" } /** * Enum for blending source factors in graphics rendering. * Defines various methods for how the source color is factored into the blending equation. */ export declare enum BlendingSrcFactor { ZeroFactor = "ZeroFactor", OneFactor = "OneFactor", SrcColorFactor = "SrcColorFactor", OneMinusSrcColorFactor = "OneMinusSrcColorFactor", SrcAlphaFactor = "SrcAlphaFactor", OneMinusSrcAlphaFactor = "OneMinusSrcAlphaFactor", DstAlphaFactor = "DstAlphaFactor", OneMinusDstAlphaFactor = "OneMinusDstAlphaFactor", DstColorFactor = "DstColorFactor", OneMinusDstColorFactor = "OneMinusDstColorFactor", SrcAlphaSaturateFactor = "SrcAlphaSaturateFactor" } /** * Enum for defining blending equations in graphics rendering. * Specifies mathematical operations used to combine source and destination colors. */ export declare enum BlendingEquation { AddEquation = "AddEquation", SubtractEquation = "SubtractEquation", ReverseSubtractEquation = "ReverseSubtractEquation", MinEquation = "MinEquation", MaxEquation = "MaxEquation" } /** * Enum for depth testing modes in 3D graphics rendering. * Defines conditions under which a pixel will be drawn, based on its depth value. */ export declare enum DepthMode { NeverDepth = "NeverDepth", AlwaysDepth = "AlwaysDepth", LessDepth = "LessDepth", LessEqualDepth = "LessEqualDepth", EqualDepth = "EqualDepth", GreaterEqualDepth = "GreaterEqualDepth", GreaterDepth = "GreaterDepth", NotEqualDepth = "NotEqualDepth" } /** * Specifies which of the face sides will be rendered. */ export declare enum Side { FrontSide = "FrontSide", BackSide = "BackSide", DoubleSide = "DoubleSide" } /** * Enum for texture combine operations in 3D graphics. * Specifies how textures are combined or blended together. */ export declare enum Combine { MultiplyOperation = "MultiplyOperation", MixOperation = "MixOperation", AddOperation = "AddOperation" } /** * Translates a `Combine` enum to a `THREE.Combine` enum. */ export declare function translateCombine(v: Combine): THREE.Combine;