Home Unreal Engine

Point light (shader?) issue

polycounter lvl 8
Offline / Send Message
danshewan polycounter lvl 8
Hey guys,

So assembled some basic elements of my scene in UDK, and thought I'd try using a simple point light (with default parameters) in my scene to get a more accurate idea of the base diffuse textures, and I'm getting a pretty funky result - or at least not what I was expecting.


udklightweird.jpg


Right now, the material consists of just the diffuse and normal maps - is the lack of a specular map causing this? Should I be using a different light for previewing textures? Or is it something else? I'm still very new to the UDK, and as such I'm keen to iron out the (presumably) simple kinks so I can get a better idea of what my textures look like before making any serious adjustments in Photoshop.

Any suggestions?

As always, thanks in advance.

Replies

  • danshewan
    Options
    Offline / Send Message
    danshewan polycounter lvl 8
    Right, so it occurred to me that although easy, UDK's lightmapping isn't magic, and as such that would probably be a good place to start dissecting the problem.

    I went into the Static Mesh editor, and selected Mesh > Generate Unique UV's. Now, it's entirely feasible that I inadvertently changed the settings of the UV channel dropdown menus, as that's the only way I can think of I somehow ended up with four UV channels on a single mesh?


    udklightweird.jpg


    So, despite the number of channels weirdness (and the very low lightmap resolution setting, which I upped to 256 for tests with the same result), I tried creating basic lightmap UV's for a similarly simple mesh (resulting in just two UV channels this time, not four), and the lighting still looks funky using a single point light.

    So actually generating UV's for the lightmap seems to have been a step in the right direction, but this is how it looks with a point light set to a radius of 512, with a brightness of FIVE:


    moweird.jpg


    At least the majority of the surface is visible, but I've got some serious shadowing happening (indicated in red) towards either end of the mesh (outlined in blue). Surely the light should be much more intense with those settings?

    Any suggestions as to what I'm doing wrong would be awesome.
  • Ark
    Options
    Offline / Send Message
    Ark polycounter lvl 11
    Not a master at UDK myself, but make sure your not using 'unlit' mode on the shader itself.
  • Kharn
    Options
    Offline / Send Message
    Kharn polycounter lvl 8
    I know it sounds strange but check that when you export youve got no materials applyed, for some reason it plays on the UVs.
  • danshewan
    Options
    Offline / Send Message
    danshewan polycounter lvl 8
    Kharn wrote: »
    I know it sounds strange but check that when you export youve got no materials applyed, for some reason it plays on the UVs.

    Well, I re-exported the mesh to test this solution, and indeed the materials option was checked in the .ase export dialogue. However, this doesn't solve the problem, and in addition, I'm getting this error on import:


    newerrorh.jpg



    Since I used a simple planar map to create the UV's for the wall section, I even tried scaling the UV shell down a little in case this was creating the problem shown above, but that doesn't help, either. Suggestions?

    As ever, thanks in advance.
  • Kharn
    Options
    Offline / Send Message
    Kharn polycounter lvl 8
    Well only thing I can sugest is to try exporting the model to an .OBJ then reset max and open it and reexport it as the .ASE.
    Hopefully youll solve this so you can get on with Captain nemos office, wich looks sweet by the way.
  • danshewan
    Options
    Offline / Send Message
    danshewan polycounter lvl 8
    Kharn wrote: »
    Well only thing I can sugest is to try exporting the model to an .OBJ then reset max and open it and reexport it as the .ASE.
    Hopefully youll solve this so you can get on with Captain nemos office, wich looks sweet by the way.

    Well, re-exporting the mesh did fix the weird lightmap UV error message, but the lighting problem itself is still happening. Guess I've got some serious documentation to read today.

    And thanks for the kind words about the scene in general, but it's pretty frustrating to hit this kind of a roadblock over something so (presumably) simple. I didn't want to do much in the way of texturing without being able to see it in UDK, so I guess I'll have to use a viewport shader until I can figure this out.

    Thanks again for your help.
  • gamedev
    Options
    Offline / Send Message
    gamedev polycounter lvl 12
    Looking at some of your images I can tell you're smoothing groups are off (unless you've baked a full high res to low normal map for this wall section with edge control).

    If you're exporting from Max, first try fixing the smoothing groups. A quick test, but by no means the best solution, select all faces, then in the edit poly panel, under 'Polygon Smoothing Groups', set your smoothing angle to 45 degrees and press 'Auto Smooth'.

    Re-import the mesh now via .ase and you see nice hard edges, not big soft bubble like surfaces which seem to be adding to your shading issues in UDK.

    Post some images after you've done this.

    Cheers,

    Tyler
  • Zack Fowler
    Options
    Offline / Send Message
    Zack Fowler polycounter lvl 11
    Gamedev is correct. The main thing is that UE3 considers faces with no assigned smoothing group number to all be part of the same smoothing group. So if you made a box in MAX, selected all surfaces, and cleared its smoothing information it will display as hard-edged in MAX but completely smooth in UE3.

    To fix this without having to re-group things you had grouped together before, go to your editable poly and click "Select by SG". Then check off every number that shows up. Your selection will be every surface that currently has a smoothing group assigned. Invert that selection and apply an autosmooth with a very small threshold (like 5 deg) and you should be good to go.

    As for the UVs issue, check how many UV channels it displays when you first import. UE3 expects (but does not require) you to use the second UV layer for your lightmaps, which must be in the 0-1 range which is why it gives that error. Chances are you have garbage information stored in your second and third UV layers. Use the UV Mapping Clear modifier in max to clear out this garbage info.

    Since you are still in the process of doing your initial import of the mesh you would probably be better off making your lightmap UVs in MAX rather than using the UE3 auto generator. It's very easy to do if you aren't concerned with optimization, just copy over your primary UV layer to the second layer, flip back any inverted faces, and run an auto unpack.
  • danshewan
    Options
    Offline / Send Message
    danshewan polycounter lvl 8
    Thanks for the input, guys. I'll follow your advice when I get back to work a little later on, and post results and any ensuing questions!

    Thanks again.
  • danshewan
    Options
    Offline / Send Message
    danshewan polycounter lvl 8
    gamedev wrote: »
    Looking at some of your images I can tell you're smoothing groups are off (unless you've baked a full high res to low normal map for this wall section with edge control).

    If you're exporting from Max, first try fixing the smoothing groups. A quick test, but by no means the best solution, select all faces, then in the edit poly panel, under 'Polygon Smoothing Groups', set your smoothing angle to 45 degrees and press 'Auto Smooth'.

    Well, I had originally baked a high-res to low normal map for this particular section - probably a little much, given the simplicity of the model but I intended to do this to capture the bolt details, and then overlay an image-based normal map of the diffuse to capture the surface scratches etc in Photoshop. I used a planar map for ease and simplicity, and I figured that any texture stretching would be almost negligible and would likely go unnoticed.

    I tried the quick test as you suggested, and it seems to have solved the lighting errors inside UDK:


    successv.jpg


    You say that this isn't the preferable option - why is that, and what would be the best approach?
    To fix this without having to re-group things you had grouped together before, go to your editable poly and click "Select by SG". Then check off every number that shows up. Your selection will be every surface that currently has a smoothing group assigned. Invert that selection and apply an autosmooth with a very small threshold (like 5 deg) and you should be good to go.

    So if I use Clear All to clear the smoothing groups completely, selected all the faces of the mesh and used Auto Smooth with a setting of 5 degrees, would this work? Or do you mean using this in addition to the manually-assigned smoothing groups?
    It's very easy to do if you aren't concerned with optimization, just copy over your primary UV layer to the second layer, flip back any inverted faces, and run an auto unpack.

    How would I do this? Inside the UV editor window? Incidentally, using the UVW Mapping Clear modifier worked at clearing the garbage information from the third and fourth(?) channels, never come across that modifier before, thanks.

    Thanks for everyone's patience and suggestions.
Sign In or Register to comment.