Open griffin2000 opened 5 years ago
This is a current limitation of the engine, mostly for performance and size reasons: we only support 1 directional light (that includes sun light) at a time. The engine picks the one with the strongest intensity. What is your use case for 2 directional lights?
Ah OK. We have a client-facing API that supports multiple directional lights.
Though actually I do think it's a bug even with that restriction. In the example above it's the very dim light that gets used, not very bright one (so the render comes out black)
Added a bug about the incorrect light choice: https://github.com/google/filament/issues/1183
On the WebGL build (version f5b47dc95e3e5efb09f52c31d628618326f1f51e) I've noticed it's not possible to add a Directional and Sun light to the same scene.
We you do try to do so, the first directional/sun light that is added to the scene is overwritten by the second one. E.g. this code results in only a very dim sun light, no directional light. The results are the same if two directional lights are added (but not if a directional light and a point light are added, in which case the both render correctly):
I've attached a version of tutorial_redball.js that shows the issue.