Hi everyone, I’m very new to the whole glTF thing and have been playing around in Max with the Babylon exporter. I went through the Max documentation and the PBR documentation and managed to successfully export a small scene, but am now completely stuck on the next one.
I’ve got a simple cube with holes in it that I have lit and then baked the textures and lighting.
I’d like to export this using the Babylon exporter but I don’t understand how to do this so only the lighting information from the baked textures is used. No matter what I do, the exporter seems to add a skybox and environment light and I can’t just get the baked light. I’ve unchecked “Create default skybox” in the settings but it doesn’t seem to work.
Would really appreciate it if someone could help me out!
Can you share your source and exported scenes? This may be a “default light” that we add to the scenes. I remember talking with @bghgary regarding how “convenient” it is to add lights to our exported scene on behalf of the user like so:
Hi Drigax, thanks so much for getting back. Yes, that’s the problem I am having, when I export and run it in Babylon sandbox, I get the skybox and environment textures added no matter what I do. But I need just my model and the baked texture that I’ve applied to it without any additional lighting - all the lighting info is already in my baked texture.
Right now I also get crazy reflective black surfaces for my model when I export it with Babylon, and I don’t really understand why.
I can’t seem to upload files to the forum so I’ve added my scene and gtlf export to Dropbox here:
Hi. First of all you need second channel uvw map for your lightmaps and ambient occlusion maps. You can copy your uvw from first to second channel. Second thing you cant export lightmaps directly from 3ds max into gltf because no slot in 3ds max materials target to lightmap only for ambient occlusion 3DSMax to glTF - Babylon.js Documentation. But you can load lightmap texture separete and assign to your material. Lights - Babylon.js Documentation
You can use baked texture directly as diffuse texture but this is bad idea for correct working with pbr rendering pipelines.
And you cant see lightmaps textures in sandbox because you can’t export them.
Would it be possible to add a lightmap container in the babylonAttributes of the physical material that gets exported (maybe also with a levelValue)?
Using babylonjs for a few years now and this feature would be really nice.
Hello,
I’m afraid that no more ehancement would be made on Babylon side, because of Autodesk working onto his own gltf exporter. However, you’re very welcome if you want to contribute, adding this functionality. @bghgary will be able to give you an official answer.
G.
Is this exporting to .gltf or .babylon? If the former, it’s not possible without a separate glTF extension as core glTF doesn’t support lightmaps. If the latter, it should be possible if someone is willing to contribute it.
Yes, in my workflow I am using the gltf/glb export.
I discovered that BlenderUsers can use the MozillaExtension (also a gltf Extension) to Export Scenes with lightmaps via glb to MozillaHubs. And I was just wondering if we can have sth. similar for the BabylonEngine.
@Guillaume_Pelletier yes, but the glbExporter of Babylon is way better then the autodesk(3dsMax) one. And I would really like to contribute, adding this functionality, but I am a 3D-Artist, not a developer.
If there is a vendor extension for this, it should be possible to write code for a Babylon glTF loader extension that corresponds to this and load it. Do you know where the spec for this extension is?
Exporting this probably isn’t hard (though we don’t have much bandwidth right now to do it). Also, the Babylon.js loader doesn’t support this either. Are you planning on loading the asset in Babylon.js?
@bghgary Yes, like I wrote earlier I would use this for my 3dsMax to babylon.js workflow (could imagine that a lot of 3D-Artist could find this very helpful). But that means that, there has to be sth. similar in the babylon attributes of 3dsMaxMaterial to set it up. And as you mentioned the babylon.js loader is also not prepared to do that right now.
Anyway, I really appreciate that you did a research yourself about this topic.
Right now I am loading the Lightmaps via code from a folder. I really like what is possible with babylon.js and I am very excited how it will perform in the future.
Thank you for your patience and if you like you can have a look at this project I am working on (WIP)
It may take some time to load all the assets and I would recommend to use it in standard mode right now, cause it is not optimzed for VR. https://zbots.zreality.com/index.html
@kvasss Yes, I already know this trick. And in some cases I am using it. Anyway I really hope it becomes a Standard and that someday it will be possible to save the lightmaps in the gltf/glb.
As I mentioned above there is already a way to do this with the MOZ_lightmap_extension but it is limited for BlenderUsers right now.
If someone is willing to contribute the changes for both the exporter and loader, that will be the best. Otherwise, file a feature request on both repos and we will see if it gets traction.