Skip to content

BaseTextureParams

ts
type BaseTextureParams = {
  minFilter?:
    | "linear"
    | "nearest"
    | "linear-mipmap-linear"
    | "nearest-mipmap-linear";
  magFilter?: "linear" | "nearest";
  wrapS?: "clamp-to-edge" | "repeat" | "mirrored-repeat";
  wrapT?: "clamp-to-edge" | "repeat" | "mirrored-repeat";
  generateMipmaps?: boolean;
  anisotropy?: number;
  flipY?: boolean;
  level?: number;
  internalFormat?: number;
  colorSpace?: "srgb" | "linear-rgb";
  format?: number;
  type?: number;
};

Base parameters for configuring a WebGL texture.

Properties

PropertyTypeDescription
minFilter?"linear" | "nearest" | "linear-mipmap-linear" | "nearest-mipmap-linear"Texture minification filter. Default "linear-mipmap-linear" if generateMipmaps is true, "linear" otherwise
magFilter?"linear" | "nearest"Texture magnification filter. Default "linear"
wrapS?"clamp-to-edge" | "repeat" | "mirrored-repeat"Wrapping mode for the S (U) coordinate. Default "clamp-to-edge"
wrapT?"clamp-to-edge" | "repeat" | "mirrored-repeat"Wrapping mode for the T (V) coordinate. Default "clamp-to-edge"
generateMipmaps?booleanWhether to automatically generate mipmaps for this texture. Default true
anisotropy?numberLevel of anisotropic filtering to apply. Default 1 (no anisotropic filtering)
flipY?booleanWhether to flip the image's Y axis to match WebGL's coordinate system. Default true
level?numberThe mipmap level to fill. Default 0
internalFormat?numberThe internal format of the texture in the GPU. Default WebGL2RenderingContext.RGBA
colorSpace?"srgb" | "linear-rgb"The color space of the input data. Default "linear-rgb"
format?numberThe format of the texel data. Default WebGL2RenderingContext.RGBA
type?numberThe data type of the texel data. Default WebGL2RenderingContext.UNSIGNED_BYTE

Released under the MIT License.