Skip to content

Ambient Light #84

Answered by jnsmalm
goldenratio asked this question in Q&A
Mar 15, 2022 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

Hey,

Yes you can achieve this by using Image-based lighting. The good thing about this is that you can use an environment as a light source instead of an solid color, which can give you reflections. An example how to use it can be found at https://codesandbox.io/s/github/jnsmalm/pixi3d-sandbox/tree/master/standard-material .You can find additional environments at https://ibl.pixi3d.org/

If you still just want a single color to act as ambient light you can do this as well. Just create a image-based lighting object with single color cube maps.

let ibl = new ImageBasedLighting(
    Cubemap.fromColors(new Color(1,0,0)),
    Cubemap.fromColors(new Color(0,0,0))
);

The first param is color for …

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@goldenratio
Comment options

Answer selected by goldenratio
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants