Home Unreal Engine

UE4 gpu lightmap baker??

Replies

  • SolSkyre
    Options
    Offline / Send Message
    SolSkyre polycounter lvl 9
    Looks promising but seems prone to errors at this early development stage. I don't know why Epic hasn't released such a feature yet, it is a must.
  • JordanN
    Options
    Offline / Send Message
    JordanN interpolator
    Lightmass is CPU only? Wow. No wonder it felt so slow even when I upgraded my GPU in 2016. 

    Good thing I keep mental ray around since it still has the option to bruteforce lightmaps using gpu rendering.
  • melviso
    Options
    Offline / Send Message
    melviso polycounter lvl 10
    @SolSkyre Didn't they mention it would be difficult to do. People are currently testing it. I have and it's very fast compared to the old way.

    @JordanN Haha!! I can imagine the wonder why the lightmass baking isn't faster.
    Wait.. u can use Mental ray to bake lightmaps in ue4?
  • JordanN
    Options
    Offline / Send Message
    JordanN interpolator
    melviso said:
    @JordanN Haha!! I can imagine the wonder why the lightmass baking isn't faster.
    Wait.. u can use Mental ray to bake lightmaps in ue4?
    You can bake it in another program and import it manually. 
    Although this feature only works with older 3DS Max since Autodesk dropped Mental Ray in newer versions.
  • melviso
    Options
    Offline / Send Message
    melviso polycounter lvl 10
    O cool. I am wondering why can't we just export these lightmaps to say photoshop and fix the light leaks problems? It doesn't make sense to spend so much time trying to fix the light leak issues or even better have a clone or paint brush to fix the leaks in the lightmaps. The gpu baker works really fast but light leaks issues exist.
  • JordanN
    Options
    Offline / Send Message
    JordanN interpolator
    UE4 is very weird like that. It always seemed like Epic rushed this feature after the SVOGI fiasco didn't work out.

    That said, there's nothing stopping you from using 3rd party plugins to get around these issues. That's something I wish I tried more earlier.
  • melviso
    Options
    Offline / Send Message
    melviso polycounter lvl 10
    3rd party plugins? Any suggestions? :- )
  • JordanN
    Options
    Offline / Send Message
    JordanN interpolator
    Octane
    Enlighten
    Beast

    Those are the ones I know from the top of my head. All the others ones are done outside the engine (i.e Mental Ray, Cycles, Vray etc). Or you can try another game engine which has more 3rd party support (Unity).
  • melviso
    Options
    Offline / Send Message
    melviso polycounter lvl 10
    Thanks for the suggestions.
     Lightmass still seems like the better choice since it's designed to work with assets and real time reflections/specularity. Using external lightmap would be a problem to set up for every asset, let alone if changes are made to assets or materials.
    The gpu lightmass baker is very fast. I will just have to deal with the light leaks till that is solved by the developer. It's still in its early stages. Hopefully it's looked into in the not too distant future.
    Octane is working towards something like this gpu lightmass baker.
  • melviso
    Options
    Offline / Send Message
    melviso polycounter lvl 10
    Guys, I am trying to change the TDR settings to 300. I did some research and I found this:
    http://developer.download.nvidia.com/NsightVisualStudio/2.2/Documentation/UserGuide/HTML/Content/Timeout_Detection_Recovery.htm
    I can't find the nsight monitor icon. Does this come with Geoforce Experience ap? I don't install geoforce experience due to how slow it was. I install only the driver.
    Or is it a separate app entirely?
    EDIT: Nevermind. Problem solved. :- )
  • melviso
    Options
    Offline / Send Message
    melviso polycounter lvl 10
    Anyone know why this is happening. I have spent close to a week having lightmap issues:

  • musashidan
    Options
    Offline / Send Message
    musashidan high dynamic range
    @melviso There is an old-school plugin for Max called Flatiron. It hasn't really been updated in years but the devs still recompile and sell it. It's a complete ray-traced scene baking tool that is aimed at porting the baked lighting to real-time. Thought you might be interested.

    Edit: just found this vid from the devs that is only 2 months old:
    https://www.youtube.com/watch?v=1uz1Mw7YVvY

    https://www.youtube.com/watch?v=n3BrW-3-R38&index=8&list=PLF690AB6C2E4E6B72



  • melviso
    Options
    Offline / Send Message
    melviso polycounter lvl 10
    @musashidan Thanks for the suggestion. If its okay, I have some questions:
    What of tiling textures? Since it bakes everything to the diffuse with shadows and gi to one map. Does that mean I have to use very high res textures? It would be cool if one can bake out the shadows and GI separately and combine them with diffuse and reflection in unreal?

  • musashidan
    Options
    Offline / Send Message
    musashidan high dynamic range
    @melviso Have a look at the second vid I linked. He just bakes the lightmap. Flatiron also auto-unwraps the lightmap UVs. So this map you would plug into your lightmap in UE4 and use whatever textures you like for your materials. The beauty of this is that you can output offline quality lighting/GI and override UE4's static lighting.
  • melviso
    Options
    Offline / Send Message
    melviso polycounter lvl 10
    Thanks. How do u plug in the lightmap in UE4 and override the static lighting? I watched other videos of Faltiron and it is plugged into the emission slot.
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    Just a note here, by going around lightmass, by using external lightmaps, or dynamic lighting, you loose the most of the reflections, which gets baked into the reflection environment when you bake the lighting. Areas of the environment lit by stationary or static light will appear in the reflections, but dynamic light will only create specular highlight (reflection of the light source) and no reflected environment. I think this is a pretty important aspect, even though you can capture some cubemaps manually(no parallax correction and blending though).
  • melviso
    Options
    Offline / Send Message
    melviso polycounter lvl 10
    I remember reading something like that. So when u say baked reflection environment by lightmass, does this correspond to baked reflection from an external renderer or it's different? Also are u saying as long as I use a stationary, or static light source(directional) that matches the one using in the external renderer, the reflection would be correct?
    But what of bake reflection captures in ue4? can't one use this to bake reflection captures with the imported external lightmap?
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    No I'm saying, without a lightmass bake, you won't have reflections from the reflection captures. Only static and stationary lights makes reflections, in their baked state. You could work around by using externally captured environment maps, or by capturing them with hand inside unreal (using the scene capture cube actor) , and placing them into the reflection captures, but I believe, this way, they can't blend with each other.
  • musashidan
    Options
    Offline / Send Message
    musashidan high dynamic range
    Yes, this is an unfortunate downside. There used to be this variable that you could edit - 'r.diffusefromcaptures 1' - but it's been removed for some reason in the most recent versions.

    You still have screen space reflections, but they are a poor substitute.

    Or you could look into Enlighten https://80.lv/articles/dynamic-reflections-with-enlightendynamic-reflections-with-enlighten/

  • melviso
    Options
    Offline / Send Message
    melviso polycounter lvl 10
    That is really unfortunate. I am still going to give it a shot and see what happens.

    I was able to solve the lighting issue but I have had to remove the geometry for the wall panels and carvings  as this requires the lightmaps going up to 4k and increasing volumetric lightmass settings to high settings to capture the panels. I had to resort to normal maps which isn't the best archviz wise:


    Would have loved the silhouette and shadows. There are also lots of light leaks and artifacts due to the panel geometry on the walls. 
  • melviso
    Options
    Offline / Send Message
    melviso polycounter lvl 10
    Wow..testing external lightmaps using Blender cycles. The light maps are noisy cause I used low render settings:




  • melviso
    Options
    Offline / Send Message
    melviso polycounter lvl 10
    Tried to add geometry to the roofs, light leaks again. I think I might have to revert back to cpu lightmass. Seems the gpu only works in certain situations without issues. The question is with external lightmaps, light leaks issue is completely removed. Using them means reflection has to be baked externally too. Really wished UE4 had other renderers working with it. I don't get why there hasn't been efforts to solve this light leaks and uv maps issue.
    Any comments on the external lightmap images I posted? The reflection capture I baked seems to hold up quite well. Using external lightmaps might save time though cumbersome rather than spending weeks trying to fight to get light leaks and shadow issues sorted.
    @musahidan Have u use external lightmaps with ue4 before?
  • musashidan
    Options
    Offline / Send Message
    musashidan high dynamic range
    @melviso Not in a few years, mate. I used to use Flatiron plugin. Just wondered if you've thought about using Unreal Studio + Datasmith? Seems like it would be the perfect solution for you(Arch-Vis)

    Datasmith is still beta, but it's basically a one-click Vray/Corona entire scene to UE4(Unreal Studio)

    Also, check out this script for Max(useful for lightmap UVs)  http://www.scriptspot.com/3ds-max/scripts/steamroller

    This might also be worth checking out
    https://www.youtube.com/watch?v=fWRtSqMH_KE

    Edit: sorry I've assumed you're using Max throughout this thread. Are you? :)


  • melviso
    Options
    Offline / Send Message
    melviso polycounter lvl 10
    I haven't tried datasmith with ue4 tbh. I think it only handles material and mesh import. The light leaks problem still will be an issue.
    No, I am presently using Blender atm. My apologies, I should have mentioned that. I am also familiar with 3dsmax but I am using Blender atm.
    Thanks for the video link.
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    You can bake the reflections inside UE. Just place a scene capture cube, make a render target cube, assign the render target to the capture, and you can make a static texture out of it. So it can be used in the reflection capture.
  • musashidan
    Options
    Offline / Send Message
    musashidan high dynamic range
    Datasmith transfers Geo/Materials and textures/Lights/Cameras. Although there are some caveats, obviously, as things like Area lights from offline renderers and complex layered shaders are not supported. It does a pretty great job of converting the scene. It's probably about as painless a workflow as you can get for Arch-Vis.

    Out of curiosity, why are you using Blender over Max for Arch-vis?
  • melviso
    Options
    Offline / Send Message
    melviso polycounter lvl 10
    @Obscura Just figured out the lightmap issue. No more light leaks. Volumetric lightmaps seems sort of tricky especially how the probes are generated.
    @musahidan I am using a game engine for rendering archviz and Blender has been getting a lot of cool features and its free. It handles the job well. There is already a great feature coming called eevee and autodesk have been stalling with each new release. That doesn't mean I don't use 3dsmax anymore. At least, Blender does the job for now and no need to pay subscriptions. They are just tools tbh. The end result is what matters :- )
  • musashidan
    Options
    Offline / Send Message
    musashidan high dynamic range
    Yes, I was just curious. I've been using Blender myself for a little while, playing around when I get a chance. EEVEE is amazing. You can download Blender 2.8 nightly build and try it yourself. I'm very impressed with Blender. It's a terrific program. Incredible to think that it's only 100-odd meg and loads in 2 seconds. :)

    I was more wondering about the layout side of things. I haven't tested Blender on large or complex scenes with lots of elements, but Max is certainly king of the hill when it comes to that.

    I wouldn't exactly say that Max devs are stalling. I'm on the beta and the future is bright. Subscription prices are a bit of a joke though. blame corporate for that. Max devs themselves are doing great work. But hey, you can't beat free. :)
  • melviso
    Options
    Offline / Send Message
    melviso polycounter lvl 10
    Nice to know u are using Blender. 3dsmax can handle heavy scenes I agree. I have tried eevee.:

    Just a lighting test. 
    I do intend to go back to 3dsmax at some point but right now Blender is killing it. :smile: )
  • musashidan
    Options
    Offline / Send Message
    musashidan high dynamic range
    @melviso How do you find the fps performance in EEVEE? I've heard it chugs quite a bit on heavy scenes, but I suppose it's still in beta. When Nitrous viewport was introduced into Max it took quite a while to get it sorted. Now it looks like EEVEE is going to be the envy of all the other 3D programs.
  • melviso
    Options
    Offline / Send Message
    melviso polycounter lvl 10
    I haven't tried it with a heavy scene yet. The fps seems okay for the simple scenes I have experimented with. I think the higher your graphics card is the better. It is already the envy of other 3d programs. Recently, they added hair support:
    https://www.youtube.com/watch?v=PzgQiiQCTMo
    https://www.youtube.com/watch?v=zMjJ5hGn1Kw
    I see a lot of animators and archviz guys using it to get renderings out quickly. No need for unreal engine except u are creating interactive content
  • musashidan
    Options
    Offline / Send Message
    musashidan high dynamic range
    Yes, it is very impressive. Although don't throw UE4 out just yet...... real-time ray-tracing will be the next big step by the end of the year. Exciting times, my friend. )
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    Not sure if I should ruin your happiness guys, but if you watch the presentation by Epic games about this whole real time ray tracing parade, it turns out that they only used this tech on movable things, and the rest of the static stuff still uses lightmaps. And even then, you need a bunch of those titans. So I highly doubt that things will just change this quickly. We will see though. 
  • musashidan
    Options
    Offline / Send Message
    musashidan high dynamic range
    @obscura yeah man, I just watched the GDC presentation again. They did indeed use hybrid lighting, but they used the new area lights from 4.20 as static lights with ray-traced shadows in there as well.

    The rig they used was pretty insane, although with some help from Moore's law and the inevitable optimisations I could still see real-time ray-tracing eventually replacing baked solutions in the next 2 or 3 years.
  • JordanN
    Options
    Offline / Send Message
    JordanN interpolator
    @obscura yeah man, I just watched the GDC presentation again. They did indeed use hybrid lighting, but they used the new area lights from 4.20 as static lights with ray-traced shadows in there as well.

    The rig they used was pretty insane, although with some help from Moore's law and the inevitable optimisations I could still see real-time ray-tracing eventually replacing baked solutions in the next 2 or 3 years.
    If Otoy delivers on their promise, I think we could see ray tracing tech hitting PC this year.

    They promised to get their Brigade engine down from using 8 GPU's to just 2 (at perfect 30fps) by September of this year. That's a huge increase in efficiency while looking identical to their Octane software.

    It's also not just GPU power. Advancements in AI technology will also significantly speed up renders.

    I've been using a path tracer software that recently shipped with AI Denoising and it has helped cut down on rendering time that would normally takes hours to almost near minutes of having a crisp high resolution image.

    The current/next wave of Nvidia GPUs are going to ship with Tensor cores which are specifically optimized for AI calculations. Unfortunately, I do not have this card yet but from videos you can find online, the gap in real time ray tracing is nearly diminished.

    Of course, how this tech is used for games is a different story. VFX/TV Studios will want to use it because they can brute force anything they want. Arch Viz will use it because it could attract more customers to see photoreal mockups. For games, it might be a PC developer who hops on the technology first and delivers another Crysis. Even if the spec requirements are heavy at first, every other developer will look at this and be like "we want this stuff too!" and it will be a race to getting ray tracing running on every platform.
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
  • melviso
    Options
    Offline / Send Message
    melviso polycounter lvl 10
    Well, that's really cool to know. I wonder what graphics we will be looking at in the next 10 to 15 years : - )
    Lighting test Blender eevee:


    No lightmaps or light leaks!! Ue4 why aren't they using light probes?
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    It does use "light probes", when you use the legacy indirect lighting method for movable objects. I think its called indirect light cache. The information is still stored through a lightmass bake though, and it is not dynamic in any meaning. This is replaced by volumetric lightmaps now. 
    https://docs.unrealengine.com/en-us/Engine/Rendering/LightingAndShadows/IndirectLightingCache
    https://docs.unrealengine.com/en-us/Engine/Rendering/LightingAndShadows/VolumetricLightmaps
    Unity has light probes too:
    https://docs.unity3d.com/Manual/LightProbes.html
    I don't know if its dynamic, or pre calculated, like unreal's one. Like its describen in the Unity docs, light probes stores lighting information about empty spaces (in the air basically). It has a very grid-like nature, and you store some color, and intensity (guess) at each point. As the movable object passes through the points, the lighting value is sampled from the nearest points, and interpolates to the next one as the object moves and approaches the points. This is the "point sampled" method of indirect light cache, and it would give you a uniform value across the whole actor. You can change it to be purely interpolated, and then all nearby points would count and would be interpolated, so its not uniform. Useful for the indirect lighting of movable objects in a baked lighting scenario, but not really useful for static objects.
  • melviso
    Options
    Offline / Send Message
    melviso polycounter lvl 10
    My bad, I meant why isn't their light probes more like this.
    My issue with ue4 is it requires lightmaps, with uvs set up for it. With Blender eevee, this is not the case, I simply added a irradiance volume and it calculated the indirect lighting and the calculation is fast. U can also tweak the volume settings as well as specify the probe size and number contained in the volume, what I am hoping in future is the ability to move each probe within the volume to better areas that need lighting or probes that are caught inside geometry.

    I heard the Book of the dead demo by Unity used light probes for dynamic assets in the scene but I think there is more to the tech. The truth is if u can grasp how lighting works, u can create very realistic scenes with limited rendering features. only downside is the amount of work to achieve the desired look.
  • PixelMasher
    Options
    Offline / Send Message
    PixelMasher veteran polycounter
    if you want to work in AAA you are either going to be dealing with 100% realtime lighting engines which since most games are developed for console first, you wont be getting amazing realtime GI anytime soon or you will still be having to lightmap stuff, even if for bounce light/GI like how uncharted does it. or go 100% realtime and learn how to fake GI with hand placed bounce lights etc.

    if your goal is to work in a game studio, instead of looking for fancy tech to try and solve your problems with renders, learn how to troubleshoot lightmaps and how lighting works in game engines. Look at ashley mckenzie or harley wilsons artstations for some nice lighitng work inside ue4.
     https://www.artstation.com/noisecheck
    https://www.artstation.com/harleywilson

    If your goal is to work in games, I would try and construct a portfolio that is relevant to actual in game work being done in studios now and for the next few years as this console generation still moves forward
  • melviso
    Options
    Offline / Send Message
    melviso polycounter lvl 10
    Thanks for the link. That was very helpful. Studying them atm.

    I am an architectural visualizer and I am interested in tech that will enable rendering that is efficient and faster. Right now the archviz field is looking at using realtime tech due to some of the shortfalls and expensive cost of offline renderers especially for animations. Our workflow is quite different from games especially with textures, polycount, geometry and lightmap resolutions. Moreso, time is money. It isn't ideal to be spending valuable time struggling with light leaks or lighting issues especially in this field.
    There are already works been done with the eevee engine. Like I said, I am not writing unreal engine off yet. If archviz artists can use a realtime viewport to chun out high quality work, that would be helpful and faster. 
     However, using eevee is similar to ue4 in a lot of ways, as the workflow are kind of similar. I think a lot of artists here use diferent game engines in their place of work. Understanding the main concept of game engines and how they work is transferrable :- )

    Where I reside, there aren't any mainstream game studios here, I am not even sure if there are any tbh. If an opportunity arises, that would be pretty cool though :- )

    Further lighting refinement (wip):


  • musashidan
    Options
    Offline / Send Message
    musashidan high dynamic range
    @PixelMasher more and more we're seeing arch-vis studios/artists adopting real-time engines and real-time VR. It makes complete sense for their industry. And even though we're a few years off real-time ray-tracing in the games industry, it is inevitable at some point. The VFX industry are already dipping their toes.

    But, of course, baked lighting is still going to be around for many more years to cater to lower spec medium.
  • PixelMasher
    Options
    Offline / Send Message
    PixelMasher veteran polycounter
    @melviso
    ah ok totally makes sense, I was assuming you were making game art stuff. I totally agree realtime archvis is gonna be massive in the coming years. here are a couple dope videos you can use for a good benchmark. I remember seeing some dude who was making paid tutorials for this stuff in unreal and they looked geat. edit: found it! https://3dw.mykajabi.com/ - think hes got a youtube channel with some free content as well.

    https://www.youtube.com/watch?v=E3LtFrMAvQ4
    https://www.youtube.com/watch?v=OzmNpF0yIkg
  • melviso
    Options
    Offline / Send Message
    melviso polycounter lvl 10
    @PixelMasher I have experimented with ue4 for archviz with the tremendous help with questions from some awesome people here. Thanks for the links.


    U can check out this guys's work:
    https://www.youtube.com/watch?v=UwEuSxAEXPA
     If I am correct, he is the one who sparked the use of unreal for archviz work and got a lot of archviz companies interested in the tech with his high quality work..



  • melviso
    Options
    Offline / Send Message
    melviso polycounter lvl 10
    Found fhis while doing some research on environments in ue4. Here the devs switched to dynamic lighting due to lightmap issues. I also intend to check out their other videos. Very resourceful for those interested in making games as well.
    https://www.youtube.com/watch?v=c2YL9L-OZg4
  • melviso
    Options
    Offline / Send Message
    melviso polycounter lvl 10
    Further test of Blender eevee:
    Sun shadows aren't accurate when doing an opengl render. It's accurate in viewport though

Sign In or Register to comment.