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

Aktuelle Zeit: Do Jul 10, 2025 10:35

Foren-Übersicht » Programmierung » Einsteiger-Fragen
Unbeantwortete Themen | Aktive Themen



Ein neues Thema erstellen Auf das Thema antworten  [ 6 Beiträge ] 
Autor Nachricht
 Betreff des Beitrags: Frustum-Fehler
BeitragVerfasst: Di Jun 29, 2004 14:35 
Offline
DGL Member

Registriert: Sa Feb 28, 2004 15:36
Beiträge: 40
Hallo,

ich habe hier mal wieder ein Problem. Ich habe jetzt noch mal meinen Code (siehe vorherigen Post) überarbeitet und ein wenig verbessert.
Hier ist er noch mal:

Code:
  1.  
  2.     for x := 1 to map_width do
  3.     begin
  4.       for y := 1 to map_width do
  5.       begin
  6.         glBindTexture(GL_TEXTURE_2D,tex[map[x,y]]);
  7.  
  8.  
  9.         ///////////////////////////////
  10.         /// Haupt-Quad = ohne Alpha ///
  11.         ///////////////////////////////
  12.  
  13.         glColor4f(1,1,1,1);
  14.  
  15.         if myfrustum_n.IsSphereWithin(x*q_w +(q_w/2), y*q_w  +(q_w/2),b,q_w) then
  16.         begin
  17.           glBegin(GL_QUADS);
  18.             glTexCoord2f(0,0);  glVertex3f(x*q_w   , y*q_w    ,b);
  19.             glTexCoord2f(0,1);  glVertex3f(x*q_w +q_w, y*q_w    ,b);
  20.             glTexCoord2f(1,1);  glVertex3f(x*q_w +q_w, y*q_w  +q_w,b);
  21.             glTexCoord2f(1,0);  glVertex3f(x*q_w   , y*q_w  +q_w,b);
  22.           glEnd;
  23.           pf := pf + 1;
  24.         end;
  25.  
  26.         ///////////////////////////////
  27.         /// Neben-Quads = mit Alpha ///
  28.         ///////////////////7///////////
  29.  
  30.         if (myfrustum_n.IsPointWithin(x*q_w -q_w, y*q_w  -q_w,b)) or (Frustum.IsPointWithin(x*q_w   , y*q_w  -q_w,b)) or (Frustum.IsPointWithin(x*q_w   , y*q_w    ,b)) or (Frustum.IsPointWithin(x*q_w -q_w, y*q_w    ,b)) then
  31.         begin
  32.           glBegin(GL_QUADS);
  33.             glColor4f(1,1,1,0);
  34.             glTexCoord2f(0,0);  glVertex3f(x*q_w -q_w, y*q_w  -q_w,b);  //  Quad links unten
  35.             glTexCoord2f(0,1);  glVertex3f(x*q_w   , y*q_w  -q_w,b);
  36.             glColor4f(1,1,1,1);
  37.             glTexCoord2f(1,1);  glVertex3f(x*q_w   , y*q_w    ,b);
  38.             glColor4f(1,1,1,0);
  39.             glTexCoord2f(1,0);  glVertex3f(x*q_w -q_w, y*q_w    ,b);
  40.           glEnd;
  41.           pf := pf + 1;
  42.         end;
  43.  
  44.         if (myfrustum_n.IsPointWithin(x*q_w -q_w, y*q_w    ,b)) or (Frustum.IsPointWithin(x*q_w   , y*q_w    ,b)) or (Frustum.IsPointWithin(x*q_w   , y*q_w  +q_w,b)) or (Frustum.IsPointWithin(x*q_w -q_w, y*q_w  +q_w,b)) then
  45.         begin
  46.           glBegin(GL_QUADS);
  47.             glColor4f(1,1,1,0);
  48.             glTexCoord2f(0,0);  glVertex3f(x*q_w -q_w, y*q_w    ,b);  //  Quad links
  49.             glColor4f(1,1,1,1);
  50.             glTexCoord2f(0,1);  glVertex3f(x*q_w   , y*q_w    ,b);
  51.             glTexCoord2f(1,1);  glVertex3f(x*q_w   , y*q_w  +q_w,b);
  52.             glColor4f(1,1,1,0);
  53.             glTexCoord2f(1,0);  glVertex3f(x*q_w -q_w, y*q_w  +q_w,b);
  54.           glEnd;
  55.           pf := pf + 1;
  56.         end;
  57.  
  58.         if (myfrustum_n.IsPointWithin(x*q_w -q_w, y*q_w  +q_w,b)) or (Frustum.IsPointWithin(x*q_w   , y*q_w  +q_w,b)) or (Frustum.IsPointWithin(x*q_w   , y*q_w  +(2*q_w),b)) or (Frustum.IsPointWithin(x*q_w -q_w, y*q_w  +(2*q_w),b)) then
  59.         begin
  60.           glBegin(GL_QUADS);
  61.             glColor4f(1,1,1,0);
  62.             glTexCoord2f(0,0);  glVertex3f(x*q_w -q_w, y*q_w  +q_w,b);  //  Quad links oben
  63.             glColor4f(1,1,1,1);
  64.             glTexCoord2f(0,1);  glVertex3f(x*q_w   , y*q_w  +q_w,b);
  65.             glColor4f(1,1,1,0);
  66.             glTexCoord2f(1,1);  glVertex3f(x*q_w   , y*q_w  +(2*q_w),b);
  67.             glTexCoord2f(1,0);  glVertex3f(x*q_w -q_w, y*q_w  +(2*q_w),b);
  68.           glEnd;
  69.           pf := pf + 1;
  70.         end;
  71.  
  72.         if (myfrustum_n.IsPointWithin(x*q_w -q_w+(2*q_w), y*q_w  -q_w,b)) or (Frustum.IsPointWithin(x*q_w   +(2*q_w), y*q_w  -q_w,b)) or (Frustum.IsPointWithin(x*q_w   +(2*q_w), y*q_w    ,b)) or (Frustum.IsPointWithin(x*q_w -q_w+(2*q_w), y*q_w    ,b)) then
  73.         begin
  74.           glBegin(GL_QUADS);
  75.             glColor4f(1,1,1,0);
  76.             glTexCoord2f(0,0);  glVertex3f(x*q_w -q_w+(2*q_w), y*q_w  -q_w,b);  //  Quad rechts unten
  77.             glTexCoord2f(0,1);  glVertex3f(x*q_w   +(2*q_w), y*q_w  -q_w,b);
  78.             glTexCoord2f(1,1);  glVertex3f(x*q_w   +(2*q_w), y*q_w    ,b);
  79.             glColor4f(1,1,1,1);
  80.             glTexCoord2f(1,0);  glVertex3f(x*q_w -q_w+(2*q_w), y*q_w    ,b);
  81.           glEnd;
  82.           pf := pf + 1;
  83.         end;
  84.  
  85.         if (myfrustum_n.IsPointWithin(x*q_w -q_w+(2*q_w), y*q_w    ,b)) or (Frustum.IsPointWithin(x*q_w   +(2*q_w), y*q_w    ,b)) or (Frustum.IsPointWithin(x*q_w   +(2*q_w), y*q_w  +q_w,b)) or (Frustum.IsPointWithin(x*q_w -q_w+(2*q_w), y*q_w  +q_w,b)) then
  86.         begin
  87.           glBegin(GL_QUADS);
  88.             glColor4f(1,1,1,1);
  89.             glTexCoord2f(0,0);  glVertex3f(x*q_w -q_w+(2*q_w), y*q_w    ,b);  //  Quad rechts
  90.             glColor4f(1,1,1,0);
  91.             glTexCoord2f(0,1);  glVertex3f(x*q_w   +(2*q_w), y*q_w    ,b);
  92.             glTexCoord2f(1,1);  glVertex3f(x*q_w   +(2*q_w), y*q_w  +q_w,b);
  93.             glColor4f(1,1,1,1);
  94.             glTexCoord2f(1,0);  glVertex3f(x*q_w -q_w+(2*q_w), y*q_w  +q_w,b);
  95.           glEnd;
  96.           pf := pf + 1;
  97.         end;
  98.  
  99.         if (myfrustum_n.IsPointWithin(x*q_w -q_w+(2*q_w), y*q_w  +q_w,b)) or (Frustum.IsPointWithin(x*q_w   +(2*q_w), y*q_w  +q_w,b)) or (Frustum.IsPointWithin(x*q_w   +(2*q_w), y*q_w  +(2*q_w),b)) or (Frustum.IsPointWithin(x*q_w -q_w+(2*q_w), y*q_w  +(2*q_w),b)) then
  100.         begin
  101.           glBegin(GL_QUADS);
  102.             glColor4f(1,1,1,1);
  103.             glTexCoord2f(0,0);  glVertex3f(x*q_w -q_w+(2*q_w), y*q_w  +q_w,b);  //  Quad rechts oben
  104.             glColor4f(1,1,1,0);
  105.             glTexCoord2f(0,1);  glVertex3f(x*q_w   +(2*q_w), y*q_w  +q_w,b);
  106.             glTexCoord2f(1,1);  glVertex3f(x*q_w   +(2*q_w), y*q_w  +(2*q_w),b);
  107.             glTexCoord2f(1,0);  glVertex3f(x*q_w -q_w+(2*q_w), y*q_w  +(2*q_w),b);
  108.           glEnd;
  109.         pf := pf + 1;
  110.         end;
  111.  
  112.         if (myfrustum_n.IsPointWithin(x*q_w     , y*q_w  +q_w,b)) or (Frustum.IsPointWithin(x*q_w   +q_w, y*q_w  +q_w,b)) or (Frustum.IsPointWithin(x*q_w   +q_w, y*q_w  +(2*q_w),b)) or (Frustum.IsPointWithin(x*q_w     , y*q_w  +(2*q_w),b)) then
  113.         begin
  114.           glBegin(GL_QUADS);
  115.             glColor4f(1,1,1,1);
  116.             glTexCoord2f(0,0);  glVertex3f(x*q_w     , y*q_w  +q_w,b);  // Quad oben
  117.             glTexCoord2f(0,1);  glVertex3f(x*q_w   +q_w, y*q_w  +q_w,b);
  118.             glColor4f(1,1,1,0);
  119.             glTexCoord2f(1,1);  glVertex3f(x*q_w   +q_w, y*q_w  +(2*q_w),b);
  120.             glTexCoord2f(1,0);  glVertex3f(x*q_w     , y*q_w  +(2*q_w),b);
  121.           glEnd;
  122.           pf := pf + 1;
  123.         end;
  124.  
  125.         if (myfrustum_n.IsPointWithin(x*q_w     , y*q_w  +q_w-(2*q_w),b)) or (Frustum.IsPointWithin(x*q_w   +q_w, y*q_w  +q_w-(2*q_w),b)) or (Frustum.IsPointWithin(x*q_w   +q_w, y*q_w  +(2*q_w)-(2*q_w),b)) or (Frustum.IsPointWithin(x*q_w     , y*q_w  +(2*q_w)-(2*q_w),b)) then
  126.         begin
  127.           glBegin(GL_QUADS);
  128.             glColor4f(1,1,1,0);
  129.             glTexCoord2f(0,0);  glVertex3f(x*q_w     , y*q_w  +q_w-(2*q_w),b);  // Quad unten
  130.             glTexCoord2f(0,1);  glVertex3f(x*q_w   +q_w, y*q_w  +q_w-(2*q_w),b);
  131.             glColor4f(1,1,1,1);
  132.             glTexCoord2f(1,1);  glVertex3f(x*q_w   +q_w, y*q_w  +(2*q_w)-(2*q_w),b);
  133.             glTexCoord2f(1,0);  glVertex3f(x*q_w     , y*q_w  +(2*q_w)-(2*q_w),b);
  134.           glEnd;
  135.           pf := pf + 1;
  136.         end;
  137.  
  138.     end;
  139.   end;
  140.   glform.Caption := inttostr(pf)+' - v_x:'+floattostr(view_x)+' - v_y:'+floattostr(view_y);
  141. end;
  142.  


Mein Problem: Wenn man nach rechts geht, verschwinden die Quads am linken Rand zu schnell. Man sieht dann plötzlich nicht mehr alles, was man eigentlich sehen sollte. Das gleiche passiert beim Hochlaufen.

Außerdem lässt die Geschwindigkeit sehr zu wünschen übrig!
Leider liegt es, wie SoS schon richtig vermutet hatte, an der Fillrate. Meine CPU (auch eine Vermutung von SoS) ist aber nicht sehr ausgelastet. (15% durchschnittlich)
Was kann ich noch tun? Es kann doch nicht sein, dass meine GraKa es nicht schafft, so ein paar Quads (ca. 400) zu zeichnen aber Battlefield flüssig läuft und auch riesige Karten rendert.

Danke schon mal.


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Di Jun 29, 2004 14:43 
Offline
DGL Member
Benutzeravatar

Registriert: Mo Sep 23, 2002 19:27
Beiträge: 5812
Programmiersprache: C++
@CPU-Auslastung :
Wieso nur 15%? Wie renderst du denn? Im Normalfall macht man entweder ne eigene Renderschleife oder rendert im OnIdle-Event und setzt Done auf False. So hat man immer 100% CPU-Auslastung und rendert so schnell wie möglich. Ich schätze mal das hier dein Problem liegt.

@Frustum :
Zeig mal die Codestelle an der du dein Frustum erstellst. Ich schätze mal das da was schief läuft.

_________________
www.SaschaWillems.de | GitHub | Twitter | GPU Datenbanken (Vulkan, GL, GLES)


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags: re
BeitragVerfasst: Di Jun 29, 2004 14:46 
Offline
DGL Member

Registriert: Sa Feb 28, 2004 15:36
Beiträge: 40
Ich benutze das opengl15_vcl template. An 'Bremsern' o.ä. habe ich nichts mehr eingebaut.
Ich benutze die Frustum-Procedure von www.delphigl.de.


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Di Jun 29, 2004 14:51 
Offline
DGL Member
Benutzeravatar

Registriert: Mo Sep 23, 2002 19:27
Beiträge: 5812
Programmiersprache: C++
Das Tutorial stammt von mir *hust*, aber ich meinte nicht die Frustum-Klasse an sich, sondern die Codestelle aus deinem Programm an der du Frustum.Calculate aufrufst.
Ansonsten stimmt da wohl was nicht wenn du nur 15% CPU-Auslastung hast, denn das Template (ist übrigens auch von mir) sollte deine CPU zu 100% auslasten. Wie hoch sind denn im Template die FpS ohne das du was renderst?

_________________
www.SaschaWillems.de | GitHub | Twitter | GPU Datenbanken (Vulkan, GL, GLES)


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags: re
BeitragVerfasst: Di Jun 29, 2004 15:02 
Offline
DGL Member

Registriert: Sa Feb 28, 2004 15:36
Beiträge: 40
das ist schnell gesagt:

a) genau vor meinem geposteten Code
b) ca 470 fps @ 800*600 Pixels @ 100% CPU Auslastung

mmh... verwundert mich jetzt schon wieso ich da 100% Auslastung habe...

ohne diesen Code habe ich 100% Auslastung:

Code:
  1.  
  2. procedure DrawCurrentMap;
  3. var x,y, pf,t: integer;
  4. myfrustum_n:TFrustum;
  5. begin
  6. //  changeto3d;
  7.   glEnable(GL_TEXTURE_2D);
  8.   pf := 0;
  9.   glloadidentity;
  10.   if mouse.CursorPos.X > scrw - 3 then view_x := view_x - 0.1;
  11.   if mouse.CursorPos.X < 3 then view_x := view_x + 0.1;
  12.   if mouse.CursorPos.Y > scrh - 3 then view_y := view_y + 0.1;
  13.   if mouse.CursorPos.Y < 3 then view_y := view_y - 0.1;
  14.  
  15.   if getAsyncKeyState(vk_left) <> 0 then view_x := view_x + 0.3;
  16.   if getAsyncKeyState(vk_right) <> 0 then view_x := view_x - 0.3;
  17.   if getAsyncKeyState(vk_up) <> 0 then view_y := view_y - 0.3;
  18.   if getAsyncKeyState(vk_down) <> 0 then view_y := view_y + 0.3;
  19.  
  20.   if getAsyncKeyState(ord('Q')) <> 0 then view_z := view_z - 0.6;
  21.   if getAsyncKeyState(ord('A')) <> 0 then view_z := view_z + 0.6;
  22.  
  23.   glDepthFunc(GL_LEQUAL);
  24.   gltranslatef(view_x,view_y,view_z-10);
  25. //  glrotatef(-70,1,0,0);
  26.   glEnable(GL_BLEND);
  27.   glBlendFunc(GL_SRC_ALPHA_SATURATE,GL_DST_ALPHA);
  28.  
  29.  
  30.   myfrustum_n.Calculate;
  31. {  for x := 1 to map_width do
  32.   begin
  33.     for y := 1 to map_width do
  34.     begin
  35.       myfrustum_n.Calculate;
  36.       glBindTexture(GL_TEXTURE_2D,tex[(map[x,y])]);
  37.       glColor4f(1,1,1,1);
  38.       if myFrustum_n.IsSphereWithin(x*q_w +(q_w/2), y*q_w  +(q_w/2),b,q_w) then
  39.       begin
  40.         glBegin(GL_QUADS);
  41.           glTexCoord2f(0,0);  glVertex3f(x*q_w   , y*q_w    ,b);
  42.           glTexCoord2f(0,1);  glVertex3f(x*q_w +q_w, y*q_w    ,b);
  43.           glTexCoord2f(1,1);  glVertex3f(x*q_w +q_w, y*q_w  +q_w,b);
  44.           glTexCoord2f(1,0);  glVertex3f(x*q_w   , y*q_w  +q_w,b);
  45.         glEnd;
  46.         inc(pf);
  47.       end;
  48.     end;
  49.   end;
  50. }
  51.  
  52.     for x := 1 to map_width do
  53.     begin
  54.       for y := 1 to map_width do
  55.       begin
  56.         glBindTexture(GL_TEXTURE_2D,tex[map[x,y]]);
  57.  
  58.  
  59.         ///////////////////////////////
  60.         /// Haupt-Quad = ohne Alpha ///
  61.         ///////////////////////////////
  62.  
  63.         glColor4f(1,1,1,1);
  64.  
  65.         if myfrustum_n.IsSphereWithin(x*q_w +(q_w/2), y*q_w  +(q_w/2),b,q_w) then
  66.         begin
  67.           glBegin(GL_QUADS);
  68.             glTexCoord2f(0,0);  glVertex3f(x*q_w   , y*q_w    ,b);
  69.             glTexCoord2f(0,1);  glVertex3f(x*q_w +q_w, y*q_w    ,b);
  70.             glTexCoord2f(1,1);  glVertex3f(x*q_w +q_w, y*q_w  +q_w,b);
  71.             glTexCoord2f(1,0);  glVertex3f(x*q_w   , y*q_w  +q_w,b);
  72.           glEnd;
  73.           pf := pf + 1;
  74.         end;
  75.  
  76.         ///////////////////////////////
  77.         /// Neben-Quads = mit Alpha ///
  78.         ///////////////////7///////////
  79.  
  80.         if (myfrustum_n.IsPointWithin(x*q_w -q_w, y*q_w  -q_w,b)) or (Frustum.IsPointWithin(x*q_w   , y*q_w  -q_w,b)) or (Frustum.IsPointWithin(x*q_w   , y*q_w    ,b)) or (Frustum.IsPointWithin(x*q_w -q_w, y*q_w    ,b)) then
  81.         begin
  82.           glBegin(GL_QUADS);
  83.             glColor4f(1,1,1,0);
  84.             glTexCoord2f(0,0);  glVertex3f(x*q_w -q_w, y*q_w  -q_w,b);  //  Quad links unten
  85.             glTexCoord2f(0,1);  glVertex3f(x*q_w   , y*q_w  -q_w,b);
  86.             glColor4f(1,1,1,1);
  87.             glTexCoord2f(1,1);  glVertex3f(x*q_w   , y*q_w    ,b);
  88.             glColor4f(1,1,1,0);
  89.             glTexCoord2f(1,0);  glVertex3f(x*q_w -q_w, y*q_w    ,b);
  90.           glEnd;
  91.           pf := pf + 1;
  92.         end;
  93.  
  94.         if (myfrustum_n.IsPointWithin(x*q_w -q_w, y*q_w    ,b)) or (Frustum.IsPointWithin(x*q_w   , y*q_w    ,b)) or (Frustum.IsPointWithin(x*q_w   , y*q_w  +q_w,b)) or (Frustum.IsPointWithin(x*q_w -q_w, y*q_w  +q_w,b)) then
  95.         begin
  96.           glBegin(GL_QUADS);
  97.             glColor4f(1,1,1,0);
  98.             glTexCoord2f(0,0);  glVertex3f(x*q_w -q_w, y*q_w    ,b);  //  Quad links
  99.             glColor4f(1,1,1,1);
  100.             glTexCoord2f(0,1);  glVertex3f(x*q_w   , y*q_w    ,b);
  101.             glTexCoord2f(1,1);  glVertex3f(x*q_w   , y*q_w  +q_w,b);
  102.             glColor4f(1,1,1,0);
  103.             glTexCoord2f(1,0);  glVertex3f(x*q_w -q_w, y*q_w  +q_w,b);
  104.           glEnd;
  105.           pf := pf + 1;
  106.         end;
  107.  
  108.         if (myfrustum_n.IsPointWithin(x*q_w -q_w, y*q_w  +q_w,b)) or (Frustum.IsPointWithin(x*q_w   , y*q_w  +q_w,b)) or (Frustum.IsPointWithin(x*q_w   , y*q_w  +(2*q_w),b)) or (Frustum.IsPointWithin(x*q_w -q_w, y*q_w  +(2*q_w),b)) then
  109.         begin
  110.           glBegin(GL_QUADS);
  111.             glColor4f(1,1,1,0);
  112.             glTexCoord2f(0,0);  glVertex3f(x*q_w -q_w, y*q_w  +q_w,b);  //  Quad links oben
  113.             glColor4f(1,1,1,1);
  114.             glTexCoord2f(0,1);  glVertex3f(x*q_w   , y*q_w  +q_w,b);
  115.             glColor4f(1,1,1,0);
  116.             glTexCoord2f(1,1);  glVertex3f(x*q_w   , y*q_w  +(2*q_w),b);
  117.             glTexCoord2f(1,0);  glVertex3f(x*q_w -q_w, y*q_w  +(2*q_w),b);
  118.           glEnd;
  119.           pf := pf + 1;
  120.         end;
  121.  
  122.         if (myfrustum_n.IsPointWithin(x*q_w -q_w+(2*q_w), y*q_w  -q_w,b)) or (Frustum.IsPointWithin(x*q_w   +(2*q_w), y*q_w  -q_w,b)) or (Frustum.IsPointWithin(x*q_w   +(2*q_w), y*q_w    ,b)) or (Frustum.IsPointWithin(x*q_w -q_w+(2*q_w), y*q_w    ,b)) then
  123.         begin
  124.           glBegin(GL_QUADS);
  125.             glColor4f(1,1,1,0);
  126.             glTexCoord2f(0,0);  glVertex3f(x*q_w -q_w+(2*q_w), y*q_w  -q_w,b);  //  Quad rechts unten
  127.             glTexCoord2f(0,1);  glVertex3f(x*q_w   +(2*q_w), y*q_w  -q_w,b);
  128.             glTexCoord2f(1,1);  glVertex3f(x*q_w   +(2*q_w), y*q_w    ,b);
  129.             glColor4f(1,1,1,1);
  130.             glTexCoord2f(1,0);  glVertex3f(x*q_w -q_w+(2*q_w), y*q_w    ,b);
  131.           glEnd;
  132.           pf := pf + 1;
  133.         end;
  134.  
  135.         if (myfrustum_n.IsPointWithin(x*q_w -q_w+(2*q_w), y*q_w    ,b)) or (Frustum.IsPointWithin(x*q_w   +(2*q_w), y*q_w    ,b)) or (Frustum.IsPointWithin(x*q_w   +(2*q_w), y*q_w  +q_w,b)) or (Frustum.IsPointWithin(x*q_w -q_w+(2*q_w), y*q_w  +q_w,b)) then
  136.         begin
  137.           glBegin(GL_QUADS);
  138.             glColor4f(1,1,1,1);
  139.             glTexCoord2f(0,0);  glVertex3f(x*q_w -q_w+(2*q_w), y*q_w    ,b);  //  Quad rechts
  140.             glColor4f(1,1,1,0);
  141.             glTexCoord2f(0,1);  glVertex3f(x*q_w   +(2*q_w), y*q_w    ,b);
  142.             glTexCoord2f(1,1);  glVertex3f(x*q_w   +(2*q_w), y*q_w  +q_w,b);
  143.             glColor4f(1,1,1,1);
  144.             glTexCoord2f(1,0);  glVertex3f(x*q_w -q_w+(2*q_w), y*q_w  +q_w,b);
  145.           glEnd;
  146.           pf := pf + 1;
  147.         end;
  148.  
  149.         if (myfrustum_n.IsPointWithin(x*q_w -q_w+(2*q_w), y*q_w  +q_w,b)) or (Frustum.IsPointWithin(x*q_w   +(2*q_w), y*q_w  +q_w,b)) or (Frustum.IsPointWithin(x*q_w   +(2*q_w), y*q_w  +(2*q_w),b)) or (Frustum.IsPointWithin(x*q_w -q_w+(2*q_w), y*q_w  +(2*q_w),b)) then
  150.         begin
  151.           glBegin(GL_QUADS);
  152.             glColor4f(1,1,1,1);
  153.             glTexCoord2f(0,0);  glVertex3f(x*q_w -q_w+(2*q_w), y*q_w  +q_w,b);  //  Quad rechts oben
  154.             glColor4f(1,1,1,0);
  155.             glTexCoord2f(0,1);  glVertex3f(x*q_w   +(2*q_w), y*q_w  +q_w,b);
  156.             glTexCoord2f(1,1);  glVertex3f(x*q_w   +(2*q_w), y*q_w  +(2*q_w),b);
  157.             glTexCoord2f(1,0);  glVertex3f(x*q_w -q_w+(2*q_w), y*q_w  +(2*q_w),b);
  158.           glEnd;
  159.         pf := pf + 1;
  160.         end;
  161.  
  162.         if (myfrustum_n.IsPointWithin(x*q_w     , y*q_w  +q_w,b)) or (Frustum.IsPointWithin(x*q_w   +q_w, y*q_w  +q_w,b)) or (Frustum.IsPointWithin(x*q_w   +q_w, y*q_w  +(2*q_w),b)) or (Frustum.IsPointWithin(x*q_w     , y*q_w  +(2*q_w),b)) then
  163.         begin
  164.           glBegin(GL_QUADS);
  165.             glColor4f(1,1,1,1);
  166.             glTexCoord2f(0,0);  glVertex3f(x*q_w     , y*q_w  +q_w,b);  // Quad oben
  167.             glTexCoord2f(0,1);  glVertex3f(x*q_w   +q_w, y*q_w  +q_w,b);
  168.             glColor4f(1,1,1,0);
  169.             glTexCoord2f(1,1);  glVertex3f(x*q_w   +q_w, y*q_w  +(2*q_w),b);
  170.             glTexCoord2f(1,0);  glVertex3f(x*q_w     , y*q_w  +(2*q_w),b);
  171.           glEnd;
  172.           pf := pf + 1;
  173.         end;
  174.  
  175.         if (myfrustum_n.IsPointWithin(x*q_w     , y*q_w  +q_w-(2*q_w),b)) or (Frustum.IsPointWithin(x*q_w   +q_w, y*q_w  +q_w-(2*q_w),b)) or (Frustum.IsPointWithin(x*q_w   +q_w, y*q_w  +(2*q_w)-(2*q_w),b)) or (Frustum.IsPointWithin(x*q_w     , y*q_w  +(2*q_w)-(2*q_w),b)) then
  176.         begin
  177.           glBegin(GL_QUADS);
  178.             glColor4f(1,1,1,0);
  179.             glTexCoord2f(0,0);  glVertex3f(x*q_w     , y*q_w  +q_w-(2*q_w),b);  // Quad unten
  180.             glTexCoord2f(0,1);  glVertex3f(x*q_w   +q_w, y*q_w  +q_w-(2*q_w),b);
  181.             glColor4f(1,1,1,1);
  182.             glTexCoord2f(1,1);  glVertex3f(x*q_w   +q_w, y*q_w  +(2*q_w)-(2*q_w),b);
  183.             glTexCoord2f(1,0);  glVertex3f(x*q_w     , y*q_w  +(2*q_w)-(2*q_w),b);
  184.           glEnd;
  185.           pf := pf + 1;
  186.         end;
  187.  
  188.     end;
  189.   end;
  190.   glform.Caption := inttostr(pf)+' - v_x:'+floattostr(view_x)+' - v_y:'+floattostr(view_y);
  191. end;


