Home Unreal Engine

Foliage settings for light baking in UE4?

jordank95
polycounter lvl 8
Offline / Send Message
jordank95 polycounter lvl 8

Trying to find some info here with no results and its just confusing me a bit more. I have a lot of grass in my outdoor scenes in my game Im making. Its currently all instanced using the foliage tool and its set to Static with cast shadow, cast dynamic shadow, and cast static shadow all checked.

My main question is - should I just set all foliage and grass to Moveable if my Directional Light is set to Stationary? I think the answer is yes, as I dont want to bake all the lighting info for all the grass/other plants. I have a ton of other rocks and other landscape objects that are set to Static for baked shadows.

But im also confused as to when to use certain settings like Distance Field shadows etc. Im creating a game with some friends for current gen hardware, but also possibly for a Switch release.

Replies

  • rexo12
    Options
    Offline / Send Message
    rexo12 interpolator

    The general wisdom is not to use baked lighting for most foliage. You can probably fiddle with the settings to keep the foliage static while disabling any light baking for it. (force volumetric lightmaps, disable static shadow, etc). Setting the foliage to Moveable is however the most direct way to do this.

    I'd recommend maybe looking at some of the sample projects on the Marketplace to see how they handle foliage too.

    But im also confused as to when to use certain settings like Distance Field shadows etc. Im creating a game with some friends for current gen hardware, but also possibly for a Switch release.

    This sounds like a scoping issue - are there any serious plans for a switch release? if not, don't think about it until there are, otherwise you'll just paralyse yourself. Distance field shadows should be the sort of thing you can toggle at build time depending on your target hardware anyway.

  • jordank95
    Options
    Offline / Send Message
    jordank95 polycounter lvl 8

    Hey thanks @rexo12 super helpful. There are serious talks about a Switch release, so trying to figure how to handle lighting for console/PC and then Switch.

    Also, I see foliage is by default set to Static with both Cast Dynamic Shadow and Cast Static Shadow ticked. If both are ticked, isnt that bad for performance? both adding to Lightmaps as well as being fully dynamic?

  • rexo12
    Options
    Offline / Send Message
    rexo12 interpolator

    isnt that bad for performance?

    It has a performance impact, i'm not sure it's necessarily bad (except for foliage). Shadows are only dynamically cast when they're in the attenuation radius of a dynamic light, so the dynamic cost is essentially free if there's no dynamic lights the object needs to react to. This is generally the behaviour you want for most objects - you would still want a scene with mostly static lighting to respond to dynamic light sources like a flashlight. On top of that, static lighting really only consumes memory, so you're not actually doing double-work on computation.

    Foliage has these default settings because that's the default setting for all static meshes, it doesn't necessarily imply a 'correct default'.

  • Fabi_G
    Options
    Online / Send Message
    Fabi_G insane polycounter

    I would definitely check out existing switch games made with UE to spot potential issues and solutions (Fortnite?). Certainly many challenges can be solved early with appropriate art-style and level layout.

    I would avoid baked light for large outdoor scenes if possible (considerable lightmap size (ofc depends on asset amount and lightmap resolution), authoring of lightmap UVs, lightbakes, ...). The situation might be different if you have level layout similar to connected rooms/arenas.

    Probably good to use quality switches for different platforms, drastically reducing foliage density and culling distance and disabling shadows for low end.

    As always, only testing will tell. Best to get the essential stuff figured out and noted down pre production. I imagine it's a huge pain to retroactively port a project that was freestyled to a platform like switch. Enough duct taping will happen anyways once unforseen issues come up :O

Sign In or Register to comment.