Jump to content

Ambient Occlusion Baking / Realistic Rendering


Rodrix3
 Share

Recommended Posts

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!

 

Link to comment
Share on other sites

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!

 

Link to comment
Share on other sites

@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. 

 

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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 :)

 

Link to comment
Share on other sites

@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. 

Link to comment
Share on other sites

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!

 

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

We have here to read some maths :wacko:

If I well understand (I walk on eggshells here):

(here it's for PBR shader, you can find the same logic into standard)

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...