Home Unreal Engine

Problems w/ Modular Floors & Lightmass

Dave-Mastor
polycounter lvl 9
Offline / Send Message
Dave-Mastor polycounter lvl 9
Hello

I've been having this problem with this modular floor system and lightmass for a very long time. I've simplified the scene significantly for the sake of this thread.

These floor tiles are perfectly square static meshes, 192x192 UU. They have four subdivisions both horizontally, and vertically.

It has a perfectly square UV, with no seams; it even has a separate lightmap UV with no seams. The lightmap UV resolution is 64. The scene is also rendered with production quality lighting.

In the image I have attached, each tile is scaled to .99 percent, so they are not contacting eachother, in addition it is a screencap with detail lighting enabled, so you aren't seeing the diffuse.

As you can see, there are two problems: Tiles further away from the light are darkened entirely - instead of having a smooth gradient from light to dark, the further away the tile is. the entire tile is shaded darker - almost like each tile is a single pixel, in a rough gradient.

The second, and more pressing problem is the rotation issue... some of these tiles are rotated at 90, 180, and 270 degrees - causing the tiles to have completely different lighting, based on where the camera angle, resulting in the terrible patchwork appearance you see.

The regular material for the tile has diffuse, specular, emissive, and normal maps. At first I thought the problem was being caused by rotating the normal map - but as I peeled away the layers, and simplified the material and mesh, I found this problem to exist, even when there is a simple diffuse alone.

We are using modular tiles, which must be rotated occasionally. (For instance, a floor that has a certain detail across one edge.) Even using a solid bsp doesn't seem to fix the issue.

