Results 1 to 30 of 652

Thread: A start on the .MESH file format

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Re: A start on the .MESH file format

    Try this one, the first one wont let me dl either
    http://www.megaupload.com/?d=O8YR7OVW

    Managed to get a bit more messing done and changed the values around a bit


    first one is 00 00 ff 00, second one is 00 ff 00 00
    Thought they might have been rgb values at first but colours change depending on the weather, the lighting effect on the models there seems to be produced from the odd cubemaps that are in globallighting. Definitly looks like one of the values looks to calculate that environment mapping type effect is messed up. Changing the second and third blocks doesnt seem to have any effect that I've noticed, but I seem to be missing a bit lately.

    I've got a 9600gt so you should be able to reproduce anything I can, are you sure you have the game set up to use modded files? I find using --io.file_first in a bat file works better than a cfg file.

  2. #2
    Member Member KnightErrant's Avatar
    Join Date
    Jan 2007
    Location
    Huntsville, Alabama USA
    Posts
    458

    Default Re: A start on the .MESH file format

    @GOM

    Of course, you have my permission to do anything
    that helps figure things out.

    This Saturday is one of those errands and yardwork days
    (spring has come to Huntsville) but I'll start back again
    tonight looking at things. Maybe I should make my cobbled
    together script more general so it searches for the start of
    the mystery block for any unit rather than a hard-coded
    byte value. Any thoughts on whether that would be helpful?

    @Casuir
    The first picture you posted looks exactly like what I'm
    seeing, shadows and stuff on different guys in the unit
    depending on lighting.

    KE
    Last edited by KnightErrant; 03-10-2007 at 16:39.

  3. #3

    Default Re: A start on the .MESH file format

    Hi Guys

    I finally made my in-game stuff look like yours. Looks like the mystery blocks are not just harmless boolean streams as we were led to believe. I've sent a PM to Caliban and hopefully we can get some more information.

    What this means -

    Can we still go ahead? - Yes, with the restriction that we can only use M2TW groups until we figure out how to replicate the shading data. However, creative texturing and use of alpha maps will give some leeway for variations.

    Is Milkshape still an option? Yes, I can store the mystery blocks within the file and parse it out on conversion to Mesh.

    All is not lost and the way ahead is clearer now

    Off to mow the lawn, then rewrite the converter and read up on shader streams .

    Cheers

    GrumpyOldMan

  4. #4
    Harbinger of... saliva Member alpaca's Avatar
    Join Date
    Aug 2003
    Location
    Germany
    Posts
    2,767

    Default Re: A start on the .MESH file format

    Heh you guys got me interested. Is any of you up to brief me a bit on this via MSN, ICQ or IRC later next week?
    I could try to help you figure out the mystery values afterwards (well I have no idea about 3d programming but I'm good at puzzles) - and I prefer chat to forums

  5. #5
    Member Member KnightErrant's Avatar
    Join Date
    Jan 2007
    Location
    Huntsville, Alabama USA
    Posts
    458

    Default Re: A start on the .MESH file format

    @alpaca
    Well GrumpyOldMan is the most knowledgable person on the
    team about 3D graphics but if he's too busy I can give you
    my less in-depth understanding. You'd have to tell me how to do
    the protocols you mentioned; I've haven't used chat.

    @anybody
    This is a noobie request but I never learned how to post screenies
    and this will be necessary for dealing with the mystery data.
    Could someone point me to a tutorial or give a brief description.
    Please include something about hosting services.
    Thanks.

  6. #6

    Default Re: A start on the .MESH file format

    @KE, Let me do this easy job:)
    1) I suggest this site to host your image:
    https://imageshack.us/

    2) The webpage is very user-friendly. Click "browse" button on the right and choose the image you want to upload and then click "host it!" at the bottom

    3) After all is done you will get several address. Just copy the "Hotlink for forums" line and paste it in you post. Then others can see your image.

  7. #7
    Member Member KnightErrant's Avatar
    Join Date
    Jan 2007
    Location
    Huntsville, Alabama USA
    Posts
    458

    Default Re: A start on the .MESH file format

    @zxiang1983
    Many thanks, my friend. I'll
    try a test this afternoon.

    edit: that was fast trying it now.



    Wow! That was easy! Thanks again!

    This isn't the best picture of the mystery data effect but some of the guys are shadowed
    because of the zeroed out mystery data.
    Last edited by KnightErrant; 03-11-2007 at 18:01.

  8. #8
    The Philosopher Duke Member Suraknar's Avatar
    Join Date
    Dec 2002
    Location
    Navigating the realm of Ideas
    Posts
    707

    Default Re: A start on the .MESH file format

    hrm...

    This looks like Vertex Shading, Shininess and refraction in relation to weather lighting and environment, so it is information for the engine's rendering instructions.

    Just a thought, are these mystery values the same accross the board for all units?

    If they are then maybe the Converter could just add(insert) this information to the final .mesh file upon export?

    EDIT: NVM, I posted this after reading page 5 of the thread, did not notice there was Page 6, which I am reading now :P
    Last edited by Suraknar; 03-12-2007 at 03:19.
    Duke Surak'nar
    "Η ΤΑΝ Η ΕΠΙ ΤΑΣ"
    From: Residing:
    Traveled to: Over 70 Countries, most recent: and

    ~ Ask not what modding can do for you, rather ask what you can do for modding ~
    ~ Everyone dies, not everyone really fights ~

  9. #9
    Member Member KnightErrant's Avatar
    Join Date
    Jan 2007
    Location
    Huntsville, Alabama USA
    Posts
    458

    Default Re: A start on the .MESH file format

    Yes, the format seems to be the same for all units.
    The aztec variants that Casuir found had float triple
    streams for the mystery data but those units aren't
    used in-game (don't appear in the EDU) so were they
    mistakes, early prototypes with a different format, etc. ?

    Did a quick google on normal map tutorials and there
    are a few so maybe I should just read up for a few evenings
    until I can catch up.

  10. #10
    Member Member Re Berengario I's Avatar
    Join Date
    Nov 2003
    Location
    Italy
    Posts
    336

    Default Re: A start on the .MESH file format

    For what you are interested in a normal map it's just another texture because most of the 3d programs know how to handle it. It's not geometry for them.

    From the Caliban post I understood that the mystery block values are the tangent and biNormal (bitangent) vectors of the model to support normal mappin in per pixel lighting through shaders.
    Last edited by Re Berengario I; 03-12-2007 at 03:27.

  11. #11
    Member Member Re Berengario I's Avatar
    Join Date
    Nov 2003
    Location
    Italy
    Posts
    336

    Default Re: A start on the .MESH file format

    Ok, because I need to be forgiven for the last cryptic post this is a good and simple tutorial about the argument:

    http://www.3dkingdoms.com/tutorial.htm

    and this for tangent space normal mapping

    http://www.3dkingdoms.com/weekly/weekly.php?a=37
    Last edited by Re Berengario I; 03-12-2007 at 03:31.

  12. #12
    Member Member KnightErrant's Avatar
    Join Date
    Jan 2007
    Location
    Huntsville, Alabama USA
    Posts
    458

    Default Re: A start on the .MESH file format

    Well when GrumpyOldMan comes online he'll understand this
    so I guess I shouldn't be too worried about my ignorance.
    What I would like is an assurance of is this data computable
    from the vertex vectors, weights, and uv coords so that when
    we pull all of that out of a mesh and put it into the .ms3d
    format (which wants the vertex normals) can we go back the
    other way and put it all back into the mesh format and compute
    all the required mystery data. (I realize we may be "talking past each other"
    on this question, I see this problem from data in a file format and you
    guys who actually make models may be seeing this as something
    you apply in a given application.)

    Edit: You're too fast, I didn't even get a chance to see that.
    I'm going off to study this stuff and then I'll understand it better.
    Many thanks for being patient with me.

    2nd Edit: Yes, that's the tutorial I found. Reading it now.

    3rd Edit: THANK YOU! This has math in it. Now I'll understand what we've
    been talking about.
    Last edited by KnightErrant; 03-12-2007 at 03:44.

  13. #13
    Member Member Re Berengario I's Avatar
    Join Date
    Nov 2003
    Location
    Italy
    Posts
    336

    Default Re: A start on the .MESH file format

    I don't possess deep knowledge on normal mapping as I usually let the 3d application handle it but in this case they use directly a shader so those values (if I'm not completely wrong) are a 3x3 matrix for each mesh vertex.

    (From the second link above:)
    To use tangent space normal mapping, we need to send the tangent and bitangent vectors to the vertex shader. Then we can create a 3x3 rotation matrix from them that can be used to rotate vectors such as the light vector and half-angle vector into tangent space.
    Now we can dot these vectors with a normal from our tangent space normal map, using the same pixel shader as with object space normal mapping.


    From Caliban's post:

    To get more info about what tangent and binormal is, they should look up tangent space normal mapping as that's what we're using. Mesh needs to contain valid tangent space (normal, tangent & binormal).
    Last edited by Re Berengario I; 03-12-2007 at 03:43.

  14. #14
    Member Member KnightErrant's Avatar
    Join Date
    Jan 2007
    Location
    Huntsville, Alabama USA
    Posts
    458

    Default Re: A start on the .MESH file format

    Exactly! from the same article

    Code:
    void ComputeTangentBasis(
          const Vec3& P1, const Vec3& P2, const Vec3& P3, 
          const Vec2& UV1, const Vec2& UV2, const Vec2& UV3,
          Vec3 &tangent, Vec3 &bitangent )
    {
       Vec3 Edge1 = P2 - P1;
       Vec3 Edge2 = P3 - P1;
       Vec2 Edge1uv = UV2 - UV1;
       Vec2 Edge2uv = UV3 - UV1;
    
       float cp = Edge1uv.y * Edge2uv.x - Edge1uv.x * Edge2uv.y;
    
       if ( cp != 0.0f ) {
          float mul = 1.0f / cp;
          tangent   = (Edge1 * -Edge2uv.y + Edge2 * Edge1uv.y) * mul;
          bitangent = (Edge1 * -Edge2uv.x + Edge2 * Edge1uv.x) * mul;
    
          tangent.Normalize();
          bitangent.Normalize();
       }
    }
    This is exactly the education I was looking for. Thank you very much
    Re Berengario I. I'm am deeply in your debt.

  15. #15
    The Philosopher Duke Member Suraknar's Avatar
    Join Date
    Dec 2002
    Location
    Navigating the realm of Ideas
    Posts
    707

    Default Re: A start on the .MESH file format

    KE,

    Just as a small test here,

    when you compare feudal_knightslod0 and feudal_knights_lod1, is the mystery bytes information the same?
    Duke Surak'nar
    "Η ΤΑΝ Η ΕΠΙ ΤΑΣ"
    From: Residing:
    Traveled to: Over 70 Countries, most recent: and

    ~ Ask not what modding can do for you, rather ask what you can do for modding ~
    ~ Everyone dies, not everyone really fights ~

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO