News:

One Minute Game Review by The Happy Friar: https://ugetube.com/@OneMinteGameReviews
Also on Rumble: https://rumble.com/c/c-1115371

idTech 4 (aka Doom 3 tech) Discord Server! https://discord.gg/9wtCGHa

Main Menu

MD5 model viewer DoomView

Started by Radegast, May 20, 2015, 04:06:08 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Radegast

As my learning project to get started with D3/OpenGL I decided to write a model viewer for the MD5 format used by Doom III. There are several examples of rendering MD5. However, they are either too basic (no textures and animations), don't compile or don't display the models properly. Writing one from scratch by studying the unofficial reference documentation turned out to be way over my capabilities. The single working model viewer with source code available I found was written by the legend himself, Fabien Sanglard (I bet you thought I was going to say Trebor).

So far I ported it to SDL 2 and removed dependency on SDL_image by switching to header-only stb library.



Roadmap

Phase I

  • remove GLUT and use GLM for OpenGL mathematics
  • add CMake build script (Windows/linux/OS X)
  • use GLEW
  • move project to Github
Phase II

  • port from OpenGL 2.1 -> OpenGL 3.3+
Phase III

  • import/export binary MD5 models used by DOOM 3: BFG (bmd5mesh)
  • add optional GUI for opening models, changing shaders and animations, etc.
  • add optional PhysFS support for opening models directly from pk4 packages

BielBdeLuna


Radegast

#2
I just realised my screenshot in the first post wasn't showing for other people so here it is:



I've managed to clean up the source a lot and now I am replacing GLUT with GLM. 

motorsep

Cool, but here is my 2 cents - why not to make it built into the engine? This way you have lighting / material system at your disposal. Hell, you have everything at your disposal - just make it into a nice GUI with artist-friendly interface.

Doom 3 BFG binarizes models on its own. There is no need to add pre-binarized models. You feed engine MD5 and it will do the rest.

The Happy Friar

Standard D3 has a md5mesh/anim viewer, so I'm guessing you mean for BFG?

The best use of a standalone is so that people who are using the md5 format in a non-D3 based game can preview their models, similar to how you can get md2 viewers because various GPL engines use the format now.

motorsep

Quote from: The Happy Friar on May 24, 2015, 02:04:01 PM
Standard D3 has a md5mesh/anim viewer, so I'm guessing you mean for BFG?

The best use of a standalone is so that people who are using the md5 format in a non-D3 based game can preview their models, similar to how you can get md2 viewers because various GPL engines use the format now.

There is testmodel/testanim cmds in both engines. It desperately needs GUI to be able to browse/load models/anims and save wrists from typing excessively :)

Standalone is no use. If you are an artist making models for the game, you need to be able to test them in-game. So many times DerTon's MD5 viewer would show model properly, yet it was screwed up in-game. In DarkPlaces, in Doom 3 and in BFG.


BielBdeLuna

stop discouraging people from their efforts man.  >:(

motorsep

Quote from: BielBdeLuna on May 24, 2015, 09:59:24 PM
stop discouraging people from their efforts man.  >:(

Eeh, if person has a good reasons to do what they do, there is no one out there will discourage them.

I am providing an alternative point of view and a developer can weight in on that point of view and make their decision.

Stop acting like you are in a kindergarten, BielBdeLuna. There are many point of views on the same subject and a mature and strong minded person will make their own calls about what way to go.

BielBdeLuna

well you're always saying what others do is a waste of time, that's not an alternative point of view because that's always the same point of view, why do you think you are the mature one with the right calls on what to do?

The Happy Friar

Quote from: motorsep on May 24, 2015, 02:32:00 PM
There is testmodel/testanim cmds in both engines. It desperately needs GUI to be able to browse/load models/anims and save wrists from typing excessively :)

I agree.  A GUI would be handy AWESOME.  :)  I normally have the .def open too to see what I'm working with, but a GUI simular to the light/AF/sound editor would be awesome.

QuoteStandalone is no use. If you are an artist making models for the game, you need to be able to test them in-game. So many times DerTon's MD5 viewer would show model properly, yet it was screwed up in-game. In DarkPlaces, in Doom 3 and in BFG.

Then the DerTon md5 viewer was broken.  :)  I'd figure if it was correct in showing what the engine sees then it would show the model wrong too.   We didn't have the engine code at the time though, so now Radegast has more then just the visual results to compare to, he can compare his code to make sure his viewer displays properly with the game.  Plus, like he says, he;'ll learn quite a bit by making the model viewer.  Maybe enhance the md5 format a little bit, etc?  *cough*add vertex deformation please*cough*

:armadillo:

The Happy Friar

I split the topic to a new thread with the discussion of model formats.  That will keep this one on topic.  Model format thread here.