Home Unreal Engine

UDK Lighting

polycounter lvl 4
Offline / Send Message
Notes polycounter lvl 4
My biggest problem atm is lighting within UDK...I get the mesh and material looking great in the preview window...but once it goes into the map itself the lighting kills me...does anyone know the light set up that UDK is defaulted to in the preview window???

Replies

  • sprunghunt
    Options
    Offline / Send Message
    sprunghunt polycounter
    The preview window uses dynamic lighting. Try placing your mesh as an interp actor or physics actor.
  • SirCalalot
    Options
    Offline / Send Message
    SirCalalot polycounter lvl 10
    Or try changing your lights to a 'Togglable' version of themself, such as 'SpotlightTogglable' etc.
    Whichever is easier :)
  • Joshua Stubbles
    Options
    Offline / Send Message
    Joshua Stubbles polycounter lvl 19
    If you're baking out your lighting, why not just run a lighting build set to preview, in order to quickly check the final visual?

    If it never gets the way you want, you can always add a dynamic light in that area, to get the desired effect. Just keep an eye on the lighting scene complexity and don't let it get out of hand.
  • Notes
    Options
    Offline / Send Message
    Notes polycounter lvl 4
    sprunghunt wrote: »
    The preview window uses dynamic lighting. Try placing your mesh as an interp actor or physics actor.

    replaced my meshes as an interp actor...oddly the lighting looks better on the mesh...why is that???
  • Amr0
    Options
    Offline / Send Message
    Amr0 polycounter lvl 6
    When it's an interp actor, it's lit with dynamic lighting (plus some indirect lighting) while a static mesh is lit usually only with lightmaps generated with Lightmass. These lightmaps in UDK tend to greatly wash out the details from the normal maps and make it look flat. Boosting the normal map intensity in the shader helps, but not nearly enough to make this issue go away completely.

    Another thing that helps is to reduce the number of indirect light bounces. It seems to me that the reason lightmass makes normal maps look flat is because light bounces will result in the geometry being lit from all directions instead of just one or two. So without lightmaps, if your geometry is lit with one light for example, pixels that are facing the light will be fully lit, while pixels facing away from the light will be completely black. The contrast is high. With lightmass, pixels that are facing away are not completely black - they are lit by the light indirectly after photons have bounced around. In addition, directional lightmaps only approximate the directional information of lighting environment, so even if you disable light bounces, pixels that are not facing the light would still receive some light. In fact, even if you use the high-res mesh without a normal map, it would still look flat. So it's not the normal map, it's UDK's directional lightmaps.

    Think of it as indirect light will find its way into the crevices and details represented in the normal map. So reducing the number of indirect light bounces and indirect light intensities will reduce this. One more IMPORTANT thing to do is crank up “Indirect Normal Influence” from the world properties (read about it on UDN or something).

    One final thing you can do is to also bake out an ambient occlusion map along with the normal map and use that to accentuate the details, though this may look odd if the mesh will be also lit with dynamic lighting.
  • sprunghunt
    Options
    Offline / Send Message
    sprunghunt polycounter
    Notes wrote: »
    replaced my meshes as an interp actor...oddly the lighting looks better on the mesh...why is that???

    I suspect you have bad lightmapping UV's or a poor normalmap. Images would help with debugging the issue.

    The dynamic lighting is more expensive. So in a shipping game you can't use this kind of lighting on every object.
  • Rigoberto1
  • Notes
    Options
    Offline / Send Message
    Notes polycounter lvl 4
    Amr0 wrote: »
    When it's an interp actor, it's lit with dynamic lighting (plus some indirect lighting) while a static mesh is lit usually only with lightmaps generated with Lightmass. These lightmaps in UDK tend to greatly wash out the details from the normal maps and make it look flat. Boosting the normal map intensity in the shader helps, but not nearly enough to make this issue go away completely.

    Another thing that helps is to reduce the number of indirect light bounces. It seems to me that the reason lightmass makes normal maps look flat is because light bounces will result in the geometry being lit from all directions instead of just one or two. So without lightmaps, if your geometry is lit with one light for example, pixels that are facing the light will be fully lit, while pixels facing away from the light will be completely black. The contrast is high. With lightmass, pixels that are facing away are not completely black - they are lit by the light indirectly after photons have bounced around. In addition, directional lightmaps only approximate the directional information of lighting environment, so even if you disable light bounces, pixels that are not facing the light would still receive some light. In fact, even if you use the high-res mesh without a normal map, it would still look flat. So it's not the normal map, it's UDK's directional lightmaps.

    Think of it as indirect light will find its way into the crevices and details represented in the normal map. So reducing the number of indirect light bounces and indirect light intensities will reduce this. One more IMPORTANT thing to do is crank up “Indirect Normal Influence” from the world properties (read about it on UDN or something).

    One final thing you can do is to also bake out an ambient occlusion map along with the normal map and use that to accentuate the details, though this may look odd if the mesh will be also lit with dynamic lighting.

    Makes sense that the bounce light from lightmass would effect the normals as well as the specular.

    @sprunghunt it wasn't the normals as much as the specular...i'll throw up some screens in a bit...this was a project for class which was turned in earlier today so it's done and i'm into my next project at the moment. Lightmapping wise, all I did was have UDK generate its own uv's for lightmapping. Was this a bad idea?
  • SirCalalot
    Options
    Offline / Send Message
    SirCalalot polycounter lvl 10
    It's not a terrible idea.

    Having UDK create it's own Lightmap UVs is a quick workaround, but generally you'll always get a cleaner and better-looking result if you make your own Lighting UV channel in your 3D app. This way, you can focus on specific parts of your model that would need more or less lightmap resolution.
    For example, you don't want a door-handle taking up more UV space than the door - but UDK won't distinguish between the importance of the two when generating.

    Edit: And I suppose you can be more economical with your 1-1 UV space too :)
  • Notes
    Options
    Offline / Send Message
    Notes polycounter lvl 4
    SirCalalot wrote: »
    It's not a terrible idea.

    For example, you don't want a door-handle taking up more UV space than the door - but UDK won't distinguish between the importance of the two when generating.

    Edit: And I suppose you can be more economical with your 1-1 UV space too :)

    Never considered that...that's good to know...practicality wise, do games that ship using UDK...say Batman, do they use this process? My teacher was always saying not to use lightmass cause it takes too long to build.
  • sprunghunt
    Options
    Offline / Send Message
    sprunghunt polycounter
    Notes wrote: »
    Never considered that...that's good to know...practicality wise, do games that ship using UDK...say Batman, do they use this process? My teacher was always saying not to use lightmass cause it takes too long to build.

    Lightmass is capable of running on multiple machines at once using the swarm system:

    http://udn.epicgames.com/Three/Swarm.html

    This speeds up rendering times immensely and studios like rocksteady will have this setup to work across their network.
  • Notes
    Options
    Offline / Send Message
    Notes polycounter lvl 4
    Ohhhhhh I've always wondered what the swarm screen was each time i ran lightmass...i gotta get my school to work this out somehow.
  • SirCalalot
    Options
    Offline / Send Message
    SirCalalot polycounter lvl 10
    It's pretty easy to set up.
    I had it running in my house, using my room-mates PCs.
Sign In or Register to comment.