1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Is this of interest to anyone?

Discussion in 'Tools programming' started by decapod, 21/10/08.

  1. decapod

    decapod

    Joined:
    2/4/07
    Messages:
    132
    Country:
    england
    A MDL file viewer for FSX models

    Still early days. The different colours indicate drawcalls.

    [​IMG]
  2. PakMac

    PakMac

    Joined:
    22/1/05
    Messages:
    454
    Country:
    england
    That looks interesting. Will it also do scenery models?

    David
  3. scruffyduck

    scruffyduck Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    17/9/05
    Messages:
    24,716
    Country:
    wales
    That does look very good. Are you using DirectX to render?
  4. decapod

    decapod

    Joined:
    2/4/07
    Messages:
    132
    Country:
    england
    Any MDL generated by XtoMDL will work.
    It reads the 141000 poly Beaufighter correctly.
    BGL Object Library files may be supported at a later date

    I'm using the SlimDX DirectX9 library with .NET so I may be able to load the FSX included shaders at some point in the future.
  5. scruffyduck

    scruffyduck Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    17/9/05
    Messages:
    24,716
    Country:
    wales
    Hi Paul

    Interesting. I wrote a utility called LOV (library object viewer) for FS9 using DX9 directly to read scenery mdl files but never got around to updating it to FSX. Not seen the SlimDX library but sounds like it might have made the job easier!
  6. decapod

    decapod

    Joined:
    2/4/07
    Messages:
    132
    Country:
    england
    SlimDX is just a thin wrapper around DX9/10 for .NET developers. It just saves having to use C++.

    Speed is not essential for model viewers, but reliability and maintainability are more useful if you distribute code around the world.
    I wrote something similar for Train Sim 1 using VB6 and DX8 back in 2003.
  7. arno

    arno Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    28/5/04
    Messages:
    21,300
    Country:
    netherlands
    Hi Paul,

    Yes, I think this is certainly interesting.

    My ModelConverterX tool can also load (and thus visualise) MDL objects. I have had some users already who only used it as a viewer and not as a converter.

    But I think there will certainly be people interested in such a viewer. Did you already get to LODs and animations? I got them working basically, but I am wondering if you might have found some more details about them already.
  8. decapod

    decapod

    Joined:
    2/4/07
    Messages:
    132
    Country:
    england
    LOD's work well, I now have a combo box so you can just select the LOD and the display changes.
    I'm just updating the user interface then I'll put out a beta version.

    Along with finishing off my first freeware aircraft and writing a tutorial for 3D canvas modellers, as well as a full time job - there are not enough hours in the day.
  9. arno

    arno Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    28/5/04
    Messages:
    21,300
    Country:
    netherlands
    Sounds familiar :). Looking forward to the beta version.
  10. decapod

    decapod

    Joined:
    2/4/07
    Messages:
    132
    Country:
    england
    Getting closer..

    [​IMG]

    Animation streams and visibility tags next...
  11. scruffyduck

    scruffyduck Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    17/9/05
    Messages:
    24,716
    Country:
    wales
    That is looking very good Paul
  12. Golf-HotelDelta

    Golf-HotelDelta

    Joined:
    20/12/04
    Messages:
    9,661
    Country:
    unitedkingdom
    Superb :wizard:

    George
  13. arno

    arno Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    28/5/04
    Messages:
    21,300
    Country:
    netherlands
    Paul,

    Let me know if you need help with the animations. I have figured out a big part already, but didn't have the time yet to update the Wiki. Would be a waste if you have to re-invent the wheel on that.
  14. decapod

    decapod

    Joined:
    2/4/07
    Messages:
    132
    Country:
    england
    Thanks for the offer Arno, the animations are a direct conversion from the xanim file so they shouldn't present a problem.
    I'll split them into "streams" so they can be run independantly.

    Here's the latest - I had the ambient lighting turned off in the last pic.

    This one shows a 141k poly model which took a few seconds to load.
    [​IMG]
  15. n4gix

    n4gix Resource contributor

    Joined:
    26/9/06
    Messages:
    9,287
    Country:
    unitedstates
    This will be a repainter's wet dream! ;)
  16. Timmo

    Timmo

    Joined:
    10/1/07
    Messages:
    547
    Country:
    newzealand
    Excuse my ignorance on this- The number of draw calls directly relates to performance doesn't it?

    The reason I ask is I use a slightly different method of modelling my aiports (using Sketchup which doesn't work with 'solids'- only faces) and am wondering what effect it has on performance. Ive only really tackled small airports and using the in game FPS drop isnt really accurate enough...Id like to be able to say compare the drawcalls/performance between a cube created and textured in Gmax to one created and textured in Sketchup (then then exported to 3ds, imported to Gmax and material definitions reapplied using the existing mapping)

    Looks like a great tool
  17. decapod

    decapod

    Joined:
    2/4/07
    Messages:
    132
    Country:
    england
    Arno already wrote a small program the DrawCallMonitor which will show the number of draw calls and polys in an FSX MDL file.
    You should be able to find it under the ModelConverterX forum.

    I think you'll find the results are identical. Exporting from sketchup creates the faces as triangles (polygons) which is what 3DS and Gmax use to build the mesh.

    I have some experience of sketchup, having written an exporter for models to MS Train sim 1, at some point I may do a similar export direct to FSX (and TS2)
  18. Timmo

    Timmo

    Joined:
    10/1/07
    Messages:
    547
    Country:
    newzealand
    Ok ill check it out- An exporter straight from SU would be great for simple scenery models.

    There are a couple of FSX features which (to my knowledge) can only be added via Gmax: FSX materials (night maps, reflection maps etc) and self shadowing.

    I haven't been able to get self shadowing working (objects not manifold....presumably because they are faces not solids?) and have to re create the textures in GMax to get FSX materials. I still find texturing and modelling in SU far far easier than gmax for most things.
  19. decapod

    decapod

    Joined:
    2/4/07
    Messages:
    132
    Country:
    england
    Beta version

    I've not had much time to work on this due to modeling commitments but I thought others may like to have a play with the current beta version.

    http://cid-06b528339820717e.skydrive.live.com/self.aspx/Downloads/MDLReaderSetup.zip

    Most true FSX models load OK although a few still reference BMP files as textures.
    I've written an FS-BMP reading function so some of the old texture formats do load.

    Arno - you're welcome to host it on the FS Developer site too.
  20. Southwest

    Southwest

    Joined:
    1/12/07
    Messages:
    1,085
    Country:
    unitedkingdom
    I presume there are no plans for a FS9 version?

    Cheers

Share This Page