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

Aktuelle Zeit: Di Mai 28, 2024 23:42

Foren-Übersicht » Programmierung » Shader
Unbeantwortete Themen | Aktive Themen



Ein neues Thema erstellen Auf das Thema antworten  [ 3 Beiträge ] 
Autor Nachricht
 Betreff des Beitrags: problem binding matrix from shader
BeitragVerfasst: Mi Dez 30, 2009 00:06 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
On making a bones example it struggled upon the fact that my normalMatrix is not willing to be bound anymore.

This is a part of the shader:
Code:
  1. #version 150
  2.  
  3. uniform mat3 normalMatrix;
  4. uniform mat4 boneMatrices[2];
  5. uniform mat4 projectionMatrix;
  6. uniform mat4 modelViewMatrix;


This is how i call it:
Code:
  1. g_projectionLocation := glslsimpleprog.GetUniformLocation('projectionMatrix');
  2. g_modelViewLocation := glslsimpleprog.GetUniformLocation('modelViewMatrix');
  3. g_normalMatrixLocation := glslsimpleprog.GetUniformLocation('normalMatrix');
  4. g_location_boneMatrices_0   := glslsimpleprog.GetUniformLocation('boneMatrices[0]');
  5. g_location_boneMatrices_1   := glslsimpleprog.GetUniformLocation('boneMatrices[1]');


All other matrices do work and so has the normalMatrix

Here is the complete code:
http://www.noeska.net/downloads/ogl3bones1.zip

What am i missing here?

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


Nach oben
 Profil  
Mit Zitat antworten  
BeitragVerfasst: Mi Dez 30, 2009 00:40 
Offline
DGL Member
Benutzeravatar

Registriert: Do Dez 29, 2005 12:28
Beiträge: 2249
Wohnort: Düsseldorf
Programmiersprache: C++, C#, Java
You don't use normalMatrix in your shader, because the line is commented out.
=> the shader compiler does remove unused uniforms.

_________________
Yeah! :mrgreen:


Nach oben
 Profil  
Mit Zitat antworten  
BeitragVerfasst: Mi Dez 30, 2009 11:41 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
:oops: i see, never thought of that .
Point is that when using the commented out line my pc bugged out completely. But today it works, so somewhere on the way yesterday something got corrupted.
But now it works :-)
Now see if can get the tempnormal work instead of normal in that line ...
That works now also. Dont know what was wrong with my pc yesterday. Better do some more reboots when shaders are bugging.
Anyway here is the bugfixed version: http://www.noeska.net/downloads/ogl3bones3.zip and for those who are interested the original: http://www.codesampler.com/oglsrc/oglsrc_11.htm#ogl_skinning

_________________
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  [ 3 Beiträge ] 
Foren-Übersicht » Programmierung » Shader


Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 22 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.029s | 15 Queries | GZIP : On ]