I discovered the Babylon Editor today! It’s super cool.
I’ve got some questions about it - when double-clicking to open a .glb
file directly from the Assets Browser (see image), a new window titled the “Mesh Viewer” opens up.
This “Mesh Viewer” window seems to be a bit different - it seems to be well-lit, and the Light objects within the scene don’t seem to have any effect on the rendered result (I tried adding a bunch of lights, then disposing them with the “Dispose” button inside the Mesh Viewer, and couldn’t see any discernible different. Even disposing all the lights had no impact)
Mesh Viewer window:
- is this Mesh Viewer window still rendering with BabylonJS under the hood?
- if so - is there a name for this effect? is there some kind of hidden behind-the-scenes default light object that makes the meshes look the way they do, or some other configuration settings? any pointers on how to replicate this with Babylon?
- how does it seem to ignore light objects? is there a way to achieve this kind of look but still add dynamic shadows on top of it?
The main reason I’m interested is because the way the meshes are rendered in this view is very close to what I desire for the actual visuals of my project.
EDIT: after doing some digging, I’ve found my way to the source code for the MeshViewer: Editor/index.tsx at master · BabylonJS/Editor · GitHub
Turns out it’s setting the environmentTexture
to the parking.env
asset that’s causing these meshes to be so bright even when there’s no light. (See L126: Editor/index.tsx at master · BabylonJS/Editor · GitHub)
I’m guessing this is roughly the equivalent to, or at least similar to, baking effects into textures? I wasn’t aware that textures could affect the brightness of a material in absence of any light, however. If anyone could explain what exactly is happening here that would be appreciated!