Home Unreal Engine

Lighting Dynamic Objects properly?

Graylord
polycounter lvl 9
Offline / Send Message
Graylord polycounter lvl 9
Hello!

I am having an issue with interpactors in my level, I am currently unable to light them properly from all angles.

As far as I know, dynamic objects can only have one light source.
This means that I can only light them from one angle. While I don't mind parts being in the shadows, the issue is that this makes all speculars and normal maps completely flat.
A large part of my level looks basically unlit because of this.

I am aware of light environments, however, light environments don't seem to effect speculars and normals. All it does is colour the object rather than making the shadows black, basically.

This is one of the assets in question:
asset_zpsfd62ddca.jpg

With the lighting in the level coming from above, it looks roughly as expected.
Top_zpse87f3bd5.jpg

However, from the sides, where a large part of the gameplay takes place, it looks like this:

Side_zps7c4262d1.jpg
This is absolutely horrible. (The objects on the sides are also interpactors, and thus look just as bad)

Any ideas?

Replies

  • Hourences
    Options
    Offline / Send Message
    Hourences polycounter lvl 18
    It is using a light env right now, I suppose (unless you turned that off), so to improve it you could:

    Lightmap the meshes so the lighting is baked in. This is most seamless but doesn't work if the pieces animate in such way that it is obvious the lighting doesn't update. This would also be fastest for performance. You'd need to disable shadow casting on all interpactors for this.

    Turn off light environment and light all interpactors out with dynamic lights to get accurate per pixel dynamic lighting. use light channels to have the dynamic lights only affect the interpactors (you'd want to keep it at the dynamic light channel actually for technical reasons, turn off the rest).

    You can also apply an ambient color overlay and (I believe) change shadow color of light environments to help objects blend in more, though this require editing of the meshes in Notepad since Epic removed access to it via the properties. This can work quite well, The Ball is full of that trick and has all interpactors blend in ok because of it. I also almost always turn off shadow casting of interpactors due to the dynamic shadow almost never working as it should.
  • Graylord
    Options
    Offline / Send Message
    Graylord polycounter lvl 9
    Hourences wrote: »
    It is using a light env right now, I suppose (unless you turned that off), so to improve it you could:

    Lightmap the meshes so the lighting is baked in. This is most seamless but doesn't work if the pieces animate in such way that it is obvious the lighting doesn't update. This would also be fastest for performance. You'd need to disable shadow casting on all interpactors for this.

    Wait, it's actually possible to light dynamic objects as if they were static meshes? Their animations aren't drastic, so any specular+normal lighting would do what I ask for aplenty.

    How would you make them bake lighting like this? AFAIK, it dynamic meshes in UDK skips lightmass no matter what.
  • Hourences
    Options
    Offline / Send Message
    Hourences polycounter lvl 18
    Properties - look for Use Precomputed Shadows and set to true.
    Go to the Light Channels in interpactor properties, turn on Static, turn off Dynamic.
    Ensure mesh as lightmap uvs and resolution obviously.
    You might want to disable shadow casting on it.
    Rebuild.
  • Graylord
    Options
    Offline / Send Message
    Graylord polycounter lvl 9
    Ah, cheers, that seems to do trick! Excellent stuff. :D

    I'm having a couple more issues though.

    I have another dynamic object lit by a spotlightmovable, it needs to be dynamic as it's spawned with a random mesh each game start. The spotlight by itself lights the object how I want it, but the scene is mainly lit by a dominant pointlight, which seems to take priority before spotlight, making the lighting poor, like the above issue. I tried using lighting channels, setting the spotlight and the dynamic object to their own channel (Unnamed 1), but it doesn't seem to help. I also tried to disable the "accept dominant dynamic shadows", but it still doesn't seem to get lighted by spotlight. Any ideas about this?
    I understand why the dominant light would do this, but I thought the closest dynamic light took priority?

    The reason I am using a dominant rather than static lighting for the level (now that the above objects use static lighting rather than dynamic), is to light the characters properly.

    Thanks again, I don't mean to undermine your help with more issues. :P
  • Hourences
    Options
    Offline / Send Message
    Hourences polycounter lvl 18
    So problem is you have another dynamic mesh and it doesn't receive the right color/brightness? Not talking about static geometry right?

    Dominant doesn't really mean dominant, it has a different way of rendering shadows. That is the main thing that it does differently, the name isn't very fitting.

    The light with most intensity takes prio on dynamic meshes, not the one that is closest. Using light channels can indeed help.

    Feel free to show some pics to clarify more what the problem is.
  • Graylord
    Options
    Offline / Send Message
    Graylord polycounter lvl 9
    Hourences wrote: »
    So problem is you have another dynamic mesh and it doesn't receive the right color/brightness? Not talking about static geometry right?
    Correct.
    The light with most intensity takes prio on dynamic meshes, not the one that is closest. Using light channels can indeed help.

    Feel free to show some pics to clarify more what the problem is.
    Sure.
    The dominant pointlight is the brightest of the two I'm afraid.

    Light3_zps7e303088.jpg
    As you can see, I have a spotlight lighting my dynamic mesh.

    Prize1_zps26468ec1.jpg
    However, with the dominant pointless in the main part of the level, it turns out like this.

    Prize2_zps9172ca89.jpg
    As soon as I remove pointlight it looks like this instead and gets lighted properly.

    The light and the object is set to their own lighting channel, but it doesn't seem to have an effect.

    Was lighting channels broken at one point? I am stuck with the March 2012 build.
  • Hourences
    Options
    Offline / Send Message
    Hourences polycounter lvl 18
    Could it be receiving a dynamic shadow casted by other geometry from that dom light? And that shadow may incorrectly blend on top of other light? I just built a quick test case and it works for me though. I am not aware of light channels ever having been bugged, however dom lights are fairly new and seldomly used (point and spot at least) so you never know what bug may exist with those.

    Try to disable shadow cast on the mesh also.

    Turn off Use Boolean Env Shading also on the mesh. Try Syntheize SHLight on.
  • Graylord
    Options
    Offline / Send Message
    Graylord polycounter lvl 9
    Hourences wrote: »
    Could it be receiving a dynamic shadow casted by other geometry from that dom light? And that shadow may incorrectly blend on top of other light?

    I thought you were onto something here, since the problem area is beneath the level. So I just moved everything somewhere it wouldn't recieve shadows from my level, while it generally became brighter, it stilll appeared unlit (only light environment, no speculars and normals affected)
    Hourences wrote: »
    I just built a quick test case and it works for me though. I am not aware of light channels ever having been bugged, however dom lights are fairly new and seldomly used (point and spot at least) so you never know what bug may exist with those.
    Hmm, fair enough.
    Hourences wrote: »
    Try to disable shadow cast on the mesh also.

    Turn off Use Boolean Env Shading also on the mesh. Try Syntheize SHLight on.

    I tried all of these, I'm afraid they make no difference, except the boolean obviously made the object brighter in general, but still "unlit", as in not recieving any lighting influence to the material.

    After some testing, it would appear that the light channel only affects light environment, and the dominant light still has priority over the actual lighting.
    This seems to be the case even if I make the spotlight brighter than the dominant light.

    Edit: I think I have figured out a solution. It seems like movable and dominants (probably dynamic lights in general) like to fight about what's within eachothers radius. I moved the object out of the dominant light's radius, and it now lights properly again.
Sign In or Register to comment.