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

Aktuelle Zeit: Di Mai 14, 2024 04:43

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



Ein neues Thema erstellen Auf das Thema antworten  [ 9 Beiträge ] 
Autor Nachricht
 Betreff des Beitrags: OpenGL 3.x cube problem
BeitragVerfasst: So Dez 20, 2009 20:52 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
Next in my opengl3.x adventures is trying to display a cube, but i must be doing something wrong.

The original is available from: http://nopper.tv/opengl_3_2.html (example03)

This is my attempt: http://www.noeska.net/downloads/Ogl3Cube1.zip .

Who can help me to find out what i do wrong. Also i found the original not to be logic as in the render part i do not see references as to what is rendered?

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


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags: Re: OpenGL 3.x cube problem
BeitragVerfasst: Mo Dez 21, 2009 20:08 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
For now i suspect the following:
g_vertexLocation := glslsimpleprog.GetAttribLocation('vertex');
g_normalLocation := glslsimpleprog.GetAttribLocation('normal');
both give -1 as result. But why?
The attrib is availeable in the vertex shader and the vertex shader compiles succesfully... Only the fragment shader gives an warning...
Now i could set an attrib location, but this should work also (even in opengl 2.x ?)

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


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags: Re: OpenGL 3.x cube problem
BeitragVerfasst: Mo Dez 21, 2009 20:11 
Offline
DGL Member
Benutzeravatar

Registriert: Do Sep 02, 2004 19:42
Beiträge: 4158
Programmiersprache: FreePascal, C++
Did you bind the Shader program properly?

greetings

_________________
If you find any deadlinks, please send me a notification – Wenn du tote Links findest, sende mir eine Benachrichtigung.
current projects: ManiacLab; aioxmpp
zombofant networkmy photostream
„Writing code is like writing poetry“ - source unknown


„Give a man a fish, and you feed him for a day. Teach a man to fish and you feed him for a lifetime. “ ~ A Chinese Proverb


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags: Re: OpenGL 3.x cube problem
BeitragVerfasst: Mo Dez 21, 2009 20:38 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
I think i do, but i am not sure...

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


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags: Re: OpenGL 3.x cube problem
BeitragVerfasst: Di Dez 22, 2009 19:49 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
with getting some wrong results from glGetAttribLocation i was hinted to look in the dglopengl header on the pgd forum and indeed there is a bug as char is specified there as string instead of PGLChar.

OpenGL 3.2 - Headertranslation
Version 3.2.2
Date : 16.12.2009
row 6577 should be:
TglGetAttribLocation = function(programObj: GLhandle; char: PGLChar): glint; {$IFDEF DGL_WIN}stdcall; {$ELSE}cdecl; {$ENDIF}

Not that my cube shows yet, i need to add some more code to the cube example ...

What do you mean by bind?
glLinkProgramARB(FProgramObject);
or
glUseProgram(FProgramObject);

or both?

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


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags: Re: OpenGL 3.x cube problem
BeitragVerfasst: Mi Dez 23, 2009 22:08 
Offline
DGL Member
Benutzeravatar

Registriert: Do Sep 02, 2004 19:42
Beiträge: 4158
Programmiersprache: FreePascal, C++
I meant the glUseProgram call.

greetings

_________________
If you find any deadlinks, please send me a notification – Wenn du tote Links findest, sende mir eine Benachrichtigung.
current projects: ManiacLab; aioxmpp
zombofant networkmy photostream
„Writing code is like writing poetry“ - source unknown


„Give a man a fish, and you feed him for a day. Teach a man to fish and you feed him for a lifetime. “ ~ A Chinese Proverb


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags: Re: OpenGL 3.x cube problem
BeitragVerfasst: Do Dez 24, 2009 19:37 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
I changed my example a bit by adding an vao object.
But it does not work yet :-(
Still a black screen like the original cpp example on my ati, but not a cube as promised.

Here is my new attempt: http://www.noeska.net/downloads/Ogl3Cube2.zip

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


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags: Re: OpenGL 3.x cube problem
BeitragVerfasst: Fr Dez 25, 2009 19:24 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
Found some bugs in passing the arrays trough the calculations. Fixed that.
But still no cube :-(

Latest version:
http://www.noeska.net/downloads/Ogl3Cube3.zip

Who is willing to test the code on nvidia?

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


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags: Re: OpenGL 3.x cube problem
BeitragVerfasst: Fr Dez 25, 2009 23:34 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
Found the real problem :-)
In the resizewindow part i already 'publish' the projectionlocation matrix, but the location is not known yet and default being 0. But when requested its location becomes 1 resulting that it is overwritten by the modelview matrix that gets location 0. So as a workaround i calculate the matrix as before but only 'publish' it in the init part.
And next the cube showed up :-)

Final source: http://www.noeska.net/downloads/Ogl3Cube4.zip

[edit]fixed typo in url[/edit]

_________________
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  [ 9 Beiträge ] 
Foren-Übersicht » English » English Programming Forum


Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 3 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:  
cron
  Powered by phpBB® Forum Software © phpBB Group
Deutsche Übersetzung durch phpBB.de
[ Time : 0.077s | 17 Queries | GZIP : On ]