Class CubeMapRenderPass

Class Hierarchy

Use the Cubemap Render Pass to create a cubemap texture that represents the scene from some location. You can use the result of the Cubemap Render Pass as a cubemap texture. For example, use the Cubemap Render Pass to create dynamic reflections of the environment on the surface of 3D nodes.

The Cubemap Render Pass is similar to the CompositionTargetRenderPass, except that the Cubemap Render Pass sets each face of a cubemap as the composition target before rendering the descendant render passes.

Configuring the cubemap composition target

By default, the Cubemap Render Pass creates a cubemap composition target automatically. The attributes of the generated cubemap are derived from these properties of the Cubemap Render Pass:

  • ResolutionProperty
  • PixelFormatProperty
  • FilterModeProperty
  • MipmapModeProperty

Configuring the Cubemap Render Pass for depth rendering

By default, Cubemap Render Pass only creates a color texture that you can access through the ResultTextureProperty. To create a depth texture, set the DepthFormatProperty.

Kanzi creates color and depth textures as follows:

  • When both the PixelFormatProperty and DepthFormatProperty are set, Kanzi generates both a color and depth texture.
  • When only the PixelFormatProperty is set, Kanzi generates a color texture.
  • When only the DepthFormatProperty is set, Kaniz generates a depth texture.
  • When the PixelFormatProperty and DepthFormatProperty are not set, Kanzi generates a color texture.

If you need depth for correct rendering, but do not set the depth format, to save memory and improve performance, Cubemap Render Pass creates a depth renderbuffer that Kanzi reuses for each face.

Setting the cubemap texture manually

By manually setting a cubemap texture you override all other settings related to the automatic creation of cubemap textures.

To set the cubemap composition target manually:

  • Set the CompositionTargetProperty to the Cubemap Render Target Texture that you want to use as the composition target.
  • Set the DepthTargetProperty to the Cubemap Render Target Texture that you want to use as the depth target.

To create a Cubemap Render Target Texture, use Texture::CreateInfoCubemapRenderTarget.

Accessing the composition result

When you set a Cubemap Render Target Texture as the composition target of a Cubemap Render Pass, you can use that texture as the cubemap texture in materials.

To use the result textures of a Cubemap Render Pass in another render pass, create bindings to these properties:

  • ResultTextureProperty.

When you set the value of the CompositionTargetProperty, this property gets that value.

  • ResultDepthTextureProperty

When you set the value of the DepthTargetProperty, this property gets that value.

You can use these properties to access the result textures of both the composition targets that you set explicitly and the composition targets that the Cubemap Render Pass creates automatically.

Since Kanzi 3.8.0

Use a Cubemap render pass to create a cubemap texture that represents the scene from some location. You can use the generated cubemap as a cubemap texture. For example, use this approach to create environment maps for a scene.

Inherits properties and message types from CubeMapRenderPassMetadata.

Synopsis

Methods
create()

Create function

CubeMapRenderPass.CubeMapRenderPass:create(name)

Create function.