Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PhysicalSpotLight, ShapedAreaLight, and example of how to use lights #4

Open
richardanaya opened this issue Feb 28, 2023 · 2 comments

Comments

@richardanaya
Copy link

richardanaya commented Feb 28, 2023

When I first add a cube, it looks black.

@FarazzShaikh
Copy link
Member

@BrendanBerkley
Copy link

BrendanBerkley commented Jun 23, 2023

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>
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants