Jump to content

  • Log In with Google      Sign In   
  • Create Account

md5 models + opengl 3+ without glut


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 proanim   Members   -  Reputation: 446

Like
0Likes
Like

Posted 25 January 2013 - 04:08 PM

I find it strange that there is very little on how to load md5 models with modern versions of opengl (since there are dx11 and glut solutions). Even the old md2 and md3 tutorials were easier to find.

 

Are there any tutorials or anything that explains how to load md5 models with opengl 3.3 and up without glut or assimp? Are there any open source engines that do this without glut or assimp?



Sponsor:

#2 __SKYe   Members   -  Reputation: 1099

Like
1Likes
Like

Posted 25 January 2013 - 05:40 PM

How does GLUT or OpenGL 3.3 make it easier/harder to load models?

Do you mean how the fixed pipeline of older OpenGL vs programmable (shaders) pipeline of newer OpenGL affect the rendering of a model(using VAOs/VBOs instead of glBegin()...glEnd() calls)?

Could you explain further?

Edited by __SKYe, 25 January 2013 - 05:41 PM.


#3 beans222   Members   -  Reputation: 1170

Like
0Likes
Like

Posted 25 January 2013 - 06:32 PM

What __SKYe said. Just put the vertices, attributes (including weights), and indices into buffers and a VAO, pass the bone matrices in uniforms and multiply in the shader.

 

If you want to learn shaders and math, the online book at http://arcsynthesis.org/gltut/   is most popular (and extremely informative).


New C/C++ Build Tool 'Stir' (doesn't just generate Makefiles, it does the build): https://github.com/space222/stir

 


#4 proanim   Members   -  Reputation: 446

Like
0Likes
Like

Posted 25 January 2013 - 06:41 PM

@ __SKYe

 

My understanding is that as in dx opengl also uses 'shader only' drawing, as in you must use a shader to get stuff on screen. With new versions of opengl glBegin()...glEnd() are obsolete. GLUT has its own framework that is verymuch C, and it has its own game loop (which is mostly not needed anyway). I am looking to use md5 models with modern versions of opengl, but not to use GLUT or assimp or even boost, which are recommended in some tutorials.

 

 

@beans222

 

I had a look at the link many times, it is informative, but there are some things missing (like actual source code). And it won't help here since all primitives in the book are hardcoded.



#5 __SKYe   Members   -  Reputation: 1099

Like
2Likes
Like

Posted 25 January 2013 - 07:32 PM

Okay, let me start by saying i don't know the details of the md5 model file format.

 

However note this, the process of loading (reading the model from the file, parsing, etc) is independent of any graphics API.

The only things you have to do differently is the storage of the model data (vertices, normals, texture coordinates, etc) which could be stored in regular arrays if you used the old OpenGL (and then you'd draw each face with glBegin()/glEnd() calls). On the other hand if you want to use the newer OpenGL, you can use VBOs to store them (with conjunction with VAO)  and then drawing with glDrawArrays(), for example.

The differences in rendering have already been explained, for old regular arrays of vertices, normals, tex coords, use the glBegin()/glEnd() calls, and for the newer OpenGL, you have to use VBOs.

 

Note that, for simplicity, i didn't mention anything about animation (either frame based or skeletal).

 

Now for not using GLUT.

 

The main use of GLUT (for me, at least) is that creating a OpenGL window is very easy. However it heavily limits what you can do with it (normal, because it's supposed to be simple). So you can't use GLUT to create a OpenGL3.x or newer (not entirely sure, but close).

 

As beans222 said, you can use that website for all kind of information, and even if you don't use GLUT, most of what is explained there will work either way. The only thing you must create on your own is the OpenGL3.x (4.x) window. You can go to http://www.opengl.org/wiki/Creating_an_OpenGL_Context_(WGL) for information on how to do it, if you're using Windows.

 

The rest is up to you, however keep this in mind:

The newer OpenGL has deprecated the old matrix transformation functions, so you MUST use your own math library (glm does a very good job here, has it recreates the OpenGL matrix functions).

 

This may not be exactly what you want, and if you don't know how to use the newer OpenGL yet (if you haven't worked with shaders, VBOs, VAOs, etc), then i suggest you take a look at some tutorials first because rendering in newer OpenGL is quite different from the old fixed pipeline.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS