Home Unreal Engine

Dynamic Shadows with Lightmass

polycounter lvl 12
Offline / Send Message
Quickel polycounter lvl 12
I've been working on trying to figure this out for a little while now and searched online and on here but haven't been finding a solution.

I have an interior scene and want to use Lightmass to bake out my lighting and I understand the UV channel 2 for static meshes in order to do this.

But I'm certain there is a way to have a dynamic light in the scene as well so that I can have shadows not so dependent on texture resolutions of lightmass and so I can see the shadows of my moveable objects and static objects casting onto my character.

I've tried several different lights and I either get:

1. Things like toggling 'Force no precomputed shadows' in World Properties keeps my dynamic shadows but doesn't bake in my lightmass.

or

2. Bakes my lightmass and makes my shadows baked in as well, ruining what I'm trying to achieve.

Can someone give me a pointer on what I am missing?

Sorry if this has been covered but I have been trying to look as I had mentioned.

Replies

  • AlexLeighton
    Options
    Offline / Send Message
    Grab your static meshes and turn off "cast static shadows", and make sure "cast dynamic shadows" is on. Also, go into lighting channels for your static meshes and make sure dynamic is checked. You will also need to tell your objects to not use precomputed shadows.
  • Quickel
    Options
    Offline / Send Message
    Quickel polycounter lvl 12
    Grab your static meshes and turn off "cast static shadows", and make sure "cast dynamic shadows" is on. Also, go into lighting channels for your static meshes and make sure dynamic is checked. You will also need to tell your objects to not use precomputed shadows.

    When I toggle off "Use Precomputed Shadows" on an object I get an error when baking:

    Performance Warning Untitled_6 StaticMeshActor_3 Static Mesh component 'MyPackage.Plane' not lightmapped and not using a light environment - will be inefficient and have incorrect lighting! Set bUsePrecomputedShadows=True to use lightmaps or enable the light environment
  • Parkar
    Options
    Offline / Send Message
    Parkar polycounter lvl 18
    That would cause the static meshes to not cast any shadows in the lightmas calculations though. If I understand Quickel correctly what he/she is after is enabling dynamic shadows from a limited number of lights but let all other lighting be provided by lightmas.

    What I would do is add movable lights (doesn't mean they have to move :)). Quickest way is to simply select your static light and from the right click menu choose to convert to the corresponding moving light light. These are dynamic and if you change the shadow mode from modulate to normal they should also cast shadows (asuming everything else is using default values). Note that this will remove this light from the lighmas calculation though. If you want a combination you could place two lights in the same or almost same location and let one be dynamic.

    Only tried the above using the dx11 renderer though so might not be enough for dx9 but hopefully should get you on the right way.

    Something similar to what AlexLeighton suggest might be possible to get a sort of hybrid light source but I have found it a bit tricky when I have tried before.
  • Quickel
    Options
    Offline / Send Message
    Quickel polycounter lvl 12
    Parkar,

    Your method of using a moveable light worked perfectly. I tried using them before but perhaps I just had so much going on in the scene from trying to toggle things on and off I didn't get it to work. But starting a basic screen from scratch with Ligthmass doing my bounce and a moveable light to create dynamic shadows is working as I had intended. Now I just have to translate it from my simple scene to the interior I'm working on and see how it works there. I'll report back any issues.

    Thanks for your help all.
Sign In or Register to comment.