Capítulo 224 de 859

Chapter 224: DepthTexture

Core Idea

This class can be used to automatically save the depth information of a rendering into a texture.

Key Concepts

  • compareFunction : NeverCompare | LessCompare | EqualCompare | LessEqualCompare | GreaterCompare | NotEqualCompare | GreaterEqualCompare | AlwaysCompare: Code corresponding to the depth compare function.
  • flipY : boolean: If set to true, the texture is flipped along the vertical axis when uploaded to the GPU.
  • generateMipmaps : boolean: Whether to generate mipmaps (if possible) for a texture.
  • isDepthTexture : boolean (readonly): This flag can be used for type testing.

Reference Tables

Constructor

Signature
new DepthTexture( width : number, height : number, type : number, mapping : number, wrapS : number, wrapT : number, magFilter : number, minFilter : number, anisotropy : number, format : number, depth : number )

Properties

PropertyDescription
`.compareFunction : NeverCompareLessCompare
.flipY : booleanIf set to true, the texture is flipped along the vertical axis when uploaded to the GPU.
.generateMipmaps : booleanWhether to generate mipmaps (if possible) for a texture.
.isDepthTexture : boolean (readonly)This flag can be used for type testing.

Key Takeaways

  1. DepthTexture extends: EventDispatcher → Texture
  2. Most relevant properties: compareFunction, flipY, generateMipmaps, isDepthTexture.

Connects To