i am looking for Optimisation !

Hello !!

Where can i Find some informations about Optimisations for Textures, Vertex …
Because my 3d engine is a little slow !

Thanks !
bye
Cyril

(Sorry for my bad english …)

Optimisations:
1)draw using glDrawElements()

2)keep all vertex data in the fastest memory possible (eg use wglallocateNV to allocate video memeory for geometry on geforces etc)

  1. use texture objects (glBindTexture) and sort your objects in the scene by texture order in order to minimise changes of the bound texture.

  2. Maybe you’re trying to draw too many triangles. if you are using a model from 3ds Max or something, try using the optimise modifier on each model you use.
    On most average machines (eg 600mhz+ processor, geforce class graphics card) you should be able to render around 50-60,000 polygons per frame at 50+fps with no trouble, although this figure is much lower on TNT2 level and lower graphics cards.

5)Do as much object level culling as possible. If you are rendering internal areas, use bsps (like quake2) or zones (3d tiles) to work out which bits of the area to send to opengl.

6)Enable back face culling ( can’t remember how - glEnable(GL_CULL_FACE) I think).

  1. make sure your engine code is optimised. This won’t normally make much difference, as most graphics engines on their own don’t do much that is comparable in complexity to what opengl does for you. However, inlining functions and avoiding unneccesary calculations and transformations can help a bit.

Hope that helps? anyone else have suggestions?

  1. Use triangle strips

  2. Use MMX or SSE for your math routines

  3. Use frustum culling

There are so many things to make it faster…

Thanks you very much for the informations !!!
bye
Cyril !

I will test them !

Originally posted by richardve:
[b]8) Use triangle strips

  1. Use MMX or SSE for your math routines
  1. Use frustum culling

There are so many things to make it faster…[/b]

Draw your objects front to back. This seems to be often neglected, even though it’s been of benefit for several generations of chips (the Rendition V2200 dev kit suggested it). It’s of even more benefit for the Radeon and GeForce3.

I think that it’s better to sort by depth than by texture, but haven’t tested it, so can’t tell if it’s true.

That #9 suggestion is about the last thing you shoud dive into. It is indeed a way to optimize the code, no doubt about that, but it gives you far less improvements than the other suggestions.

A bad algorithm that is well coded is worse than a good algorithm bad coded (OK, maybe not always, but most of the time )

Hello !

>use bsps (like quake2) or zones (3d tiles)
Where can i find some informations about them ?

>3ds Max or something, try using the optimise modifier on each model you use.

How can i Optimise an ASE file ?

Thanks !!
bye
Cyril

Originally posted by Benjy:
[b]Optimisations:
1)draw using glDrawElements()

2)keep all vertex data in the fastest memory possible (eg use wglallocateNV to allocate video memeory for geometry on geforces etc)

  1. use texture objects (glBindTexture) and sort your objects in the scene by texture order in order to minimise changes of the bound texture.
  1. Maybe you’re trying to draw too many triangles. if you are using a model from 3ds Max or something, try using the optimise modifier on each model you use.
    On most average machines (eg 600mhz+ processor, geforce class graphics card) you should be able to render around 50-60,000 polygons per frame at 50+fps with no trouble, although this figure is much lower on TNT2 level and lower graphics cards.

5)Do as much object level culling as possible. If you are rendering internal areas,

to work out which bits of the area to send to opengl.

6)Enable back face culling ( can’t remember how - glEnable(GL_CULL_FACE) I think).

  1. make sure your engine code is optimised. This won’t normally make much difference, as most graphics engines on their own don’t do much that is comparable in complexity to what opengl does for you. However, inlining functions and avoiding unneccesary calculations and transformations can help a bit.

Hope that helps? anyone else have suggestions?[/b]

Have a search on Google to find info on BSPs, or try www.gamasutra.com, www.gamedev.net.

You can use the 3dsmax optimise tool (modifiers->more…->optimise) on any mesh, and it will remove polygons from it while trying to keep the original shape. Obviously, the end result doesn’t look quite as good, but it will render more quickly.

Another, more complex, optimisation is to write a program that inputs the ASE file and sorts the geometry to make maximum use of any caches present on the GPU. The ASE format itself is pretty inefficient in terms of disk space used. Personally, I convert the ASE into my own file format using a utility I wrote.

Check out www.nvidia.com/developer for more info (yes, I’m sure there are equivalent sites for ati cards etc, but I don’t know of them)

Thanks you very much for all !!
I take advice on them !!
bye
Cyril

Originally posted by Benjy:
[b]Have a search on Google to find info on BSPs, or try www.gamasutra.com, www.gamedev.net.

You can use the 3dsmax optimise tool (modifiers->more…->optimise) on any mesh, and it will remove polygons from it while trying to keep the original shape. Obviously, the end result doesn’t look quite as good, but it will render more quickly.

Another, more complex, optimisation is to write a program that inputs the ASE file and sorts the geometry to make maximum use of any caches present on the GPU. The ASE format itself is pretty inefficient in terms of disk space used. Personally, I convert the ASE into my own file format using a utility I wrote.

Check out www.nvidia.com/developer for more info (yes, I’m sure there are equivalent sites for ati cards etc, but I don’t know of them)[/b]

The problem I have with optermization is that most methods don’t work well with others, e.g it is good to sort by texture, but I also want to sort by geometry type so I can have a single call to GL_TRIANGLES/GL_QUADS, I also want to sort front to back, butfor transparency it is good to sort back to front, displays lists are good on non tnl gfx cards but VAR is far better on TNL cards, sorting by state is also good. One thing is that you must not spend too much time sorting out what to draw and in what order, especialy on GeForce type cards it can be better just to shove the stuff to OpenGL. The only thing that should definately be done is some sort of frustum culling, but this has problems; BSPs are good with lots of nice extras thrown in for free but are slow and result in splitting up polygons increasing the polycount, they are also only for static data, octrees are fast, efficent good for GeForce cards but have no extras at all (well some slight extras).
Tim