DGL
https://delphigl.com/forum/

problem binding matrix from shader
https://delphigl.com/forum/viewtopic.php?f=20&t=8905
Seite 1 von 1

Autor:  noeska [ Mi Dez 30, 2009 00:06 ]
Betreff des Beitrags:  problem binding matrix from shader

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?

Autor:  Coolcat [ Mi Dez 30, 2009 00:40 ]
Betreff des Beitrags:  Re: problem binding matrix from shader

You don't use normalMatrix in your shader, because the line is commented out.
=> the shader compiler does remove unused uniforms.

Autor:  noeska [ Mi Dez 30, 2009 11:41 ]
Betreff des Beitrags:  Re: problem binding matrix from shader

: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

Seite 1 von 1 Alle Zeiten sind UTC + 1 Stunde
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/