GodRays
The GodRays effect requires a mesh that will be used as an origin point for the rays. Refer to this example for more details.
For correct occlusion by other objects, also set <EffectComposer autoClear={false}>.
import { GodRays } from '@react-three/postprocessing'
return (
<GodRays
sun={sunRef}
blendFunction={BlendFunction.Screen} // The blend function of this effect.
samples={60} // The number of samples per pixel.
density={0.96} // The density of the light rays.
decay={0.9} // An illumination decay factor.
weight={0.4} // A light ray weight factor.
exposure={0.6} // A constant attenuation coefficient.
clampMax={1} // An upper bound for the saturation of the overall effect.
width={Resizer.AUTO_SIZE} // Render width.
height={Resizer.AUTO_SIZE} // Render height.
kernelSize={KernelSize.SMALL} // The blur kernel size. Has no effect if blur is disabled.
blur={true} // Whether the god rays should be blurred to reduce artifacts.
/>
)