Home Technical Talk

Normal map compression(?) artifacts

Hello there polycounters,

I've been trying out UDK today, and I'm loving it so far! Now I've tried to import my (subdivided for UV-tiling) plane with normal maps and the lot, and the first snag I really ran into was an issue I've had in the past with normal maps. What seems to be compression artifacts.

Normalmapissue.jpg

At first I was pulling my hair out, as usual, but then I figured I'd check my map in PS. At first it didn't seem like it was the map's fault, but pulling out the magic wand with 0 tolerance told me that Blender (which I used for baking) wasn't so nice with planar surfaces. I then duplicated the layer in PS multiple times and put those layers on overlay to exaggerate the issues, which then became clear.

Untitled-1-1.gif

The stuff inside the hexagon on the bottom right is there because it's indented slightly.

I then redid the normalmap in Xnormal, and it removed the problems on the planar surface. The dent issue still remains though. The circle doesn't look the same in this picture as it used a different mip setting.

Normalmapissue2.jpg

Now this stuff is really driving me crazy, and I'm rather sick of running away from problems, so here I stand.

How do my fellow polycounters create normal maps that don't have these issues?

Or are these problems inherent to normalmaps and will I just have to cover them up with good diffuse and specular textures?


On another note; What's the best way to go about adding collision to a plane in UDK? Adding BSP underneith it?

Replies

  • MoP
    Options
    Offline / Send Message
    MoP polycounter lvl 18
    That's DXT compression, it works on a 4x4 pixel block basis for compressing. Any sort of gradients or colour changes will come out looking blocky (notice the edges of your indented circle in the bottom left there, for instance).

    These issues cannot realistically be avoided when using DXT compression, however you will probably find that as you add a diffuse / specular texture, the issues will become less apparent than when you're using a flat colour as your diffuse / specular.

    Something that can help counteract these artifacts slightly is subtle noise in the texture, but again you will never get rid of them completely. I'd recommend looking at it with a proper diffuse/specular applied, it will look a lot better already, and the more fine-grained noise (even if it's not very "heavy" noise) that you overlay onto the textures, the less apparent the issues will appear.

    There's no way around it without using a different compression method (which is unlikely in games, everything tends to use block-based compression of some sort or another), or you could use uncompressed textures, which is far more expensive in terms of memory (which again is why you will rarely find that in games).
  • Simmo
    Options
    Offline / Send Message
    Simmo polycounter lvl 12
    http://udn.epicgames.com/Three/NormalMapFormats.html

    This page has prety much all you need to know about normal map formats and compression etc for use in UE3.

    As for collision, if it's just a simple plane, uncheck "use simple collision" in the static mesh properties. This uses the actual geometry for collision. Better way to go about it is to make your own collision mesh though: http://udn.epicgames.com/Three/CollisionReference.html
  • Divine Rage
    Options
    Offline / Send Message
    I see. Thanks guys! That cleared up alot!

    Oh, and for the collision bsp stuff, I could've sworn one of the 3D buzz video tutorials on UDN contained a little piece about making BSP collision meshes and tying those to static meshes. I couldn't find it...

    EDIT:
    Simmo wrote: »
    As for collision, if it's just a simple plane, uncheck "use simple collision" in the static mesh properties. This uses the actual geometry for collision.

    "Use simple collision" is under StaticMeshActor properties (F4)? If so, I can't find it. If it's found in the Static Mesh Editor, I've got three;

    Use simple box collision
    Use simple line collision
    Use simple rigid body collision

    I've tried pretty much every combination of enabled and disabled, but I just keep falling through the mesh.

    I also can't find what I'm looking for like this in the CollisionReference UDN page. Or I'm just looking in the wrong places.
  • Simmo
    Options
    Offline / Send Message
    Simmo polycounter lvl 12
    Sorry, yeah I meant the editor. I just woke up before :p

    http://udn.epicgames.com/Three/CollisionReference.html#Collision Models

    You will have to set the static mesh to have COLLIDE_BlockAll under collision inside the static mesh properties in the level as well. The BSP option works, I believe you can even convert BSP to a mesh. As long as it's convex it will work as collision
  • Divine Rage
    Options
    Offline / Send Message
    I'm beginning to think I need to blame Blender. Something I noticed earlier now makes me think exporting to .fbx from Blender is causing my problems.
    The plane I'm using has 5 subdivisions, and thus 6 quads. 6 quads = 12 tri's. A total of 14 vertices. The Content Browser in the UDK tells me that the static mesh has 24 triangles and 42 vertices.

    I'll just mess around with that tomorrow. I'll update with success or failure, but it's 00:46 right now and I'm tired. :)

    Anyway, thanks alot!
  • Divine Rage
    Options
    Offline / Send Message
    This is frustrating. I've tried everything. I've even rebuilt my mesh from the ground up in max, figuring it's exporter should work correctly, but it still won't work.

    But even using my builder brush as collision mesh ("Set Collision from Builder Brush...") didn't work. What am I to do?
    If someone can tell me what exactly I should upload, I'll do so hoping anyone here can figure it out...

    I'm using the may 2010 UDK build. First shot was with Blender 2.49b and it's pre-packed .fbx exporter, then I tried it with 3ds Max Design 2009 x64.

    I'm guessing I'm doing one tiny thing wrong, and it's causing my so much trouble... :(

    EDIT:
    Ugh! Found it. The issue was under static mesh editor, LODInfo > [0] > Elements > [0] > Enable Collision. Which was unchecked. Combining that with disabling all the "Use Simple ..." checkboxes fixed my problem.

    Finally.
  • Snight
    Options
    Offline / Send Message
    Snight polycounter lvl 16
    Something I noticed earlier now makes me think exporting to .fbx from Blender is causing my problems.
    The plane I'm using has 5 subdivisions, and thus 6 quads. 6 quads = 12 tri's. A total of 14 vertices. The Content Browser in the UDK tells me that the static mesh has 24 triangles and 42 vertices.

    Make sure you are only exporting your selected mesh and not anything else in the scene. If you have multiple smoothing groups on your object your vert count will go up when you import into unreal, but your triangle count should be the same. If you're still having issues, you could try using the .ASE format.

    But even using my builder brush as collision mesh ("Set Collision from Builder Brush...") didn't work. What am I to do?
    If someone can tell me what exactly I should upload, I'll do so hoping anyone here can figure it out...

    If you want to make collision based off the builder brush make sure you have the object selected first, THEN Ctrl click the builder brush, right click, then create collision from builder brush. That should do it.

    Hope that helps!

    -Mike
  • Divine Rage
    Options
    Offline / Send Message
    Apparently I had exported another object from blender, causing the doubled tri/vert count. It was extremely small, so I didn't notice it, and inside Blender it was hidden.
    By default Blender has no export script for .ASE, I'm not sure if there's one but I'm pretty sure there is somewhere.

    Also, the UDN doesn't mention that I should also have the builder brush selected:
    Place the static mesh that you want to add a collision model to into a level. Then place the builder brush around it in the shape you want the collision model to be. Keep it as simple as possible! Then select the static mesh, right click and choose Save Brush As Collision from the context menu. This will take into account any scaling you may have applied to the static mesh.
    It is very important to note that this collision will be added to ALL instances of the static mesh you have selected. To see the effect of saving the brush as collision you will have to save the package that contains the static mesh.

    Oh well, I've finally got it now, so I'm not that worried anymore. Onward to do more experimenting! :D
Sign In or Register to comment.