Home Unreal Engine

Lighting/shadow issues

Why is my lighting and shadowing getting screwed up when I convert a Static Mesh to a Mover?

Exhibit A:

comparison.jpg
http://s20.postimage.org/vvcl7s0j1/comparison.jpg

The image on the top is of the Static Mesh. It's being illuminated by 3 dynamic (Movable) lights with shadow mapping enabled on all 3 of them. In addition to the lights, the material is being lit by a HDR texture. Everything looks great. The image based lighting works fine. The 3 dynamic lights look fine and each cast a shadow.

Now, the second image is with the head model converted to a Mover. All of a sudden only one shadow is being cast and the way that shadow interacts with the lighting has change (i.e. it looks like a pile of excrement.)

The last image is even worse yet. This is what happens when I remove all 3 lights from the scene. I have no idea why UDK is messing this up so badly.

Keep in mind this scene is being rendered with dynamic lighting + image based lighting alone. I have static light mapping disabled.

Replies

  • JamesWild
    Options
    Offline / Send Message
    JamesWild polycounter lvl 8
    Are these in the editor or in gameplay?
  • tharle
    Options
    Offline / Send Message
    tharle polycounter lvl 9
    if i remember correctly movers only cast and receive dynamic shadows from a dominant light source. this is obviously an optimisation for rendering speeds during runtime but can be a pain if you're just doing portfolio stuff.
  • lpcstr
    Options
    Offline / Send Message
    JamesWild wrote: »
    Are these in the editor or in gameplay?

    Editor Preview (Right Click > Play From Here)
  • JamesWild
    Options
    Offline / Send Message
    JamesWild polycounter lvl 8
    I think to get a good radiosity bounce off the floor you're going to need to build static lighting for everything but the head.
  • lpcstr
    Options
    Offline / Send Message
    tharle wrote: »
    if i remember correctly movers only cast and receive dynamic shadows from a dominant light source. this is obviously an optimisation for rendering speeds during runtime but can be a pain if you're just doing portfolio stuff.

    What a horrible limitation. And it doesn't even make sense, after all, you can have multiple shadow casting lights and move a "Static Mesh" around in the editor without any issues. If they can get dynamic lights and shadow maps working in the editor, then why can't they do the same in game? Makes no sense.

    Any way, even if that is the case, it does not explain the last image. There are no lights in that scene, so there should be no shadows.
  • JamesWild
    Options
    Offline / Send Message
    JamesWild polycounter lvl 8
    Dynamic objects take their lighting from "tags" scattered about the level during light building, which are populated only by static lights.

    It's not a deferred renderer, you can't have lots of dynamic lights shining on an object without crushingly expensive overdraw using multiple passes.
  • sprunghunt
    Options
    Offline / Send Message
    sprunghunt polycounter
    A light environment is what dynamic objects are lit with in UDK. This lighting scheme takes all the lights hitting one object and averages them down to 1 light. This is huge performance savings.

    to get proper ambient lighting on objects using light environments you should adjust the settings on the lights hitting it and the ambient values in the world info.

    The reason why the last one looks like that is because it has no lights hitting it. Down is the default shadow direction.

    http://udn.epicgames.com/Three/LightEnvironments.html
    http://udn.epicgames.com/Three/ContentBlogArchive.html#New Character indirect lighting settings
  • lpcstr
    Options
    Offline / Send Message
    Well, these composite shadows or w/e they are called are really doing a number on my shaders. The shadows seem to override the emissive portion of the material, causing it be be completely black.

    How can I prevent this?
  • lpcstr
    Options
    Offline / Send Message
    Hooray. I believe I found the solution. Under SMActor settings, Light Environment Component, there is an option to disable it. I believe this forces the engine to use the same (more expensive granted, but vastly superior) type of lighting that it uses on Static Meshes.

    Unless you are targeting 60fps on a 360, I see no reason for this type of ridiculous optimization. You don't need a deferred renderer just for 3 dynamic lights and 3 shadow maps.
  • r4ptur3
    Options
    Offline / Send Message
    r4ptur3 polycounter lvl 10
    some other flags I like to check on dynamic objects in UDK:

    Synthesize SHLight ... ON
    this will attempt to recreate spherical harmonics ... generally makes the object look nicer / do some cool bounce light effects.

    Use Boolean Environment Shadowing ... OFF
    UDK uses two lighting models; one for objects in shadow and one for fully lit objects. This flag will use just the nice expensive model and generate better shadows.

    Use Precomputed Shadows ... OFF
    This should turn off by default as soon as the object becomes dynamic -- if this is checked on the object will bake light maps when you run lightmass.

    and then the last one, which you found:

    Is Character Light Environment ... your choice :)
    This will use your lightmass importance volume data (a big 3d grid of lighting data) to light your object. This can be kind of glitchy and sometimes lights the object from below for no reason.


    If you favorite these options (press the yellow star in the top right of the properties window to turn favorites on, then press the star next to each option to favorite) it is real easy to just check them on or off when you convert objects.

    hope this helps!
Sign In or Register to comment.