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

Aktuelle Zeit: Sa Jul 05, 2025 11:31

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



Ein neues Thema erstellen Auf das Thema antworten  [ 33 Beiträge ]  Gehe zu Seite Vorherige  1, 2, 3  Nächste
Autor Nachricht
 Betreff des Beitrags:
BeitragVerfasst: Fr Jan 11, 2008 09:18 
Offline
DGL Member
Benutzeravatar

Registriert: Do Dez 05, 2002 10:35
Beiträge: 4234
Wohnort: Dortmund
I dosn't read this thread all the time so im a bit late. ;)

Your texture isn't power of two. The opengl implementation from ati supports opengl core 2.0 which means they also supports non power of two textures. But if you are using npot with mip maps the driver falls back into an software mode. This is the reason for the terrible performance with around 3 fps. Expand the 124x124 into 128x128 and all should work fine.

Normally the glBitmap raises an error if the graphics card dosn't support npot tetxures but ati means they "support" it.


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Fr Jan 11, 2008 09:58 
Offline
DGL Member

Registriert: So Aug 06, 2006 08:48
Beiträge: 91
Great! Big THX @ all! Now I just have to find the mistake in my sourcecode, noeska's example works perfect.^^
Dankeschön an Alle! Jetzt muss ich nurnoch den Fehler in meinem Projekt finden, das Bsp funzt jetzt einwandfrei. :)

mfg


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Fr Jan 11, 2008 10:19 
Offline
DGL Member

Registriert: So Aug 06, 2006 08:48
Beiträge: 91
Bad news:^^ Now my project renders the cube right, too but the error "stack underflow" appears anyway. In noeska's example it appears, too if I insert this:
Code:
  1. procedure TForm_Main.ErrorHandler;
  2. var
  3.   s: string;
  4. begin
  5.   s := gluErrorString(glGetError);
  6.   if s <> 'no error' then
  7.     Showmessage('OpenGL meldet: "' + s + '"');
  8. end;

Code:
  1. IdleHandler(Sender: TObject; var Done: Boolean); ... ErrorHandler; ...


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: So Jan 20, 2008 08:26 
Offline
DGL Member

Registriert: So Aug 06, 2006 08:48
Beiträge: 91
*push*


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: So Jan 20, 2008 13:20 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
From where is your .render called?

Also i think you should call gluErrorString directly after the command you want to check if it gives an error. There is no need doing this in an on idle event i think that in your case the glErrorString is causing your error.

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: So Jan 20, 2008 16:23 
Offline
DGL Member

Registriert: So Aug 06, 2006 08:48
Beiträge: 91
Model.Render is called in TMain_Form.Render which is called in TMain_Form.IdleHandler. ErrorHandler is called every 500ms:
Code:
  1. //==============================================================================
  2. // IdleHandler
  3. //==============================================================================
  4. procedure TForm_Main.IdleHandler(Sender: TObject; var Done: Boolean);
  5. var
  6.   QPCStartCount, QPCEndCount : Int64;
  7. begin
  8.   QueryPerformanceCounter(QPCStartCount);
  9.   Render;
  10.   QueryPerformanceCounter(QPCEndCount);
  11.   DrawTime := (QPCEndCount - QPCStartCount) / PerfCounterFreq * 1000;
  12.   TimeCount := TimeCount + DrawTime;
  13.  
  14.   if TimeCount >= 500 then
  15.   begin
  16.     Caption := FloatToStr(Round((1000 / DrawTime) * 100) / 100) + ' fps';
  17.     ErrorHandler;
  18.     TimeCount := 0;
  19.   end;
  20.  
  21.   Done := false;
  22. end;


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: So Jan 20, 2008 19:33 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
And did removing the errorhandler help?

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mo Jan 21, 2008 19:06 
Offline
DGL Member

Registriert: So Aug 06, 2006 08:48
Beiträge: 91
Removing .Render did help.^^
How can I output OGL-Errors, without ErrorHandler (-> gluErrorString)?


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mo Jan 21, 2008 20:02 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
Where is your Application.OnIdle := ApplicationEventsIdle; (e.g. your idlehandler) called? It should be after initopengl and activating the rendercontext.

Could you post your complete example?

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Di Jan 22, 2008 17:44 
Offline
DGL Member

