Engine API Reference - v2.6.1
    Preparing search index...

    Function reprojectTexture

    • This function reprojects textures between cubemap, equirectangular and octahedral formats. The function can read and write textures with pixel data in RGBE, RGBM, linear and sRGB formats. When specularPower is specified it will perform a phong-weighted convolution of the source (for generating a gloss maps).

      Parameters

      • source: Texture

        The source texture.

      • target: Texture

        The target texture.

      • Optionaloptions: {
            distribution?: string;
            face?: number;
            numSamples?: number;
            rect?: Vec4;
            seamPixels?: number;
            specularPower?: number;
        } = {}

        The options object.

        • Optionaldistribution?: string

          Specify convolution distribution - 'none', 'lambert', 'phong', 'ggx'. Default depends on specularPower.

        • Optionalface?: number

          Optional cubemap face to update (default is update all faces).

        • OptionalnumSamples?: number

          Optional number of samples (default is 1024).

        • Optionalrect?: Vec4

          Optional viewport rectangle.

        • OptionalseamPixels?: number

          Optional number of seam pixels to render

        • OptionalspecularPower?: number

          Optional specular power. When specular power is specified, the source is convolved by a phong-weighted kernel raised to the specified power. Otherwise the function performs a standard resample.

      Returns boolean

      True if the reprojection was applied and false otherwise (e.g. if rect is empty)