Quantcast
Channel: Intel Communities: Message List
Viewing all articles
Browse latest Browse all 18582

Re: GLSL driver bug: mat4x3 * vec4 = vec4?!

$
0
0

In GLSL, the type mat4x3 represents a matrix that is 4 columns wide (row-lengths of 4) and 3 rows tall (column-lengths of 3) [source].  The products of a matrix and a vector in GLSL requires the vector's length be the same as the matrix's column-length/row-count [source].

 

What you're seeing — that a matrix with column-lengths of 3 requires the vector to be a vec3— is the correct behavior for GLSL on every platform.  It's much more common to use matrices of size mat4x4 (AKA mat4) when transforming the gl_Vertex to a gl_Position.  Correct solutions to your problem would be to:

  1. Strip off the .w component off of gl_Vertex as you've done, or
  2. To initialize a 4th row of the matrix (as a mat4) to 0,0,0,1 (from bottom-left to bottom-right).

 

Much more information about how GL/GLSL perform standard matrix transformation can be found in this useful post: http://www.songho.ca/opengl/gl_transform.html#modelview

 

The best part about this is the two official Intel reps didn't bother to point out your mistake, they both blindly handed you apologies and courtesies claiming that they're sending the problem off to be fixed.  TL;DR: Intel has some pretty ****** support reps.


Viewing all articles
Browse latest Browse all 18582

Trending Articles