so... ^^das war jetzt so ziemlich alles was ich an dem template verändert habe.


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Di Jun 29, 2004 15:24 
Offline
DGL Member
Benutzeravatar

Registriert: Mo Sep 23, 2002 19:27
Beiträge: 5812
Programmiersprache: C++
Code:
  1. glform.Caption := inttostr(pf)+' - v_x:'+floattostr(view_x)+' - v_y:'+floattostr(view_y);

Genau das ist dein Problem. Wenn du die Caption deiner Form in jedem Frame aktualisierst, dann zerrt das ganz mächtig an der Performance, und könnte auch die (vermeintlich) geringe CPU-Auslastung erklären!

_________________
www.SaschaWillems.de | GitHub | Twitter | GPU Datenbanken (Vulkan, GL, GLES)


Nach oben
 Profil  
Mit Zitat antworten  
Beiträge der letzten Zeit anzeigen:  Sortiere nach  
Ein neues Thema erstellen Auf das Thema antworten  [ 6 Beiträge ] 
Foren-Übersicht » Programmierung » Einsteiger-Fragen


Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 6 Gäste


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:  
  Powered by phpBB® Forum Software © phpBB Group
Deutsche Übersetzung durch phpBB.de
[ Time : 0.009s | 16 Queries | GZIP : On ]