Replies

  • cholden
  • Dave-Mastor
    Offline / Send Message
    Dave-Mastor polycounter lvl 9
    Thank you for the suggestion, but it doesn't really help. I found that thread earlier, when I was looking for a solution.

    I gave it a reasonable read, but I didn't examine every comment. I'll go back and see if I can find anything more useful in it.

    The problem seems to be originating from nothing other than the rotation of the tiles... remember, those tiles have nothing but a material with a diffuse applied, no normal, emissive, or specular.

    The UE3 can't do simple flat tiles without breaking the lighting? I realize that Epic has special workarounds for this problem (Namely bsp with static meshes covering problem areas) but surely I'm not the only one who is trying to do a material other than roughly hewn stone!

    This problem essentially ruins the ability to make modular, clean tilesets (Or basically anything that isn't the grungy/industrial look that is in most of Epic's video games.)
  • Xendance
    Offline / Send Message
    Xendance polycounter lvl 7
    You really shouldn't do floors like that. You're using over 20 draw calls for that small piece of floor (Epic recommends less than 2000 draw calls). In this case I'd probably use BSP.

    But I do agree that lightmass isn't that stellar when you know its limitations :(
  • Dave-Mastor
    Offline / Send Message
    Dave-Mastor polycounter lvl 9
    Well see, that's exactly my point... If I use subdivided bsp for the floors, it doesn't solve anything aside from using less draw calls. It still has graphical shading errors if you rotate the textures(though many of the times when I rotate the texture on the BSP, the normal map doesn't rotate with it).

    I suppose there is just no way to have a clean sci-fi floor in the UDK, beyond a flexible, simple, tile-able texture?
  • DeadlyFreeze
    Offline / Send Message
    DeadlyFreeze polycounter lvl 11
    This is something I had to figure out when I did my modular sci-fi scene. It is possible and fairly simple if you plan out your UV'ing on elements that are going to be rotated.

    The issue with static meshes is the orientation of the UV's. If you want to rotate them they all need to be set in the same direction with multiple copies for each 90 degree rotation.

    Then you can just use a rotater in UDK to rotate the texture for each 90 degree version of your mesh.
  • unstoppablex
    I just tested this, it turns out fine with just a diffuse. it's either 1, you're using vertex lighting for the pieces and you are rotating the plain, and not rebaking or 2. you do have some type of specular in your material.
  • Dave-Mastor
    Offline / Send Message
    Dave-Mastor polycounter lvl 9
    Is there anything you need to do to remove the specular, beyond not having anything connected to the specular power or specular slots? Because believe me, there is nothing coneected there.

    Likewise, is vertex lighting defualt? How do you enable or disable it? As far as I can tell, I haven't changed anything, so if vertex lighting is enabled by default... then I am using it.

    As there any chance I could use a combination of append, rotate and power to disassemble rotate and reassemble the normal map -inside- of the material to make rotated versions? Would that even be more effective than just having separate normal maps?
  • DeadlyFreeze
    Offline / Send Message
    DeadlyFreeze polycounter lvl 11
    no idea what unstoppablex is talking about, vertex lighting has nothing to do with lightmap specular problem.

    If you want to simply turn it off you can do that in the 'misc rollout > allow lightmap specular', you don't need to unplug the specular input.

    Ya you don't need to use more then one normal map, as long as the UV's are correctly rotated on each mesh then you can do w/e inside UDK with your normals.
  • unstoppablex
    no idea what unstoppablex is talking about, vertex lighting has nothing to do with lightmap specular problem.
    if he isn't using specular map then it can't be a specular issue. by default vertex lighting will be on if you don't have second uvs. so if the lighting bakes and you rotate the planes you will get something similar to what he has in the photo.
  • DeadlyFreeze
    Offline / Send Message
    DeadlyFreeze polycounter lvl 11
    No, UDK creates two different kinds of specular, one happens in real time the other is pre-computed when you run lightmass.

    Disabling your specular input will only turn off the real time specular, leaving the lightmass specular on.
  • unstoppablex
    lightmaps wouldn't cause that issue. if he doesn't have a second uv channel he isn't even using lightmaps.

    Dave how about you upload that file so i can take a closer look what's going on?
  • DeadlyFreeze
    Offline / Send Message
    DeadlyFreeze polycounter lvl 11
    I never said lightmaps were the issue and they aren't. Lightmap specular is pre-computed from the UV's in channel 1, not your lightmap UV's.

    As long as you run lightmass and have static light then your are pre-computing lightmass specular. The only way to turn it off is in the misc rollout > allow lightmap specular.
  • unstoppablex
    D: no idea where you're getting this info from. below are some screenshots.

    first one i disabled lightmass to see if that effects the specular in anyway, it didn't. the second image shows one i have disabled allow lightmap specular, and the other i have just simply unlinked the specular node. they are both the same results.


    screen01mv.jpg
    screen02fo.jpg
  • DeadlyFreeze
    Offline / Send Message
    DeadlyFreeze polycounter lvl 11
    Dude trust me, I work this issue inside and out...

    I don't know how you have it setup or if you simply viewing it from the wrong angle. Sections 1 & 4 have lightmap spec disabled 2 & 3 have it on, none of them have any thing plugged into spec.


    n2g17.jpg
  • System
    Offline / Send Message
    System admin
    I know its not the correct solution, but for a few of the modular pieces in space madness we solved the weird specular not matching up by replacing the specular texture with the diffuse texture. lol super hacky fix but it worked.
  • Phrexeus
    Offline / Send Message
    Phrexeus polycounter lvl 6
    I'm having the same problem. Based on my experience I'm assuming the lightmass specular is not only based on channel 0 UVs, but also takes place in UV space, meaning that the only way you'll ever get decent lightmass specular is if all of the UVs in channel 0 are facing the "right" way (and even then I don't know if the specular relates accurately to actual lights in the scene).

    Does anyone know if this is true, or are we simply doing something wrong?

    For example here is my floor, with lightmass specular giving an obvious seam:
    r672i.jpg

    And here it is after moving the floor a bit (to cancel it's lightmass effect). The specular is so much nicer, and accurate to the scene's lighting instead of being over to the left like before:
    Qgyxr.jpg

    I'm going to try disabling lightmass specular on my entire scene, and try using dynamic lights (specular only) to get the proper specular in my scene while still having the lightmass shadows/ao. If not, then I'm stuck... cubemaps maybe?

    **Edit** - Same thing with normal map off, just in case anyone was going to ask: pic here
  • Phrexeus
    Offline / Send Message
    Phrexeus polycounter lvl 6
    Specular-only lights... is it possible? I can't find the setting, maybe I was thinking of cryengine. Seems like a ridiculous workaround anyway.
  • DeadlyFreeze
    Offline / Send Message
    DeadlyFreeze polycounter lvl 11
    There are two issues here with the lightmap specular, one with BSPs and one with static meshes. BSP need to have orentaion corrected in the normal (see this thread: http://www.polycount.com/forum/showthread.php?t=94585)

    Static meshes need to have a fixed orientation on the UV's.

    There are only 3 real fixes to this.

    A. Have proper UV orientation with rotated meshes / normal map for BSPs.

    B. Use completely dynamic lights

    C. Turn it off

    Pre-planning your orientation is really the easiest

    JYBHJ.jpg
  • ZacD
    Offline / Send Message
    ZacD polycounter
    So for each rotation of a static mesh you have a unique sm with just a different rotation and UV light map?

    In udk do you just never rotate a static mesh that will be baked?
  • DeadlyFreeze
    Offline / Send Message
    DeadlyFreeze polycounter lvl 11
    Yes (sort of). Lightmap specular is pre-computed and uses UV channel 1, you don't need to change lightmap UV's at all.

    Each static mesh will need to have it's UV's rotated in 90 degree increments, so you will have a max of 4 static meshes per modular piece(or less depending how much it needs to be rotated).

    It's ok to rotate static meshes you just need to be aware that this will crop up on modular pieces that are going to be adjoining and have high specular values.
  • ZacD
    Offline / Send Message
    ZacD polycounter
    I meant a rotate light map uv set, is that right or can you leave the lightmap uv set?
  • Phrexeus
    Offline / Send Message
    Phrexeus polycounter lvl 6
    Thanks for the feedback Deadly. So if I'm understanding this right, you would build 4 tiles all facing the same way WITH the UVs all facing the same way, and then rotate the UVs for each separately in the UDK's material editor?

    That's fine if you have nice square tiles, but look at my model and UVs...

    Om8nL.jpg

    Obviously it's going to be extremely difficult to position them correctly so that when I rotate in the UVs in UDK they move into the correct places. Is that basically what I've got to accept and live with, or am I missing something?

    Would probably be quicker to set up the entire scene in cryengine than the entire day or 2 I've spent wrestling with these (poorly documented... hello Epic?) issues.
  • DeadlyFreeze
    Offline / Send Message
    DeadlyFreeze polycounter lvl 11
    @zac, ya you don't need to rotate the lightmap uv's

    @Phrexeus

    Basically yes but you can't rotate the UV's inside UDK it has to be done in w/e software you use. UDK for what ever reason won't respect to rotation so it has to be imported in with the UV's rotated.

    In max it's easy to do with the UVW xform, make sure rotate center is on. Then you can just use a rotator parameter in UDK on a master mat since it's all the same texture.

    Ya really need to be aware of this ahead of time so you can compensate with your textures, it's hard to fix down the road. You could break off all the pieces that have matching orientation into different groups, it would be really hacky but it would work.

    edit:

    Thinking about it more you could use a whole different uv set to define the texture. So have UV channel 3 for the texture and make the proper correction on UV channel 1 to define the lightmap specular(since it always defaults to channel 1). Obviously not ideal since it's upping your vert count but more elegant then hacking things apart.
  • cptSwing
  • wes.sau
    Thanks for the flattery cpt Swing, my answer in that thread is a good solution when the desire is to have normal maps always align in the same direction/world aligned Uvs. And to be honest I didn't check to see if it fixes baked lighting/specular since the original poster's example problem was with dynamic lighting.


    Anyway it won't work in this case where the desire is to have the normal map rotated with the model... If I can free up some time tonight or tomorrow I'll look into it if nobody finds a solution.
Sign In or Register to comment.