Is it possible to use external lightmap with UE4 ?

Hi guys ,

I’m new to UE4, i would like to know if it’s possible to use an external engine like Octane or Vray to generate my lightmaps and plug them in the shader like a traditionnal lightmass map.
My goal is to be able to use a mix beetween precalc static lighting for static object and UE4 dynamic light for moving object.

I know i could compute lightmap and connect them as emission map in the shader but this scenario will not work for dynamic shadows on vegetation for ex.
As i’m new to UE4 i would like to take advantage of mutithreaded GPU engine to speed up the lightamp generation workflow, and to also take advantage of the great dynamic lights of UE4.

The big problem i have with lightmass is that ican’t open them in an external editor like photoshop.

Thanks for your lights !

Cheers
Emmanuel

**’‘My goal is to be able to use a mix beetween precalc static lighting for static object and UE4 dynamic light for moving object.’’
**

You can do that directly in unreal using stationary lights. Static objects are going to be baked and movable objects will receive dynamic shadows.

I’ve seen projects that we’re baked with vray and imported in unreal but it didn’t look good. I think they used the emissive slot of even a mix in the diffuse with the lightmap and the albedo. Meh.

UE4 does not have a way of supporting lightmaps generated from outside of the editor. There’s a bunch of issues that will make them not work with the lighting system.

Many thanks for your answers guys ! :slight_smile:

So it is possible to use vray lightmap by using a hack workflow were you will compose your baked texture directly in the shader either by :

  • connecting the bake data as** emissive color**
  • or compose the diffuse color in the shader with the lightmap with a mult or mix op
    In both case this scenario restrict you to static lighting only and can’t work if you want a blend of static and dynamic object.
    In both case nobody looks to have suceed to get better result with this method** than** by using** lightmap.**

So in other word if you want to get the best photorealism result in UE4 you must baked GI inside UE4 with lightmass.

But if you choose to use UE4 as your lighting tool you must accept that

  • lightmass only use photon mapping for GI
  • lightmass is** CPU only** and** mono threaded **
  • you **can’t have any preview **of your final output and you have to wait the final output to see if it works or not
  • you will have to** play a lot with the .ini setup **to understand lightmass in depth to get correct result
  • you will be locked into UE4 and will** not be able to export the result of your GI **compute as a texture into any other software

From a game pov those restrction are not big deal but if want to mix precalc and real time output you will have to do your lighting and shader tweak 2 times.

  • 1 for your precal engine like octane or vray
  • 1 for your RT engine with UE4

That’s a pretty big hurdle for what i try to do.
Are there any way to overcome this by unlocking some locked stuff in the UE4 shaders ?

I would also like to** understand why the lighting system will not be able to use external map**.
What are the extra info tha lightmass generate that vray or octane can’t do.
cause at the end a lightmap is just a way to store lighting info ?

From my naive perspective lightmass generate something like this :

And compose this with the shader info

That might be quite different in reality ?

Thanks again for your lights !
Cheers
E

That black and white image is just a visualisation mode. Lightmaps are more complex than that. You can actually see them somewhere in the engine but I can’t recall where exactly. It would be impossible to edit.

  • lightmass only use photon mapping for GI correct
  • lightmass is CPU only and mono threaded you can use swarm agent for distributed rendering
  • you can’t have any preview of your final output and you have to wait the final output to see if it works or not unfortunately it’s pretty much that
  • you will have to play a lot with the .ini setup to understand lightmass in depth to get correct result you don’t have to mess with that at all
  • you will be locked into UE4 and will not be able to export the result of your GI compute exactly

Thanks again for your help heartlessphil !
The fact that you mention swarm agent is a very useful info for me.

At the end it looks that :
If you want to be as photoreal as you can in UE4, you have to work with lightmass and there are no real alternative that will offer you better result.
The theoretically good idea of using a more physical rendering engine like Octane or Vray to build lightmap is in reality a bad idea.

  • because it’s not possible for UE4 to use those lightmaps to mix them with the dynamic lighting
  • the workflow will introduce a lot of extra work and the result will not be better
  • you are stuck with static light + emissive material if you follow that path

In conclusion

  • to get the** best GI** result
  • the cleanest workflow
    =>** Use lightmass** and don’t try to hack stuff …

This bring a last question. If it’s not possible to import an external lighting into UE4. Is it possible to do the reverse op.
In other word** can we shoot 360 panoramic HDR from a position P in UE4** and render the image as a 32 bith depth image in .exr or .hdr.
and thus be able to** use this HDR as the base for our lighting in octane** ?

Thanks again for your time.

That could work… but I don’t think it would give a much better hdri than the super ultra high res ones we are used to with offline renderers. You know the 20k ones!!! hehe.

For swarm, this guide was very useful to set up my machines https://iamsparky.wordpress.com/2010/08/24/tutorial-setting-up-swarm-for-multiple-machines/

If you are a octane user, be aware that a plugin is coming, bringing octane renderer IN unreal and it will be able to progressively bake lightmaps for gaming, walkthrough, etc. :slight_smile: NO ETA. Unity is more likely to get it 1st tho. They’ve already showed it at unite 2016.

There’s two main issues with using a lightmap from outside of UE4–first is that you need extra data to get specular effects, which you just don’t have a way of rendering in an external renderer–though if someone wanted to then it could certainly be created. The second issue is that you won’t be able to get the UE4 lights to match the lights that you used to render your external lightmaps–so with dynamic lights they would never match the baked lighting.
For a working solution, the renderer that you want to use would have to be integrated into UE4. Which is totally possible for them to do.

Thanks again for all the extra info guys. I will stick to lightmass for now and keep an eye on Octane inside UE4 as a possible new alternative.
If someone here has any idea on how to locate and visualise the map generated by lightmass i would be curious to know how, just to satisfy my curiosity !

Cheers
E

Yea sure, they’re here :

Thanks again for your great support heartlessphil ! :slight_smile:

It doesn’t like a simple grey tone map … but more like shadows store with transparency.
Kinda esoteric at first sight !

I think it’s because they store data on each channel (RBG). What you see is all channels activated. Every individual channel is black and white but… it’s still very messy and i can’t see any ‘‘logic’’ to it. nothing that I could edit myself.

no,it’s stored inside MapBuildDataRegistry asset