Files |  Tutorials |  Articles |  Links |  Home |  Team |  Forum |  Wiki |  Impressum

Aktuelle Zeit: Fr Jul 18, 2025 16:57

Foren-Übersicht » English » English Programming Forum
Unbeantwortete Themen | Aktive Themen



Ein neues Thema erstellen Auf das Thema antworten  [ 11 Beiträge ] 
Autor Nachricht
BeitragVerfasst: Sa Mär 26, 2005 21:20 
Offline
DGL Member

Registriert: Fr Aug 13, 2004 17:43
Beiträge: 60
Wohnort: Belgien
Hi,

I'm working on a project with a tile-based landscape.
There are serval types of tiles: water tiles, grass tiles, wall tiles,... Each tile has its own class (TWaterTile, TGrassTiles,...) with a draw procedure. This procedure uses glNormal3fv, glVertex3fv,... to draw the tile.
I've a 3-dimensional array where all the tiles are stored in. I draw the visible tiles using frustum culling and an OcTree.

This works quite nice. Should I use glNormal3fv, glVertex3fv,... to do the drawings or should I better use other methods?
Previously I used vertex arrays but that's rather restricted.


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Sa Mär 26, 2005 21:56 
Offline
DGL Member
Benutzeravatar

Registriert: Sa Nov 13, 2004 11:00
Beiträge: 229
Wohnort: Steinhude
normally I would prefer using vertexarrays or vertex buffer objects, since these are much faster.
But since you used those before i'd want to know why you these are too restricted for your needs?


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Sa Apr 02, 2005 09:56 
Offline
DGL Member

Registriert: Fr Aug 13, 2004 17:43
Beiträge: 60
Wohnort: Belgien
It is not possible to enable or disable OpenGL capabilities while drawing a vertex array. If you use vertex array's for a tile based landscape you can't add a tile with more polygons or just remove a tile from the landscape.

I just found that my video card supports Vertex Buffers. I tried a nehe demo but i don't think that Vertex Buffers are faster than using glvertex3f.


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Sa Apr 02, 2005 10:49 
Offline
Guitar Hero
Benutzeravatar

Registriert: Do Sep 25, 2003 15:56
Beiträge: 7810
Wohnort: Sachsen - ERZ / C
Programmiersprache: Java (, Pascal)
Does your card support the buffers in hardware, or are thy yust software emulated?[/code]

_________________
Blog: kevin-fleischer.de und fbaingermany.com


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Sa Apr 02, 2005 12:01 
Offline
DGL Member

Registriert: Fr Aug 13, 2004 17:43
Beiträge: 60
Wohnort: Belgien
I previously thought VBO's were not supported so they might be emulated by mesa (I'm using Linux) or the driver.


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Sa Apr 02, 2005 12:14 
Offline
DGL Member
Benutzeravatar

Registriert: Sa Dez 28, 2002 11:13
Beiträge: 2244
Vertex Buffers are usually many times faster than glbegin/glend. There are supported in hw since the gf1.


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Sa Apr 02, 2005 14:00 
Offline
DGL Member

Registriert: Fr Aug 13, 2004 17:43
Beiträge: 60
Wohnort: Belgien
Thanks.
I can't find GL_ARB_vertex_buffer_object in the extention list at http://www.delphi3d.net/hardware/viewre ... eport=1076 so VBO's are probably emulated.


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Sa Apr 02, 2005 17:11 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
Vertex Arrays are flexable. You just modify the data passed to them on the fly. For example say u hold all ur levels Vertex's in an arrray called Vertexs, and say u hold the face data in a array called Faces (original Names eh)

You can then have a procedure like

Code:
  1.  
  2. Procedure Draw;
  3. Var
  4. VertexList : array of TVector3f;
  5. x,y,c : integer;
  6. begin
  7.  
  8. C := 0;
  9.  
  10. SetLength(VertexList,NumOfVertexs); //NumOfVertexs = Amount in Vertexs array, we set it to the max amount since setting it over and over will cause lag
  11.  
  12. for x := 0 to NumOfFaces-1 do
  13. If Face[x].Draw then
  14. for y := Face[x].VertexStart to Face[x].VertexStart+Face[x].NumOfVerts-1 do
  15. begin
  16. VertexList[c] := Vertexs[y];
  17. inc(c);
  18. end;
  19.  
  20.  
  21. Pass VertexList to array with c as the count
  22. ...
  23. Etc
  24.  
  25. end;
  26.  


Making a list each frame doesn't seem to cause any lag

_________________
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mo Apr 04, 2005 20:59 
Offline
DGL Member

Registriert: Fr Aug 13, 2004 17:43
Beiträge: 60
Wohnort: Belgien
Is it possible to change the textures while using vertex array's? Or should I put all textures in one texture and then change the texture coördinates?


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Di Apr 05, 2005 13:58 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
when i use them im only sending one face to opengl at a time. so a texture is bound for each face.

Your solution may work better for you.

_________________
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Apr 20, 2005 09:08 
Offline
DGL Member
Benutzeravatar

Registriert: Do Dez 11, 2003 13:23
Beiträge: 25
Wohnort: South Africa
Your best solution would probably be to sort the frustrum culled tiles by the type of textures you are applying, and use a VBO per list of Tiles

This way you get the maximum amount of polygons in one list, with the least amount of material changes. :)

_________________
Im out of my mind but please leave a message...
www.sulaco.co.za


Nach oben
 Profil  
Mit Zitat antworten  
Beiträge der letzten Zeit anzeigen:  Sortiere nach  
Ein neues Thema erstellen Auf das Thema antworten  [ 11 Beiträge ] 
Foren-Übersicht » English » English Programming Forum


Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 1 Gast


Du darfst keine neuen Themen in diesem Forum erstellen.
Du darfst keine Antworten zu Themen in diesem Forum erstellen.
Du darfst deine Beiträge in diesem Forum nicht ändern.
Du darfst deine Beiträge in diesem Forum nicht löschen.
Du darfst keine Dateianhänge in diesem Forum erstellen.

Suche nach:
Gehe zu:  
cron
  Powered by phpBB® Forum Software © phpBB Group
Deutsche Übersetzung durch phpBB.de
[ Time : 0.012s | 16 Queries | GZIP : On ]