Hello Guest

A Pic form my Project

  • 6 Replies
  • 7451 Views
A Pic form my Project
« on: December 25, 2005, 17:00:47 »


Ok,
the Hills are an 3Ds Model, the Stars are Supershapes (http://astronomy.swin.edu.au/~pbourke/surfaces/supershape3d/)
... The Perfomance is not as good as is can, but it renders 90.000 Polys...

Any Idea to get more Perfomance in it?

Thanks for Comments

oXineteX

*

Offline hvor

  • *
  • 37
    • http://hvor.madpage.com
A Pic form my Project
« Reply #1 on: December 27, 2005, 11:52:50 »
Maybe you can squeeze more performance out of it. Tell us how do you render 3d models? Like gl_begin - gl_end, vertex pointers, VBOs ...?

A Pic form my Project
« Reply #2 on: December 27, 2005, 16:49:50 »
if your marketing high-end cards that have support for PBOs, then you might consider changing the particle system to be entirely on the GPU with shaders.

DP

A Pic form my Project
« Reply #3 on: December 27, 2005, 21:48:17 »
oh ok, the Partikels are "Hardcore" Renders gl ;) oh i see the fault..

Code: [Select]
glBegin(GL_TRIANGLE_STRIP);                                
                glTexCoord2f(1.0f, 1.0f); glVertex3f(x + 1.5f, y + 1.5f, z);
                g...

--------------------

I store the models in vectors, every render, i run trough the Vector and calls the Renderfunction in the Models, every Model has a own gllist-id which stores the compiled Code of the Model (the list is generated on initialising).


Code: [Select]
//List_Models -> Vector<PRModel>
for(int j = 0; j < List_Models.size();j++)
{
  PRModel temp = List_Models.get(j);  
  glPushMatrix();          
    temp.render();   //renders list
 glPopMatrix();

 .....

}



-----

Ok, i code Graphics since 2 Month and i shaders.. wow thats a big thing, but hey why not - is there any Tutorial how to start with shaders in LWJGL?

oXi

A Pic form my Project
« Reply #4 on: December 28, 2005, 01:01:50 »
only way is to profile to see what your bottle neck is...no other way.

As for shaders, google for ARB_fragment_shader, ARB_vertex_shader. Those two are the new extensions (aka GLSL), if your hardcore like you say you are (;)), then you might want to do that in asm using ARB_fragment_program and ARB_vertex_program.

DP

hmmmmmm...
« Reply #5 on: January 02, 2006, 01:40:39 »
You are using terrain and I'm guessing that you have the entire terrain in one display list. (I'm guessing because I don't see how that scene is 90,000 polys). That would basically mean that the video card is trying to render all of the terrain every frame.

Rendering terrain is tricky! You have to get your camera position and only render the terrain that is visible. Also, you might have to implement some kind of Level-of-Detail for the terrain (The further the terrain is from the camera, the less polys that make up a given area).

Quote
...if your hardcore like you say you are...

I think he meant that doing the particles with shaders is hardcore :)
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D

*

Offline hvor

  • *
  • 37
    • http://hvor.madpage.com
A Pic form my Project
« Reply #6 on: January 02, 2006, 09:19:41 »
Fool Running is right. Try to find some tutorials on Frustum Culling - that is the metod of displaying only visible polys of terrain. LOD method is another optimisation. You divide terrain into chunks (lets say 32x32 points), and for every chunk you pre-compile how many you want LOD parts - with 32x32, 16x16 and 8x8 points for example. Then, if your camera is far away from chunk (AND it is visible), display lower detail version of chunk.
More memory consumation - but better performance!