📄 drei/misc/cube-camera-use-cube-camera

File: cube-camera-use-cube-camera.md | Updated: 11/15/2025


title: CubeCamera / useCubeCamera sourcecode: src/core/CubeCamera.tsx

Creates a THREE.CubeCamera that renders into a fbo renderTarget and that you can update().

export function useCubeCamera({
  /** Resolution of the FBO, 256 */
  resolution?: number
  /** Camera near, 0.1 */
  near?: number
  /** Camera far, 1000 */
  far?: number
  /** Custom environment map that is temporarily set as the scenes background */
  envMap?: THREE.Texture
  /** Custom fog that is temporarily set as the scenes fog */
  fog?: Fog | FogExp2
})
const { fbo, camera, update } = useCubeCamera()