The light in the default viewer is to intensive, in the minimal viewer the light is ok but the camera position is wrong. I tried thus with 2 STL models and 2 OBJ models.
So my question is: What i am doing wrong and what i need to do that it is working correctly?
The following links are external links, they will only work until 01.01.2023
Screenshot of model viewed in minimal viewer
Screenshot of model in minimal viewer shown from outside
Code used for the default viewer:
Code used for the minimal viewer:
<babylon extends="minimal" model="./models/3DBenchy.stl"></babylon>
Sorry for taking so long to answer!!
Do you have the same results in our sandbox? https://sandbox.babylonjs.com ? you can drag-and-drop your model there and see how it renders per default. Both the minimal and default configuration of the viewer do nothing to the light intensity. It actually generates a simple Hemispheric light.
Thank you for the answer. In the Sandbox the models are rendered correct.
Would to be able to share the models so we can test that locally? I find it very odd that the viewer makes the light so intense without changing the configuration. But it does seem like it’s doing it!
Would be great if you can share them. Even privately
The models can be downloaded from here until 30.04.2022.
The password for accessing the file is: K2iK9LbDct
Just bumping here for @RaananW
Sorry for a later reply!
The model itself is not the issue, and light intensity isn’t as well. The issue is light reflections and the default material being assigned to an STL being loaded. If you use this code:
The model looks correct:
Just like it looks on the sandbox.
The “problem” with an stl is that it has no material, so in this case you will need to configure the scene’s default material if you want the reflection to change. In general you could do this:
But the viewer had a small init bug that prevented you from doing that correctly. I have submitted a PR to fix this issue ([Viewer] fix default material init by RaananW · Pull Request #12463 · BabylonJS/Babylon.js · GitHub), but you could try exploring different configurations (or maybe try using the minimal configuration with a few other configuration options)