React-babylonjs light color

I am using react-babylonjs and I want to change the color of light.

<pointLight
        name="omni"
        position={new Vector3(0, 50, 0)}
        emissiveColor={Color3.Green()}
      />

What are the correct parameters.
Also how can I find all the parameters for pointLight for example, in which file should I look in the package.

Pinging our react master @brianzinn

I think it just has a diffuse and specular properties - you can find the parameters in the API documentation.
https://doc.babylonjs.com/api/classes/babylon.pointlight

If you want to look in the package you can look at the typings (*.d.ts). In a modern IDE like VS Code you should get intellisense with ctrl + space to list the available properties, since the JSX intrinsic elements are included in the typings of react-babylonjs. Typings are erased when you build, so don’t worry about the size of those files.

Since react-babylonjs is generated directly from @babylonjs typings, you can always rely on the official API documentation. There are only a few extra properties that allow us to create more declarative scenes for things like shadows, physics, etc…

This storybook sets diffuse and specular - without knowing what you are trying to accomplish I would suspect you want to set the diffuse:

<hemisphericLight
          name='light1'
          direction={Vector3.Up()}
          intensity={0.7}
          diffuse={Color3.Red()}
          specular={Color3.Green()}
          groundColor={Color3.Green()}
        />

Hope that helps. Cheers.

Fantastic, thank you so much for your answer and even more for react-babylonjs, is great, I intend to use it extensively.

1 Like

Thanks @arooly that’s really encouraging and motivating :slight_smile: If you have more questions or any functionality is missing make sure to ask. There have been 6 releases in the last month, so always adding new stuff :slight_smile: