Rodrix3 Posted April 2, 2018 Share Posted April 2, 2018 We have an entire complex scene in Max that has over 25 spotlights and one ambient light (a big theatre). We are using PBR materials, and our target is high-end desktop, offline, with 1080 GTX cards (it is just an experimental project, not actually for web deployment). What would be the best recommendation to achieving the most realistic results? Bake just occlusion maps? Bake lightmaps and occlusion maps? Bake anything else? Also, we are completely new to "baking". Is there any guide to do any of these two, and if you recommend we do both, which one should we work on first for giving the most realistic results? We are working on 3ds studio max and exporting using the Babylon plugin. Thank you so much! Quote Link to comment Share on other sites More sharing options...
V!nc3r Posted April 3, 2018 Share Posted April 3, 2018 You should definitely bake your lighting. As for AO, it depends on your scene and/or your objects: some AO can be included directly to the lightmap, some can be prefered included into Occlusion channel, it's on you. About 3dsMax texture baking, start with the doc. I think this piece of code could help you. Quote Link to comment Share on other sites More sharing options...
dsman Posted April 3, 2018 Share Posted April 3, 2018 @Rodrix3 You can take your scene to unity and bake the lightmap there, and use Unity Tookit (babylon) to export your model. This process is less painful as unity lightmapping is easy and automated. Quote Link to comment Share on other sites More sharing options...
Rodrix3 Posted April 3, 2018 Author Share Posted April 3, 2018 5 hours ago, dsman said: @Rodrix3 You can take your scene to unity and bake the lightmap there, and use Unity Tookit (babylon) to export your model. This process is less painful as unity lightmapping is easy and automated. Wow. That is interesting @dsman. Please tell me more. Our current workflow is 3ds studio max -> export to Babylon via exporter plugin. With your suggestion our new workflow should be: max-> export as fbx->import on unity -> export to Babylon? Unity creates the second set of of uvs maps for me automatically? And bakes lighting and occlusion? Is ambient occlusion included on the baked light map or is it a different thing. Which settings do I need to use to export all that into Babylon? Would that mean that my Babylon scene will have no lights at all? Or would it have some? Please instruct me and thanks so much. Thank you also @V!nc3r for the useful links! Please provide more tips you can share! Quote Link to comment Share on other sites More sharing options...
dsman Posted April 3, 2018 Share Posted April 3, 2018 @Rodrix3 Quote With your suggestion our new workflow should be: max-> export as fbx->import on unity -> export to Babylon? Yes. Quote Unity creates the second set of of uvs maps for me automatically? And bakes lighting and occlusion? Is ambient occlusion included on the baked light map or is it a different thing. Yes. It does. You just have to select "Generate Lightmapping UVs" in the fbx properties (appears in the "inspector" tab after selecting the fbx file in the project explorer. AO is baked along with lighting and global illumination (GI affects only if you enable Final Gather pass in lightmapping). Quote Which settings do I need to use to export all that into Babylon? Would that mean that my Babylon scene will have no lights at all? Or would it have some? @MackeyK24 has contributed entire Unity exporter to Babylon. Just download it from Babylon github repo and place it in Asset folder of unity project and there will be a Babylon menu in the main menu bar. You can export babylon scene from there. Make sure to select "Shadowmap factor " to 1 under lightmap setting of the Toolkit exporter and preferably export lightmap as png by setting "Default texture format" to png. Lightmap channel in Babylon is multiplicative which means if light is 0, it will be black. So you will still need to add lights in your Babylon scene. But you can do good with one simple directional light and one hemispherical light. Rodrix3 1 Quote Link to comment Share on other sites More sharing options...
Rodrix3 Posted April 3, 2018 Author Share Posted April 3, 2018 1 hour ago, dsman said: Yes. It does. You just have to select "Generate Lightmapping UVs" in the fbx properties (appears in the "inspector" tab after selecting the fbx file in the project explorer. You mean on Unity import? Also do you recommend I export fbx from Max or should I import directly from Max file? (I read that unity imports Max file). Furthermore, should I set lights on Max? Are they imported into Unity? Thanks so much. And what a wonderful piece of advice you are giving me. I can't believe unity renders both light map and ao map. So much less work! Quote Link to comment Share on other sites More sharing options...
MackeyK24 Posted April 4, 2018 Share Posted April 4, 2018 13 hours ago, dsman said: @Rodrix3 Yes. Yes. It does. You just have to select "Generate Lightmapping UVs" in the fbx properties (appears in the "inspector" tab after selecting the fbx file in the project explorer. AO is baked along with lighting and global illumination (GI affects only if you enable Final Gather pass in lightmapping). @MackeyK24 has contributed entire Unity exporter to Babylon. Just download it from Babylon github repo and place it in Asset folder of unity project and there will be a Babylon menu in the main menu bar. You can export babylon scene from there. Make sure to select "Shadowmap factor " to 1 under lightmap setting of the Toolkit exporter and preferably export lightmap as png by setting "Default texture format" to png. Lightmap channel in Babylon is multiplicative which means if light is 0, it will be black. So you will still need to add lights in your Babylon scene. But you can do good with one simple directional light and one hemispherical light. I fixed the next upcoming version to directly HDR TO LDR Tone Map the internal Unity Lightmap (Intensity Map) and use that as Lightmap Map (Shadow Map Mode). So no need to muck around with Shadow Map Strength any more since we now use the orginal lightmap .exr (Tone Mapped Of Course) Now you get a MUCH cleaner Lightmap with ALL Global Illumination and Ambient Occlusion (including Runtime GI if you wanted to go that route... i recommend Baked GI instaed ). GLTF PBR Materials and Lighting in general is much better in the next release Working hard to get the next release out as soon as i can Quote Link to comment Share on other sites More sharing options...
dsman Posted April 4, 2018 Share Posted April 4, 2018 @Rodrix3 It doesn't matter how you bring the scene to Unity. Via FBX or directly from Max to Unity. Not sure if lights would be exported from Max to Unity but it is advisable to set lighting in Unity. You will have to set all lights to "Baked" in order for those lights to be considered in the lightmap generation (except for Area lights which are "Baked Only" only by default). @MackeyK24 Like I always have been saying. I am desperately waiting for next release of the Unity Tookit. And I still request you to make a commit to Babylon exporter repository on github with whatever you have. Since we don't need animations yet, we can start using whatever you have right now. Quote Link to comment Share on other sites More sharing options...
Rodrix3 Posted April 6, 2018 Author Share Posted April 6, 2018 Thanks so much for the replies! I have decided to go with the 3d Studio Max workflow for now since I would like to skip learning Unity for now. I was able to bake AO textures. Now the question is where should I apply the AO texture?: ambientTexture? lightmapTexture? emissiveTexture? (I read on posts that some do this for fully baked lightmaps, which is not my case. I am just baking AO). Please note that I am using PhysicalMaterial and so the tile texture has it's own AO map. Now in addition to that, I have the complete baked AO map for the object that uses UV coords 2. Thanks so much! Quote Link to comment Share on other sites More sharing options...
Rodrix3 Posted April 6, 2018 Author Share Posted April 6, 2018 Also, is it possible to set the AO map on 3d Studio Max's material and have it automatically export on the gltf so I don't have to set it manually? Quote Link to comment Share on other sites More sharing options...
V!nc3r Posted April 9, 2018 Share Posted April 9, 2018 I think you should put these maps into the ligtmaptexture channel, and set useLightmapAsShadowMap as true. Quote Link to comment Share on other sites More sharing options...
Rodrix3 Posted April 9, 2018 Author Share Posted April 9, 2018 7 hours ago, V!nc3r said: I think you should put these maps into the ligtmaptexture channel, and set useLightmapAsShadowMap as true. @V!nc3r thanks so much! To understand, what is the difference between using the ao channel vs using the light map texture channel? I understand I get the benefit of assigning an additional occlusion tillable texture. But does the rendering change if I use the lighmap texture channel? Quote Link to comment Share on other sites More sharing options...
V!nc3r Posted April 10, 2018 Share Posted April 10, 2018 We have here to read some maths If I well understand (I walk on eggshells here): occlusionTexture will multiply values lightmapTexture as shadowmap will do the same, but if shadowmap isn't checked, it's added. but lightmapTexture itself is not calculated the same way as occlusionTexture (notice the toLinearSpace for example) (here it's for PBR shader, you can find the same logic into standard) Quote Link to comment Share on other sites More sharing options...
Rodrix3 Posted April 13, 2018 Author Share Posted April 13, 2018 Thanks so much, @V!nc3r. This has been very helpful! Any idea if it is possible to export to the light map bucket from 3ds Max using the Babylon exporter? Thanks again Quote Link to comment Share on other sites More sharing options...
V!nc3r Posted April 13, 2018 Share Posted April 13, 2018 Don't know, it's now a few years I switch from 3dsmax to Blender (for my great pleasure ) Quote Link to comment Share on other sites More sharing options...
babbleon Posted April 13, 2018 Share Posted April 13, 2018 @V!nc3r - am I right in saying that you cannot bake light maps (not ambient occlusion maps) in Blender? Quote Link to comment Share on other sites More sharing options...
V!nc3r Posted April 13, 2018 Share Posted April 13, 2018 You can. But I have to say the default Blender baking workflow is bad, this is why I use the addon BakeTool. (in Cycles, you can use the diffuse map without the color enabled for example). You can see the workflow & result in my Cornell Box scene: https://github.com/Vinc3r/cornellBox/tree/master/3D (yep I haven't write how to use it... yet) babbleon 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.