Home Technical Talk

.md5mesh smoothing error (this time with triangles)

polycounter lvl 16
Offline / Send Message
Sam Hatami polycounter lvl 16
Alright, regarding md5mesh smoothing problems it's just been me and O'dium asking about it, cause we work on the same project.

I'm getting a better understanding of how the smoothing group for the md5mesh is created. But I'v started getting these new errors that I haven't encountered before. Maybe some of you guys who has more experience can figure out what's wrong, is it something with my workflow?

The places where the triangles show up hard has welded uv's so md5mesh isnt told to make a seam there.

Any idea what this is?


scope2hm6.jpg
scope1kp7.jpg

and the normal for that place

normalmapqa1.jpg

I'm eating my fingers, thank you for any assistance.

Replies

  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    That screenshot is from Max, right? Before it's been exported to MD5? Looks like you have some unwelded/double verts there, or maybe a change in smoothing group.
  • Sam Hatami
    Offline / Send Message
    Sam Hatami polycounter lvl 16
    Oh sorry, forgot to mention the important thing. No, this is the md5mesh re-imported in max using der_ton's scripts.

    But if you think about it,. the bases of the triangles are were the seams go. They are always double the amount vertices there when I re-import, but welding them and re-exporting doesn't seem to do the trick.

    And why does it only happen there?


    edit: or actually it's not the bases of the triangles, either way its the vertices at the seams that keep getting the double amount of vertices.
  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    Does it look like this in game?
    Because der_ton's importer might be loading it in a way which causes the splitting. MD5meshes shouldn't have a problem with geometry like that.
  • odium
    Offline / Send Message
    odium polycounter lvl 18
    Yes, it looks like this ingame. Not only does the .md5mesh have the error, but also the normal map.

    The triangles are welded both on the UV map and the actual base mesh, and there are no hidden back faces.
  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    Well if the mesh has the visible issue in game, of course the normal map will too (since the normalmap is generated using the in-game geometry...)

    I'd still suggest you have some dodgy geometry there. MD5mesh has never given me any visible issues like that before.
  • odium
    Offline / Send Message
    odium polycounter lvl 18
    Sorry my bad. Its not the .md5mesh at all, as such.

    The problem only happens when you re-import the .md5mesh back into Max 08. The exported .md5mesh doesnt have this issue, so it works fine ingame.
  • Sam Hatami
    Offline / Send Message
    Sam Hatami polycounter lvl 16
    Ah MoP, O'dium gave you the wrong answer. It DOES look fine ingame, we came to the conclusion that it certainly IS the importer, and thank you very much for the insight, now you've saved me alot of headache and ulsurs.

    I don't know whether the issue with der_ton's importer is for max 9 or something else. either way we have made a post on doom3world about this.

    Is there a way in max to weld the vertices so that the faces gets the same smoothingroup as the surrounding faces? As I saw it though, the md5mesh SG in max was...well..not entirly easy to adjust by hand, if not impossible :P
  • peppi
    Offline / Send Message
    peppi polycounter lvl 18
    This might be wrong, but if I recall correctly skinned (md5) geometry doesn't support more than one smooth group either way.. If you welded everything together and assigned a single SG to the mesh things should be fine.
  • odium
    Offline / Send Message
    odium polycounter lvl 18
    Yes, thats true. ITs one smoothing group. However, what you suggest couldn't work, because on saving the mesh to .md5mesh, it ignores any changes you have made to your smoothing and makes its own based on how you split the UV map up.

    Which means, we are stumped, because the scope is welded on the UV map, so it shouldn't do it.

    HOWEVER...

    Like we said, the actual EXPORT is fine. The model is fine and the .md5mesh, when viewed in other programs and ingame, is perfectly fine.

    The problem comes from the .md5mesh importer, which for some reason wont import correctly.

    Like MM said, is there anyway to weld everything together the same way .md5mesh works in the editor? Maybe we can't reimport with the correct smoothing, but as long as we have the correct smoothing to create the normals from it wont be a problem.
  • EarthQuake
    You could forcibly split the verts, and that way you would be able to get more than 1 smoothing group. Thats what any engine has to do to support multiple "smoothing groups" anyway.
  • odium
    Offline / Send Message
    odium polycounter lvl 18
    Not with md5mesh, thats the trouble. They support a single smoothing group, the only way to split it would be to create a seam on the UV map, which is a bit silly for the location this is in.

    Thats the beauty of .md5mesh... they are a pain in the ass...
  • EarthQuake
    You're saying if you detach a face the engine will re-weld it?
  • odium
    Offline / Send Message
    odium polycounter lvl 18
    Not the engine, the file format. .md5mesh ignores any smoothing in the mesh file and makes its own based on UV map seams.

    Its a pain in the arse becasue sometimes you need to hack it in various ways just to get the polyflow right so it doesn't produce odd smoothing errors, for example you need to add more loops or polies, or mess with the poly flow a lot, just to get it to look good.
  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    What you're saying is not true.

    You will find that if you export an MD5mesh (with 1 smoothing group over the whole mesh in 3dsmax), and then apply a flat grey material (no normalmap or special parameters, just a diffuse/spec pass), the mesh will be perfectly smooth.

    The difference arises if you use "unsmoothedTangents" in the material stage where you declare your renderBump (since the renderBump parameter on its own automatically treats the whole mesh as 1 smoothing group). As soon as you use unsmoothedTangents, then the normals will be adjusted based on the UV seams.

    It's not an MD5 thing, it's just something the doom3 engine does to unify all meshes. You will find the same results on ASE and LWO. If you apply a material with the renderbump parameter then the whole mesh will be smoothed. Specify the unsmoothedTangents parameter, and it will be smoothed based on UV seams. No renderbump parameter should mean the mesh preserves smoothing group info (although as Peppi says, md5 is all smoothed anyway, this will only apply to LWO and ASE).

    So in summary, it is your material which might causing the smoothing change across UV seams, not the MD5 itself. If you don't want that, don't use the unsmoothedTangents flag.

    It might also be worth trying the "forceSourceNormals" flag in a material if you want to preserve smoothing info, although I can't remember if this was added in ETQW or already existed in D3/Q4.
  • odium
    Offline / Send Message
    odium polycounter lvl 18
    We dont use Doom 3, we use .md5mesh on its own in our own engine. unSmoothedTagents isnt supported, and we use Max to render to texture, not Doom 3.
  • odium
    Offline / Send Message
    odium polycounter lvl 18
    Although we have already proven this isnt our fault, its the importer of der_ton's. So all of this is useless chat now unfortunatly unless we can figure a fix or work around for the importer.

    EDIT: Just spoke to our coder. Creating a normal map with unsmoothedTangents from Doom 3 will NOT work with our engine and will be wrong. So, thats not the way for us to go.
  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    OK, a lot of this wasted time could have been avoided if at some point you'd actually mentioned this wasn't even destined for a native MD5mesh-supporting game.

    So it's more likely your programmer's fault for reading the MD5mesh file differently to Doom3/Q4/ETQW, or your exporter's fault for sending out incorrect files (since any MD5mesh exporter for Max is 3rd-party).
  • odium
    Offline / Send Message
    odium polycounter lvl 18
    For the last time...

    The .md5MESH is fine. It DISPLAYS fine ingame, with a flat local map, its perfectly fine. Remember this:

    "It DOES look fine ingame, we came to the conclusion that it certainly IS the importer"

    Its the importer, simple as that. When this thread was created, MM didn't know what it was, and now we know its der_tons importer that some how doesn't like some .md5mesh files.
  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    odium wrote:
    <images of broken model> ... Yes, it looks like this ingame.

    Uh...
    odium wrote:
    It DISPLAYS fine ingame

    Please try to be consistent and provide useful information. This whole thread is basically a list of your own ignorance, and stuff you should have checked first before coming and asking silly questions.

    Solution: Just weld all verts and bake with one smoothing group in Max. This whole thing is a non-issue anyway, why are you exporting to MD5mesh, then importing it again and complaining it's broken? Just use the source file.
  • rooster
    Offline / Send Message
    rooster mod
    i see where your name comes from odium
  • Sam Hatami
    Offline / Send Message
    Sam Hatami polycounter lvl 16
    I did not intend this to be a bashing party, I do apologize if the information given from the start wasn't sufficient, but I did not know any more. And I am grateful for the information given back so far.

    The idea with the export importing was that I don't fully understand how the md5mesh gets it's smoothing group, cause once I reimported it, it didn't make much sence in my head. At first I did what you said, I welded all the vertices and added one smoothing groups to it and it worked fine baking until I had it ingame. The smoothing group applied to the mesh inside max didn't seem concur with the smoothing group of the md5. And I guess somewhere there I lost it, there were way to many question unsolved for me to come to a conclusion :P

    Somehow I did manage to get one of the models we do have ingame to work fine both in max and in Overdose. So therefor when this "new" error showing up was cind of a mystery to me and the reason I asked was maybe, since MoP has worked with this, I could get some suggestions of what this might be.

    Now I know that the problem occurs during the import, and so I'm trying to bake it using the source file with renderBump. So basiclly I have gotten an answer to the question and I thank you MoP again for the insight. I'll try to keep an update here if I come up with something new.

    please ask for details if I'm still unclear about anything.
  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    MetalMind: Thanks for the considered and polite response. I can understand that you might not have realised there were other factors affecting the import/export and normalmap rendering process, it is quite involved and complicated.

    I wish Odium would take the time and effort to write such sensible and well-mannered replies :)
  • Sam Hatami
    Offline / Send Message
    Sam Hatami polycounter lvl 16
    Resolved, man it feels so good.

    I tried first with renderBump, no luck, gave horrible smoothing and well didn't work (took a while to understand that renderBump don't like md5). I don't intend to go deeper when it's working now.

    Anyway, so I started to experiment with what you guys said, and now I see what I did wrong the first time. I just added one smoothing group to the imported mesh(edit: no welding), which resolved it. However this would have never work if I haven't exported/imported, cause we tried that ages ago and it never came out right.

    Well thank you guys and I hope this will help anyone who gets stuck with something like this in the future.

    fixedzr8.jpg
  • odium
    Offline / Send Message
    odium polycounter lvl 18
    MoP wrote: »
    I wish Odium would take the time and effort to write such sensible and well-mannered replies :)

    Excuse me? Maybe you missed the part where I said "Sorry my bad. Its not the .md5mesh at all, as such.".

    Christ you can see why people cant stand you at other forums now.
  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    Good to know you've solved the issue, MetalMind.

    I'm locking this thread now to prevent more flamebait. Please feel free to start a new thread if you run into any more MD5mesh or renderbump issues.
This discussion has been closed.