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.
Properties
Section titled “Properties”Target Camera
Section titled “Target Camera”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.
Center on Eye
Section titled “Center on Eye”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 Transform
Section titled “Origin Transform”Origin point for the parallax effect. If unset, the world origin is used.
Align To World Space
Section titled “Align To World Space”When enabled, aligns the skybox to world space instead of matching the camera’s rotation.
Local Position
Section titled “Local Position”Offsets the skybox’s position relative to the target camera and origin position.
Local Rotation
Section titled “Local Rotation”Rotates the skybox locally relative to the target camera and origin rotation.
Local Scale
Section titled “Local Scale”Scales the skybox. Default is Vector3.one * 0.5.
Use Custom Skybox Material
Section titled “Use Custom Skybox Material”When enabled, the component uses a custom skybox material instead of the default.
Skybox Material
Section titled “Skybox Material”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.
Use Custom Skybox Mesh
Section titled “Use Custom Skybox Mesh”When enabled, allows a custom mesh for the skybox.
Skybox Mesh
Section titled “Skybox Mesh”Custom mesh for the skybox. A mesh with exactly six submeshes is drawn as six-sided.
Skybox Rendering
Section titled “Skybox Rendering”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.
Public Properties (For Scripting Use)
Section titled “Public Properties (For Scripting Use)”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.
ForceUpdate()
Section titled “ForceUpdate()”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’sclearFlagsare forced toNothingand are restored on disable. - In VR with
SinglePassInstancedstereo rendering, the skybox is redrawn per eye with an eye-offset matrix so it still appears infinitely distant.
Source
Section titled “Source”CVR-GameFiles/ABI.CCK.Components/CVRSkyboxManipulator.cs