Jump to content
  • Advertisement
Sign in to follow this  
polar01

OpenGL OpenGL optimization - performances issue

This topic is 3337 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I'm trying to display a model with : - 652000 vertices / normals - 166000 faces I'm currently using the display list but it is VERY slow, it is even difficult to rotate the model. Do you have some councils to help me to have better performance ? I have try the VBO, but I got a NullReferenceException when I call : int vertexVBO; Gl.glGenBuffersARB(1, out vertexVBO);

Share this post


Link to post
Share on other sites
Advertisement
I only do this :

int vertexVBO;
Gl.glGenBuffersARB(1, out vertexVBO);

I do this where currently I use glVertex3d...

If you want to see the code you can get it at http://rs.codeplex.com
In the class GLRenderer (The VBO code is currently commented).

Thanks

Share this post


Link to post
Share on other sites
It seems that every frame you call 'Gl.glBufferSubDataARB', causing your model to be uploaded to the video card at every frame.

Share this post


Link to post
Share on other sites
Yes, you're right...

It is the way I have write the code and it is wrong for performance :-P

But currently, this doesn't work because the first call to "glGenBuffersARB" crash :-(

Share this post


Link to post
Share on other sites
I'm trying to play with glDrawElements and DisplayList... but it change nothing.

Another problem is that I must create 3 arrays of datas for glDrawElement:
- Indices
- Vertices
- Textures

Then save them to memory and only after I can call glDrawElements !!!

I do this only 1 time... after I use the display list...

But it is still slow !

Share this post


Link to post
Share on other sites
Quote:
Original post by knighty
Perhaps you should do something like this intead:

int[] vertexVBO = new int[ 1 ];
gl.glGenBuffersARB( 1, vertexVBO, 0 );


Nope, the original code is correct. What you are doing will also work, but there's no need for that. (Note that this code is in C#/Tao, while you've linked to a JOGL tutorial :) ).

To the OP: what exception are you getting on the glGenBuffersARB crash? If it is a null reference exception, then 99% you are accessing initializing the Gl class before the OpenGL context is ready. (This is an error and you are lucky for getting this far without crashes :) ).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!