Home Unreal Engine

Importing a sphere. Why so hard?

Hi there.

I'm working on a small game for my portfolio. I've followed some UDK tutorials before, so I'm somewhat familiar with how the program works, but I'm not an expert. Before I created too many assets, I wanted to run some tests, just to make sure I wasn't doing anything wrong or missing something. I'd hate to have to go back and remodel every static mesh. So, I did a simple test and ended up with an abomination. Let me take you on a step-by-step journey of my process, complete with screenies, so that you can spot any mistakes I made.


In 3DS Max, I made a box, converted it to an editable poly, assigned a single smoothing group to everything, and applied TurboSmooth.

BXPzZT2.jpg


I unwrapped the mesh on two UV channels, both identical. OK, I know I shouldn't have done that before TurboSmooth, but I didn't think it would make much difference. Besides, I also went back and re-unwrapped it after TurboSmooth, but my results were the same. I didn't take any screenshots of that, so just image the UV islands are the same size and position, but rounder.

tyHY2hp.jpg


I wasn't worried about texture maps or collision for this test, so I was done with Max. I converted everything to an editable poly again (to collapse the stack) and exported it as an FBX file. I think I used the right settings, but my FBX version contains a few options that Epic doesn't mention in their slightly out-of-date manual.

I4rTTKw.jpg


I imported the file into UDK. I was pretty sure of the settings this time. My confidence is probably misplaced.

b8siNQO.jpg
QVClPwO.jpg


Upon importing, I get a warning about how my FBX version is so new that it's out-of-date. My UDK version is Feb 2014, the latest.
An out of date FBX has been detected.
Importing different versions of FBX files than the SDK version can cause undesirable results.

File Version: 7.4.0
SDK Version: 7.3.0
I created a very basic glossy material for my mesh.

vKi2xek.jpg


I created a simple test room using materials that came with UDK. I used a single point light with default settings. I plopped in my mesh and left the settings at default, including the lightmap resolution of 32. I set the map's lightmap quality to "production" and rebuilt all. I ended up with seams in both the lightmap and the specular highlights, not to mention all-around hideous shadows.

oRUUY4B.jpg


Just for the heck of it, I cranked up the lightmap resolution to a blistering 256, just to see what would happen. Well, the lightmap seams improved a little, but hell of hells, I think the shadows got worse! How is that even possible?

k2aqfx1.jpg


Just for some more heck of it, I decided to switch off the static lighting on my mesh and only use dynamic lighting. Aside from the fact that my white ball is now inexplicably gray, the specular seams are still there.

tS9GXQr.jpg


Now, all of these issues might be less noticeable if I added a diffuse map, but I did this test with the knowledge that this game will have "simple" graphics. Lots of static meshes will have little or no texture information, like a shiny new toilet... for example. Any feedback you can offer will be greatly appreciated.

Replies

  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    Looks like you still have the baked lighting on your sphere. If you want to go with dynamic lighting, make sure to uncheck "use global illimination, and check "force no precomputed shadows(This is how I remember how its called)" in the world properties. Check in "dynamic" in the light source's lighting channels, and unckeck "use precomputed shadows" in all your mesh's properties. Then rebake the lighting, and the lightimaps will go away, and you will see the dynamic lighting. If you want the lightmaps instead, just with better result, you can double the lightmap resolution, and you can disable the "lightmap specular" in the sphere's material.
  • sprunghunt
    Options
    Offline / Send Message
    sprunghunt polycounter
    all the blank space in your lightmap UV's get filled up with black pixels on the lightmaps. So if you unwrap a sphere into the UV coordinates you've shown here you'll get lightmap bleeding between the black spots and the lit spots.

    Unwrap your object with as few UV islands as possible to reduce this.

    Here's epic's tutorial on how to do this:

    http://udn.epicgames.com/Three/LightMapUnwrapping.html
  • paco
  • Steohawk
    Options
    Offline / Send Message
    Thanks for the help, everybody! I redid my unwrap and focused on making it as good as I could. I did two different unwraps, so that I could compare the results and determine which one was best.


    For the first unwrap, every vertex is snapped to a 32x32 grid. Assuming a lightmap resolution of 32, every face would have at least one pixel, and would never share pixels with other faces. However, there's still quite a bit of wasted space.

    QKYlvk6.jpg


    Just in case, I cranked the lightmap resolution up to 64.

    dNKqbdh.jpg


    For the second unwrap, I took the results of the first unwrap, rotated them 45 degrees, and scaled them up to take up as much UV space as possible. There's still quite a bit of unused space, but I couldn't think of a more efficient way of unwrapping a quad-sphere without creating more seams.

    nD97bTB.jpg


    Like before, I used a lightmap resolution of 64.

    qfRF9lb.jpg


    All in all, I'd say the lightmapping turned out better on the first one. It's not perfect, but I doubt I'll be doing too many solid white spheres in my game, so most of the inevitable lightmap seams will probably be too subtle to be noticed. If necessary, I could use vertex lighting on certain meshes, like toilets, where there's lots of solid color and too few places to hide UV seams. That said, if there's anything I could do better, please let me know.

    Other than that, I'm a bit surprised that the specular highlights are affected by the UV layout. The seams look as though I used multiple smoothing groups, even though I didn't. Is this normal? (no pun intended)
  • radiancef0rge
    Options
    Offline / Send Message
    radiancef0rge ngon master
    use vert bakes instead on an asset like this
  • ZacD
    Options
    Offline / Send Message
    ZacD ngon master
    You can also turn off Lightmap Specular in your material properties to get rid of specular seams.
  • sprunghunt
    Options
    Offline / Send Message
    sprunghunt polycounter
    Steohawk wrote: »
    Thanks for the help, everybody! I redid my unwrap and focused on making it as good as I could. I did two different unwraps, so that I could compare the results and determine which one was best.


    For the first unwrap, every vertex is snapped to a 32x32 grid. Assuming a lightmap resolution of 32, every face would have at least one pixel, and would never share pixels with other faces. However, there's still quite a bit of wasted space.


    For the second unwrap, I took the results of the first unwrap, rotated them 45 degrees, and scaled them up to take up as much UV space as possible. There's still quite a bit of unused space, but I couldn't think of a more efficient way of unwrapping a quad-sphere without creating more seams.


    All in all, I'd say the lightmapping turned out better on the first one. It's not perfect, but I doubt I'll be doing too many solid white spheres in my game, so most of the inevitable lightmap seams will probably be too subtle to be noticed. If necessary, I could use vertex lighting on certain meshes, like toilets, where there's lots of solid color and too few places to hide UV seams. That said, if there's anything I could do better, please let me know.



    The most efficient way to unwrap a quad sphere is in two UV shells like a baseball. It's not just about reducing seams but also about reducing the amount of the lightmap that is empty. This is because the empty space is filled with black. The mipmapping and trilinear filtering on the lightmap make sure that there's always a small amount of bleed.
    Putting your UV shells on an angle is the worst thing you can do and should be avoided at all costs.
    Other than that, I'm a bit surprised that the specular highlights are affected by the UV layout. The seams look as though I used multiple smoothing groups, even though I didn't. Is this normal? (no pun intended)

    Yes this is normal. You should read this article - especially the part "welcome to splitsvile":

    http://www.ericchadwick.com/examples/provost/byf1.html
    http://www.ericchadwick.com/examples/provost/byf2.html

    byf2_figure2.jpg
  • Steohawk
    Options
    Offline / Send Message
    Thanks guys. I was ready to run some tests with a few real models that I've already finished (some have actual textures), but it looks like that's going to have to wait a tad. Most of you probably got the same email I did today. Now I must see what powers UE4 will bestow upon me, and what challenges it will use to test my worthiness. Unless anybody has any words of warning before I make the plunge, I hope to be back in the swing of things in a few days... with a brand new engine.
Sign In or Register to comment.