/** @packageDocumentation * @module Rendering */ import { IndexedPolyfaceVisitor, Point2d, PolyfaceVisitor, Transform } from "@bentley/geometry-core"; import { RenderTexture } from "./RenderTexture"; /** Describes how to map a [[RenderTexture]]'s image onto a surface as part of a [[RenderMaterial]]. * @public */ export declare class TextureMapping { /** The texture to be mapped to the surface. */ readonly texture: RenderTexture; /** The parameters describing how the texture image is mapped to the surface. */ readonly params: TextureMapping.Params; constructor(tx: RenderTexture, params: TextureMapping.Params); /** @internal */ computeUVParams(visitor: PolyfaceVisitor, transformToImodel: Transform): Point2d[] | undefined; } /** @public */ export declare namespace TextureMapping { /** Enumerates the possible texture mapping modes. */ enum Mode { None = -1, Parametric = 0, ElevationDrape = 1, Planar = 2, /** @internal */ DirectionalDrape = 3, /** @internal */ Cubic = 4, /** @internal */ Spherical = 5, /** @internal */ Cylindrical = 6, /** @internal */ Solid = 7, /** @internal Only valid for lights */ FrontProject = 8 } /** A 2x3 matrix for mapping a texture image to a surface. */ class Trans2x3 { /** The 3x4 transform produced from the 2x3 matrix. */ readonly transform: Transform; /** Construct from the two rows of the matrix: * ``` * | m00 m01 originX | * | m10 m11 originY | * ``` * Producing the [Transform]($geometry-core): * ``` * | m00 m01 0 originX | * | m10 m11 0 originY | * | 0 0 1 0 | * ``` */ constructor(m00?: number, m01?: number, originX?: number, m10?: number, m11?: number, originY?: number); } /** Properties used to construct a [[TextureMapping.Params]]. */ interface ParamProps { /** The matrix used to map the image to a surface. */ textureMat2x3?: TextureMapping.Trans2x3; /** The ratio in [0, 1] with which to mix the color sampled from the texture with the surface's color. * A value of 0.0 uses only the surface color. A value of 1.0 uses only the texture color. A value of 0.5 uses an even mix of both. * @note This affects only the red, green, and blue components of the color. The alpha sampled from the texture is always multiplied by the surface color's alpha. * @note Defaults to 1.0 */ textureWeight?: number; /** The mode by which to map the image to a surface. * @note Defaults to [[TextureMapping.Mode.Parametric]]. */ mapMode?: TextureMapping.Mode; /** @internal */ worldMapping?: boolean; } /** Parameters describing how a [[RenderTexture]]'s image is mapped to a surface. */ class Params { /** The matrix used to map the image to a surface. */ textureMatrix: TextureMapping.Trans2x3; /** The ratio in [0, 1] with which to mix the color sampled from the texture with the element's color. * A value of 0.0 uses only the element color. A value of 1.0 uses only the texture color. */ weight: number; /** The mode by which to map the image to a surface. */ mode: TextureMapping.Mode; /** @internal */ worldMapping: boolean; constructor(props?: ParamProps); /** * Generates UV parameters for textured surfaces. Returns undefined on failure. * @internal */ computeUVParams(visitor: IndexedPolyfaceVisitor, transformToImodel: Transform): Point2d[] | undefined; /** Computes UV parameters given a texture mapping mode of parametric. */ private computeParametricUVParams; /** Computes UV parameters given a texture mapping mode of planar. The result is stored in the Point2d array given. */ private computePlanarUVParams; /** Computes UV parameters given a texture mapping mode of elevation drape. The result is stored in the Point2d array given. */ private computeElevationDrapeUVParams; } } //# sourceMappingURL=TextureMapping.d.ts.map