Registriert: So Aug 06, 2006 08:48
Beiträge: 91
Application.OnIdle := ApplicationEventsIdle; is called after initopengl and activating the rendercontext in OnFormCreate (Main Form).
Code:
  1. procedure TForm_Main.FormCreate(Sender: TObject);
  2. begin
  3.   SetupGL;
  4.   Init;
  5.   QueryPerformanceFrequency(PerfCounterFreq);
  6.   Application.OnIdle := IdleHandler;
  7. end;

Code:
  1. procedure TForm_Main.SetupGL;
  2. begin
  3.   if not InitOpenGL then
  4.   begin
  5.     ShowMessage('Konnte OpenGL nicht initialisieren!');
  6.     Application.Terminate;
  7.   end;
  8.   DC := GetDC(Handle);
  9.   RC := CreateRenderingContext(DC, [opDoubleBuffered], 32, 24, 0, 0, 0, 0);
  10.   ActivateRenderingContext(DC, RC);
  11.   glEnable(GL_DEPTH_TEST);          // Tiefentest aktivieren
  12.   glDepthFunc(GL_LESS); // Nur Fragmente mit niedrigerem Z-Wert (näher an Betrachter) "durchlassen"
  13.   glEnable(GL_CULL_FACE);           // Backface Culling aktivieren
  14.   glClearColor(0.3, 0.4, 0.7, 0.0); // Hintergrundfarbe: Hier ein leichtes Blau
  15.  
  16.   glMatrixMode(GL_PROJECTION);
  17.   glLoadIdentity;
  18.   glViewPort(0, 0, ClientWidth, ClientHeight);
  19.   gluPerspective(Perspective, ClientWidth/ClientHeight, NearClipping, FarClipping);
  20. end;


Amazing is that the abovementioned error appears in your example to?!


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Di Jan 22, 2008 17:55 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
could you post the compete sourcecode for your example. I (and others) then can give it a try compiling and running it.

what error appears in my example also? A few posts back you said it worked with the gl3ds example?

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Di Jan 22, 2008 18:08 
Offline
DGL Member

Registriert: So Aug 06, 2006 08:48
Beiträge: 91
Yes it works, but I said:
Fabian W. hat geschrieben:
Bad news:^^ Now my project renders the cube right, too but the error "stack underflow" appears anyway. In noeska's example it appears, too if I insert this:
Code:
  1. procedure TForm_Main.ErrorHandler;
  2. var
  3.   s: string;
  4. begin
  5.   s := gluErrorString(glGetError);
  6.   if s <> 'no error' then
  7.     Showmessage('OpenGL meldet: "' + s + '"');
  8. end;

Code:
  1. IdleHandler(Sender: TObject; var Done: Boolean); ... ErrorHandler; ...

A few posts back I said it worked with the gl3ds example - but I forgot to try ErrorHandler; with your example. If you use ErrorHandler (or gluErrorString(glGetError);) in your example it should appear the "stack underflow"-error.

Can I send my sourcecode to you via email, cause it's not only a "example" but a little game I wanna create?!^^


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Jan 23, 2008 18:18 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
Ok found the error. It is in gl3ds.pas in procedure TglMesh.Render;
just before the last end; there needs to be an glpopmatrix(); :oops:

Then you need to check on glgeterror and not on the string result of glugeterrorstring for calling showmessage as my driver outputs dutch errors and so even with no error the combobox is shown. You could use the enum GL_NO_ERROR for that: http://www.opengl.org/documentation/spe ... error.html

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Jan 23, 2008 19:04 
Offline
DGL Member

Registriert: So Aug 06, 2006 08:48
Beiträge: 91
I can't find a procedure called TglMesh.Render; - In which line the procedure starts?


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Jan 23, 2008 20:32 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
Oops i checked using the new rewritten version of gl3ds.
In the gl3ds.pas as released it is in procedure T3dsMesh.Render;
But the problem is different there also as there is an glpopmatrix() just before the last end; So in the old version you need to place it one end upwards. As otherwise when using displaylists a glpopmatrix is executed when no glpushmatrix is executed. But on testing it i get no errors. Not even with the glpopmartix in the wrong place.

if you are using glpopmartix en glpushmatrix yourselves you should check these.

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
Beiträge der letzten Zeit anzeigen:  Sortiere nach  
Ein neues Thema erstellen Auf das Thema antworten  [ 33 Beiträge ]  Gehe zu Seite Vorherige  1, 2, 3  Nächste
Foren-Übersicht » Programmierung » Einsteiger-Fragen


Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 8 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 | 14 Queries | GZIP : On ]