Skip to content

CVR Skybox Manipulator

Manipulates how the skybox renders for a target camera. You can override the material, mesh, origin, and local transform for unique visual effects.

Useful for camera-stacking setups where the skybox should redraw without clearing depth.

This component can be tested in-editor.

The camera whose skybox is manipulated. Set this to the Reference Camera defined in CVRWorld if you want the effect to apply to the player camera.

Controls how the skybox is centered relative to the camera’s eye position.

  • 0: Skybox is centered at the world origin.
  • 1: Skybox is fully centered on the camera’s eye position.

Any value between 0 and 1 blends between the two.

Origin point for the parallax effect. If unset, the world origin is used.

When enabled, aligns the skybox to world space instead of matching the camera’s rotation.

Offsets the skybox’s position relative to the target camera and origin position.

Rotates the skybox locally relative to the target camera and origin rotation.

Scales the skybox. Default is Vector3.one * 0.5.

When enabled, the component uses a custom skybox material instead of the default.

Material applied when a custom material is enabled. If the shader name contains “6 Sided” or “6Sided” and has at least six passes, the skybox is drawn as six-sided.

When enabled, allows a custom mesh for the skybox.

Custom mesh for the skybox. A mesh with exactly six submeshes is drawn as six-sided.

The skybox renders in one of two modes:

  • 6-Sided Mode Activated when either:

    • A custom mesh with exactly six submeshes is used, or
    • A custom material is provided whose shader name contains “6 Sided” or “6Sided” and has at least six passes.

    In 6-sided mode, the same material is applied to every submesh, and each submesh is drawn with its corresponding shader pass.

  • Default Mode Used when the six-sided conditions are not met. Renders using the default skybox sphere mesh or a single-submesh custom mesh with only the first shader pass and the first submesh.

These properties are provided for runtime scripting access to the skybox manipulator. Setting any of them flags the skybox as needing a command-buffer rebuild and invalidates the relevant cached material or mesh.

  • SkyboxMaterial — Access or modify the custom skybox material.
  • UseCustomSkyboxMaterial — Enable or disable the custom skybox material.
  • SkyboxMesh — Access or assign a custom mesh for the skybox.
  • UseCustomSkyboxMesh — Toggle whether a custom skybox mesh is used.
  • CenterOnEye — Adjust the centering of the skybox relative to the camera’s eye. Clamped 0–1.
  • OriginTransform — Set or update the origin transform used for the parallax effect.
  • AlignToWorldSpace — Switch between aligning the skybox to world space or the camera’s rotation.
  • LocalPosition, LocalRotation, LocalScale — Modify the local transformation of the skybox relative to the target camera.

Clears cached material and mesh references and flags the command buffer for a rebuild on the next render.

  • If the Target Camera is the CVRWorld reference camera, the component rebinds it to the player’s active camera at runtime and follows the camera across VR mode switches.
  • The skybox is drawn via a command buffer attached to CameraEvent.BeforeForwardOpaque. While the component is active, the target camera’s clearFlags are forced to Nothing and are restored on disable.
  • In VR with SinglePassInstanced stereo rendering, the skybox is redrawn per eye with an eye-offset matrix so it still appears infinitely distant.
  • CVR-GameFiles/ABI.CCK.Components/CVRSkyboxManipulator.cs