react-three-gpu-pathtracer
react-three-gpu-pathtracer copied to clipboard
PhysicalSpotLight, ShapedAreaLight, and example of how to use lights
When I first add a cube, it looks black.
Does this help? https://codesandbox.io/s/react-three-gpu-pathttracer-gltf-lights-3t7bqu?file=/src/App.js
It'll look something like
import { PhysicalSpotLight } from "three-gpu-pathtracer";
extend({ PhysicalSpotLight });
<physicalSpotLight [...] />
If you're using TypeScript, you'll have more problems, because 1) three-gpu-pathtracer doesn't have types yet and 2) you have to extend JSX IntrinsicElements anyways. So your code will look something like:
import { PhysicalSpotLight as PathTracerPhysicalSpotLight } from "three-gpu-pathtracer";
class PhysicalSpotLight extends PathTracerPhysicalSpotLight {}
extend({ PhysicalSpotLight });
declare module '@react-three/fiber' {
interface ThreeElements {
physicalSpotLight: Object3DNode<PhysicalSpotLight, typeof PhysicalSpotLight>
}
}
Thanks! We will take a lok at this once we gear up for a major. The major will wrap all of the upstream helpers in React. As of now, you can use the extend syntax to use these features.