import { Component, ConstructorProps, ContextManager, Observable } from '@zcomponent/core'; import * as THREE from 'three'; import { EncodingType } from '../../context'; export type TextureConstructorProps = ConstructorProps; export declare enum AttachTo { 'map' = "map", 'aoMap' = "aoMap", 'alphaMap' = "alphaMap", 'envMap' = "envMap", 'lightMap' = "lightMap", 'specularMap' = "specularMap", 'bumpMap' = "bumpMap", 'displacementMap' = "displacementMap", 'emissiveMap' = "emissiveMap", 'metalnessMap' = "metalnessMap", 'normalMap' = "normalMap", 'roughnessMap' = "roughnessMap", 'matcap' = "matcap", 'clearcoatMap' = "clearcoatMap", 'clearcoatNormalMap' = "clearcoatNormalMap", 'clearcoatRoughnessMap' = "clearcoatRoughnessMap", 'sheenRoughnessMap' = "sheenRoughnessMap", 'sheenColorMap' = "sheenColorMap", 'specularIntensityMap' = "specularIntensityMap", 'specularColorMap' = "specularColorMap", 'thicknessMap' = "thicknessMap", 'transmissionMap' = "transmissionMap", 'gradientMap' = "gradientMap" } export type Wrap = 'Repeat' | 'ClampToEdge' | 'MirroredRepeat'; /** * Base class for texture components. */ export declare class Texture extends Component { element: T; constructor(contextManager: ContextManager, props: TextureConstructorProps, element: T); /** * The texture encoding. * @zprop * @zgroup Texture * @zgrouppriority 11 * @zdefault sRGBEncoding */ encoding: Observable; /** * Which property of the material to attach the texture to. * * e.g `map`, `normalMap`, `specularMap`, etc. * @zprop * @zgroup Texture * @zgrouppriority 11 * @zdefault map */ attachTo: Observable; /** * The number of samples taken along the axis through the pixel that has the highest density of texels. * By default, this value is 1. A higher value gives a less blurry result than a basic mipmap, at the cost of more texture samples being used. * * Use renderer.capabilities.getMaxAnisotropy() to find the maximum valid anisotropy value for the GPU; this value is usually a power of 2. * @zprop * @zgroup Texture * @zgrouppriority 11 * @zdefault 1 */ anisotropy: Observable; /** * * How much a single repetition of the texture is offset from the beginning, in each direction U and V. Typical range is 0.0 to 1.0. * @zprop * @zgroup Texture * @zgrouppriority 11 * @zdefault [0, 0] */ offset: Observable<[number, number], never>; /** * How many times the texture is repeated across the surface, in each direction U and V. * If repeat is set greater than 1 in either direction, the corresponding Wrap parameter should also be set to THREE.RepeatWrapping or THREE.MirroredRepeatWrapping to achieve the desired tiling effect. * @zprop * @zgroup Texture * @zgrouppriority 11 * @zdefault [1, 1] */ repeat: Observable<[number, number], never>; /** * This defines how the texture is wrapped horizontally and corresponds to U in UV mapping. * The default is ClampToEdge, where the edge is clamped to the outer edge texels. * The other two choices are Repeat and MirroredRepea. See the texture constants page for details. * * https://threejs.org/docs/#api/en/constants/Textures * @zprop * @zgroup Texture * @zgrouppriority 11 * @zdefault ClampToEdge */ wrapS: Observable; /** * This defines how the texture is wrapped vertically and corresponds to V in UV mapping. * * The default is ClampToEdge, where the edge is clamped to the outer edge texels. * The other two choices are Repeat and MirroredRepea. See the texture constants page for details. * * https://threejs.org/docs/#api/en/constants/Textures * * NOTE: tiling of images in textures only functions if image dimensions are powers of two (2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, ...) in terms of pixels. * Individual dimensions need not be equal, but each must be a power of two. This is a limitation of WebGL. * @zprop * @zgroup Texture * @zgrouppriority 11 * @zdefault ClampToEdge */ wrapT: Observable; /** * The point around which rotation occurs. A value of (0.5, 0.5) corresponds to the center of the texture. Default is (0, 0), the lower left. * @zprop * @zgroup Texture * @zgrouppriority 11 * @zdefault [0, 0] */ center: Observable<[number, number], never>; /** * How much the texture is rotated around the center point, in radians. Positive values are counter-clockwise. * @zprop * @zgroup Texture * @zgrouppriority 11 * @zdefault 0 */ rotation: Observable; /** * * If set to true, the alpha channel, if present, is multiplied into the color channels when the texture is uploaded to the GPU. * @zprop * @zgroup Texture * @zgrouppriority 11 * @zdefault false */ premultiplyAlpha: Observable; /** * Whether the texture is flipped horizontally on the UV axis. * @zprop * @zgroup Texture * @zgrouppriority 11 * @zdefault true */ flipY: Observable; /** * Specifies the alignment requirements for the start of each pixel row in memory. The allowable values are: * - 1 (byte-alignment) * - 2 (rows aligned to even-numbered bytes) * - 4 (word-alignment) * - 8 (rows start on double-word boundaries) * @zprop * @zgroup Texture * @zgrouppriority 11 * @zdefault 4 */ unpackAlignment: Observable; /** * Disposes of the texture. */ dispose(): never; }