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?
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 ?)
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 network • my 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
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);
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 network • my 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
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.
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
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.