float ZFar { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The ZFar property of the CameraComponent class specifies the far clip plane distance for the camera. This is the maximum distance from the camera at which objects will be rendered. The value of ZFar is crucial for determining the rendering range of the camera and should be set based on the specific needs of your game. A shorter distance is generally better for performance, with typical values ranging from 1000 to 30000. If a larger distance is required, it can be balanced by increasing the ZNear value to maintain rendering quality.

Usage

To set the ZFar property, simply assign a float value within the range of 1 to 100000. This value should be chosen based on the specific requirements of your scene and the desired rendering distance.

Example

// Example of setting the ZFar property
CameraComponent camera = new CameraComponent();
camera.ZFar = 5000f; // Set the far clip plane to 5000 units