Home Technical Talk

UT level editing: lighting info?

Ryno
polycounter lvl 18
Offline / Send Message
Ryno polycounter lvl 18
Hello all. Anyone have any good information about lighting in UT? Specifically, can lightmaps be used, and if so, how? I'm working on trying to get a level together, and want to do most of the design work in Max, then bringing things into UnrealEd from there. Stuff seems to be coming in fine, but when I add lights to the map in UnrealEd, the shading on the static meshes looks really bad. Some things are shadowing, some things aren't, etc.

It appears to be doing some type of vertex lighting on the static meshes, but it looks pretty bad in a lot of spots. Will subdividing my mesh help with this issues?

My preference would be to avoid the whole issue by using lightmaps with baked radiosity. But if this isn't possible, could anyone give me a tip for getting the static meshes to light well?

Also, is it kosher to export a large model consisting of various elements all at once for ease of placement? Or is it better to do things in little chunks?

Any tips or good resource sites? I've already hit up UDN, but there's no mention of lightmaps, and only a cursory mention about how lights affect static meshes.

Replies

  • KDR_11k
    Options
    Offline / Send Message
    KDR_11k polycounter lvl 18
    Static meshes are lit by vertex colors and vertex lighting, AFAIK. You could bake radiosity to the object's texture, though.
  • Husch
    Options
    Offline / Send Message
    Husch polycounter lvl 18
    If you are using 3D max to create static meshes you can use the free plugin Jamlander to export Geometrie out of Max into UnrealEd. I think you can also set a flag to convert the geometry into BSP Brushes which can use Lightmaps.

    Read about it and download it here:
    http://ridgers.org.uk/jamlander/
  • Kevin Albers
    Options
    Offline / Send Message
    Kevin Albers polycounter lvl 18
    Usually it's best to have large objects such as buildings, large rooms etc divided into smaller pieces, so that the game engine isn't wasting resources "thinking" about things that are not in view of the camera.
  • Ryno
    Options
    Offline / Send Message
    Ryno polycounter lvl 18
    [ QUOTE ]
    Static meshes are lit by vertex colors and vertex lighting, AFAIK. You could bake radiosity to the object's texture, though.

    [/ QUOTE ]

    Yeah, I kind of figured that. Ughhh. Vertex lighting is such an ugly pain.

    I know that I could bake the lighting into the texture, but this kind of defeats the purpose of re-usable textures. And if I bake lighting and set them to fullbright, will characters cast shadows?

    What a headache.

    I might test out the convert to BSP idea, but will this hurt the performance, and/or will it interpret slightly more ornate modeling correctly?

    Thanks all,
  • ndcv
    Options
    Offline / Send Message
    ndcv polycounter lvl 18
    Converting stuff to BSP definitely kills the performance, but if you want other objects to cast shadows on it, I think that's the only way it's going to happen.
  • CrazyButcher
    Options
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    bake the lighting as occlusion map, ie setup radiosity that lits the object from all sides (well better say top hemisphere, if you know it will never be lit from bottom), that way stuff that would naturally not receive much light no matter from where it comes, will be darker.
    and vertex lighting will still do the "main" part
  • Eric Chadwick
  • Ryno
    Options
    Offline / Send Message
    Ryno polycounter lvl 18
    Yeah butcher, I bake lighting all of the time, and understand the concept. But the way UT handles lighting with vertex lighting is just not my preference. It is a real pain to have to subdivide my mesh to living hell just to get it to light correctly.

    Maybe you could explain a bit more about how UT does vertex lighting. If I do bake in vertex colors, then pop a model into UT, I will need to add lights to the scene to light my characters obviously. When I do this, the lights will continue to affect my geometry. My question is whether this light will be additive? Will the lighting that I dialed in for the Max scene and vertex baked get blown out by the UT lights when I add them? These lights are essentially coloring the vertices too, correct? Will this override the light/color bake that I do in Max/Maya? Will there be discrepencies between the lighting on the characters and the lighting on the static meshes?

    It would be preferrable to just use true radiosity baked lightmaps in UV channel 3, and then just using UV channel 1 for the usual color texture maps. This is the standard workflow that I've used for games that I've worked on, and it works really well. It's much more forgiving than having to ensure proper mesh subdivision just so the vertex lighting behaves properly. Is UT even capable of this multi-texture style lightmap blending?

    Sorry to be such a pain, as I really do appreciate the help. It's just that with having used baked UV channel 3 lightmaps, I'm used to a pretty high quality standard with a pretty straight forward workflow. I've been really disappointed with UT's approach to the issue so far, and was hoping someone had some tips to smooth things out.

    And thanks for the wiki site, I'd seen it before but forgotten about it.
  • Eric Chadwick
    Options
    Offline / Send Message
    I could have sworn I saw a detailed tutorial about how UT handles static vs. dynamic lights, with nice helpful images. Will try to dig it out.

    Not sure if this helps, but have you seen this thread?
    http://www.cgtalk.com/showthread.php?t=168514
  • Ryno
    Options
    Offline / Send Message
    Ryno polycounter lvl 18
    Yeah, that was exactly what I was thinking of doing, but not looking forward to. It's one thing dicing up geometry when it's a cylinder and a plane, another when it's staircases, ornate reliefs, trees on uneven ground, etc. Baking out lightmaps is just sooo much easier. Oh well, I guess if it were too easy, we'd all be unemployed.

    Thanks Eric.
  • Eric Chadwick
    Options
    Offline / Send Message
    It seems they pretty much lay it all down here.
    http://udn.epicgames.com/Two/LightingOnSurfaces#Lighting_on_Static_Meshes
    If it's BSP you can use lightmaps, if Static Mesh you're stuck with vertex lighting.

    But then again I've never developed for that engine.
  • Fordy
    Options
    Offline / Send Message
    Fordy polycounter lvl 18
    Have you seen gradients static mesh tutorials? (the texture baking sections)

    http://www.planetunreal.com/fordy/gradientssmeshtutorials/contents.html
  • Ryno
    Options
    Offline / Send Message
    Ryno polycounter lvl 18
    Hey Fordy, that's exactly what I was looking for, thanks tons! Excellent work, nice tutorials!

    A couple more questions, though. I was planning on doing virtually the entire level's geometry in Max, and baking out lightmaps. If I set the UEd materials to bUnlit true, will any of this geometry receive shadowing from the player models? Do static meshes ever receive shadows from player models? Also, do you find it tough to get the lighting for the players to be similar in appearance to the baked lightmapped environment? Any other tips here?
  • Fordy
    Options
    Offline / Send Message
    Fordy polycounter lvl 18
    Hi. I think player shadows are cast using projectors and they will cast a shadow on to any mesh you make that has the bAcceptProjectors display property set to true.

    The only problem with using vertex colours to blend textures on your static meshes is that you need to set bUseDynamicLights to False (found under Display for the StaticMeshActor Properties). This is to prevent the opacity from flickering between opaque and transparent when muzzle flashes, cause by nearby weapons fire, light the model.

    Theres not much you can do about the light from the players matching the environment, what is hard though is getting your static meshes to be suitably lit, that is look as though they were lit by the lights in the editor.

    If I were you id just do a very small test before setting about an entire level.
  • Moz
    Options
    Offline / Send Message
    Moz polycounter lvl 18
    here is a simple solution.

    Use shaders.

    to bake the lighting, and for each different texture you give it its own lightmap, (for all the static meshes that you are going to bake lighting on)

    then use tex scaler and stick it together with a combiner. and wrap it up in a shader.

    I'm not sure on the exact science, just open up the UT2003 into and look at the static mesh that makes up opening basement lobby area. (you might have to click show all to see it)
  • Fordy
    Options
    Offline / Send Message
    Fordy polycounter lvl 18
    Moz, you dont need to give each individual texture on a static mesh its own light map. i lightmap will do for the whole static mesh, regardless of the number of textures applied to it.
Sign In or Register to comment.