Description
The FocusRange
property of the DepthOfField
class modulates how far the blur effect extends from the focal point in the scene. This property is crucial for achieving realistic depth of field effects by controlling the transition between focused and blurred areas in the rendered image.
Usage
To use the FocusRange
property, you can set it to a float
value within the specified range of 0 to 1000. This value determines the extent of the blur effect from the focal point. A higher value will result in a larger area being blurred, while a lower value will keep the blur effect closer to the focal point.
Example
// Create a new DepthOfField component
DepthOfField depthOfField = new DepthOfField();
// Set the focus range to 500 units
// This will blur objects that are further away from the focal point
depthOfField.FocusRange = 500.0f;
// Add the DepthOfField component to a scene camera
SceneCamera camera = new SceneCamera();
camera.AddComponent(depthOfField);
// Render the effect
// This will apply the depth of field effect with the specified focus range
camera.Render();