Home Technical Talk

Wierd lighting in source and i have no idea what I'm doing

polycounter lvl 6
Offline / Send Message
zakhar2 polycounter lvl 6
So basically I've started making a level in source and im getting all sorts of weird shading on my static meshes. These props are really simple, have only 2 textures, (normals and diffuse), and the collisions are just boxes. I suspect that it has something to do with the normal map, but I'm not sure. The last image here basically shows what the props look like in the hammer editor.

ugXzy.jpg


Thanks in advance!

Replies

  • Butthair
    Options
    Offline / Send Message
    Butthair polycounter lvl 11
    Because you're getting that black streak originating from that corner, I'm assuming it has to do with the mesh and possible smoothing groups. It might be two unwelded vertices as well.
  • Drew++
    Options
    Offline / Send Message
    Drew++ polycounter lvl 14
    I'm thinking exactly what Butthair said.

    Any change of seeing a wireframe?

    I have a question... Are there faces on the top and bottom of this mesh? If yes, then you could probably delete those.
    questionoz.jpg
  • zakhar2
    Options
    Offline / Send Message
    zakhar2 polycounter lvl 6
    Thanks for the responses guys, here's a wireframe from maya. The entire mesh only has 1 smoothing group, all verts seem to be welded and there are no top or bottom faces. Im starting to think that maybe this is just how source is lighting the mesh? I do have a bunch of very thin triangles....

    sz8vE.jpg
  • Butthair
    Options
    Offline / Send Message
    Butthair polycounter lvl 11
    I'm going to hazard a guess and say to redo the smoothing groups at 90 degree angles. If you are using a texture not created from the model, the normals will act strangely (both mesh and texture normals). Set them to at a 90 degree smoothing.
  • zakhar2
    Options
    Offline / Send Message
    zakhar2 polycounter lvl 6
    What do you mean by "texture not created from the model"?
  • mike670
    Options
    Offline / Send Message
    mike670 polycounter lvl 11
    He means that if the Normal map was not baked from the model you will get artifacts because of your one smoothing group. You can either bake a correct normal, or harden your edges. Either way would work.

    It would also help to show us your maps
  • Butthair
    Options
    Offline / Send Message
    Butthair polycounter lvl 11
    Mike670 pretty much answered it, but I want to explain that when you bake normals to a model, the normal map texture you get from it is a combination of hi poly detail and the low poly smoothing groups (essential the mesh normals).

    If the texture being applied was created from a single plan surface, the mesh normals would need to match that to sync correctly.

    (Because a plane is perpendicular to it's facing direction, each face you have on this piece would be smoothed at a bias of 90 degrees to sync back to recreate the plane normals that the normal map was baked from.)
  • zakhar2
    Options
    Offline / Send Message
    zakhar2 polycounter lvl 6
    Yeah, i actually did bake normals from a mesh tho?

    Here's the normal map:
    FCVAk.jpg
  • Butthair
    Options
    Offline / Send Message
    Butthair polycounter lvl 11
    Ooof. That throws out that theory. Well then, there shouldn't be any problems with the texture map then.

    To return to the possibility that there may be unwelded verts? Revisit the mesh. If it's not that, then it might be the lightmap. Does source need lightmapped models? If you have a lightmap UVs, make sure there's enough spacing.

    If nothing else, and yes they may become tedious, but I would rebake the normals of the model set with 90 degree smoothing.

    I can't promise any of these solutions with solve it. This is generally what I do if there is a problem though. And I'll abuse this until it get's handled.
  • zakhar2
    Options
    Offline / Send Message
    zakhar2 polycounter lvl 6
    yeah, the verts are fine. Source actually seems to use vertex based lighting on static meshes, so there aren't any lightmaps. I guess i'll rebake everything tomorrow morning, which isn't too bad since i just started on these assets so im not really losing any work. Thanks for the help thus far!
  • csprance
    Options
    Offline / Send Message
    csprance polycounter lvl 13
    try triangulating the model before you export it to source and see if you get those errors. Looks to me like a smoothing issue. You could also try throwing an extra edge in there to help the engine figure out how it's supposed to be shaded.
Sign In or Register to comment.