<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: GLSL driver bug: mat4x3 * vec4 = vec4?! in Graphics</title>
    <link>https://community.intel.com/t5/Graphics/GLSL-driver-bug-mat4x3-vec4-vec4/m-p/351669#M22754</link>
    <description>&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for sharing this information with us.   I will forward it to the appropriate support group so they can take it in consideration.&lt;/P&gt;</description>
    <pubDate>Wed, 03 Apr 2013 18:30:08 GMT</pubDate>
    <dc:creator>Fred_D_Intel</dc:creator>
    <dc:date>2013-04-03T18:30:08Z</dc:date>
    <item>
      <title>GLSL driver bug: mat4x3 * vec4 = vec4?!</title>
      <link>https://community.intel.com/t5/Graphics/GLSL-driver-bug-mat4x3-vec4-vec4/m-p/351668#M22753</link>
      <description>&lt;P&gt;Hello. I'm developing a game using OpenGL, but my GLSL skinning vertex shader isn't compiling. I'm doing a mat4x3 * vec4 multiplication, but the GLSL compiler is insisting that this yields a vec4, while it actually should return a vec3. This was tested on an Intel® HD Graphics 3000 Sandy Bridge CPU-integrated GPU. The following vertex shader does not compile properly:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# version 120&lt;/P&gt;&lt;P&gt;uniform mat4x3 matrix;&lt;/P&gt;&lt;P&gt;void main(){&lt;/P&gt;&lt;P&gt;    gl_Position = vec4(matrix * gl_Vertex, 1.0);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It generates this error:&lt;/P&gt;&lt;P&gt;ERROR: 0:4: 'constructor' : too many arguments&lt;/P&gt;&lt;P&gt;meaning that the multiplication results is a vec4. Forcing the result to a vec3 by writing&lt;/P&gt;&lt;P&gt;gl_Position = vec4(vec3(matrix * gl_Vertex).xyz, 1.0);&lt;/P&gt;&lt;P&gt;compiles but does not produce the correct results.&lt;/P&gt;&lt;P&gt;Edit: Forcing the result to a vec3 DOES produce the correct result. This proved to be a very non-intrusive workaround.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that the exact same shader compiles and works fine on an Intel® HD Graphics 2500 (Ivy Bridge) GPU.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please fix this ASAP! This bug is keeping my engine from working on Sandy Bridge integrated GPUs! If it's possible to work around the issue, that'd help a lot too!&lt;/P&gt;</description>
      <pubDate>Sun, 31 Mar 2013 00:35:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Graphics/GLSL-driver-bug-mat4x3-vec4-vec4/m-p/351668#M22753</guid>
      <dc:creator>idata</dc:creator>
      <dc:date>2013-03-31T00:35:33Z</dc:date>
    </item>
    <item>
      <title>Re: GLSL driver bug: mat4x3 * vec4 = vec4?!</title>
      <link>https://community.intel.com/t5/Graphics/GLSL-driver-bug-mat4x3-vec4-vec4/m-p/351669#M22754</link>
      <description>&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for sharing this information with us.   I will forward it to the appropriate support group so they can take it in consideration.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2013 18:30:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Graphics/GLSL-driver-bug-mat4x3-vec4-vec4/m-p/351669#M22754</guid>
      <dc:creator>Fred_D_Intel</dc:creator>
      <dc:date>2013-04-03T18:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: GLSL driver bug: mat4x3 * vec4 = vec4?!</title>
      <link>https://community.intel.com/t5/Graphics/GLSL-driver-bug-mat4x3-vec4-vec4/m-p/351670#M22755</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2013 18:33:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Graphics/GLSL-driver-bug-mat4x3-vec4-vec4/m-p/351670#M22755</guid>
      <dc:creator>idata</dc:creator>
      <dc:date>2013-04-03T18:33:55Z</dc:date>
    </item>
    <item>
      <title>Re: GLSL driver bug: mat4x3 * vec4 = vec4?!</title>
      <link>https://community.intel.com/t5/Graphics/GLSL-driver-bug-mat4x3-vec4-vec4/m-p/351671#M22756</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a similar problem with Intel HD Graphics 3000, driver version: 9.17.10.3347&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mat3x4 M;&lt;/P&gt;&lt;P&gt;vec3 x;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then the multiplication : M*x is valid and the result should be of type vec4, however if I write: vec4 y = M*x then I have the message: &lt;/P&gt;&lt;P&gt;" '=' :  cannot convert from '3-component vector of float' to '4-component vector of float'". &lt;/P&gt;&lt;P&gt;It means "mat3x4 * vec3" is considered having the vec3 type : mat3x4*vec3 = vec3 ?!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not have this error with Nvidia cards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks to fix this issue.&lt;/P&gt;</description>
      <pubDate>Sun, 29 Jun 2014 12:58:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Graphics/GLSL-driver-bug-mat4x3-vec4-vec4/m-p/351671#M22756</guid>
      <dc:creator>HVu6</dc:creator>
      <dc:date>2014-06-29T12:58:19Z</dc:date>
    </item>
    <item>
      <title>Re: GLSL driver bug: mat4x3 * vec4 = vec4?!</title>
      <link>https://community.intel.com/t5/Graphics/GLSL-driver-bug-mat4x3-vec4-vec4/m-p/351672#M22757</link>
      <description>&lt;P&gt;I am sorry you are having this problem. &lt;/P&gt;&lt;P&gt;Have you tried with the latest driver version?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here you can get it:&lt;/P&gt;&lt;P&gt;&lt;A href="https://downloadcenter.intel.com/Detail_Desc.aspx?agr=Y&amp;amp;ProdId=3319&amp;amp;DwnldID=23764"&gt;https://downloadcenter.intel.com/Detail_Desc.aspx?agr=Y&amp;amp;ProdId=3319&amp;amp;DwnldID=23764&lt;/A&gt; &lt;A href="https://downloadcenter.intel.com/Detail_Desc.aspx?agr=Y&amp;amp;ProdId=3319&amp;amp;DwnldID=23764"&gt;https://downloadcenter.intel.com/Detail_Desc.aspx?agr=Y&amp;amp;ProdId=3319&amp;amp;DwnldID=23764&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Mon, 30 Jun 2014 14:54:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Graphics/GLSL-driver-bug-mat4x3-vec4-vec4/m-p/351672#M22757</guid>
      <dc:creator>Kevin_M_Intel</dc:creator>
      <dc:date>2014-06-30T14:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: GLSL driver bug: mat4x3 * vec4 = vec4?!</title>
      <link>https://community.intel.com/t5/Graphics/GLSL-driver-bug-mat4x3-vec4-vec4/m-p/351673#M22758</link>
      <description>&lt;P&gt;In GLSL, the type &lt;CODE&gt;mat4x3&lt;/CODE&gt; represents a matrix that is 4 columns wide (row-lengths of 4) and 3 rows tall (column-lengths of 3) &lt;A href="http://www.opengl.org/wiki/Data_Type_(GLSL)#"&gt;http://www.opengl.org/wiki/Data_Type_(GLSL)#&lt;/A&gt; Matrices [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 &lt;A href="https://en.wikibooks.org/wiki/GLSL_Programming/Vector_and_Matrix_Operations#"&gt;https://en.wikibooks.org/wiki/GLSL_Programming/Vector_and_Matrix_Operations#&lt;/A&gt; Operators [source].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you're seeing — that a matrix with column-lengths of 3 requires the vector to be a &lt;CODE&gt;vec3&lt;/CODE&gt; — is the correct behavior for GLSL on every platform.  It's much more common to use matrices of size &lt;CODE&gt;mat4x4&lt;/CODE&gt; (AKA &lt;CODE&gt;mat4&lt;/CODE&gt;) when transforming the &lt;CODE&gt;gl_Vertex&lt;/CODE&gt; to a &lt;CODE&gt;gl_Position&lt;/CODE&gt;.  Correct solutions to your problem would be to:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Strip off the &lt;CODE&gt;.w&lt;/CODE&gt; component off of &lt;CODE&gt;gl_Vertex&lt;/CODE&gt; as you've done, or&lt;/LI&gt;&lt;LI&gt;To initialize a 4th row of the matrix (as a &lt;CODE&gt;mat4&lt;/CODE&gt;) to &lt;CODE&gt;0,0,0,1&lt;/CODE&gt; (from bottom-left to bottom-right).&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Much more information about how GL/GLSL perform standard matrix transformation can be found in this useful post: &lt;A href="http://www.songho.ca/opengl/gl_transform.html#"&gt;http://www.songho.ca/opengl/gl_transform.html#&lt;/A&gt; modelview &lt;A href="http://www.songho.ca/opengl/gl_transform.html#"&gt;http://www.songho.ca/opengl/gl_transform.html#&lt;/A&gt; modelview&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;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 shitty support reps.&lt;/I&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Sep 2014 22:54:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Graphics/GLSL-driver-bug-mat4x3-vec4-vec4/m-p/351673#M22758</guid>
      <dc:creator>SThom18</dc:creator>
      <dc:date>2014-09-17T22:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: GLSL driver bug: mat4x3 * vec4 = vec4?!</title>
      <link>https://community.intel.com/t5/Graphics/GLSL-driver-bug-mat4x3-vec4-vec4/m-p/351674#M22759</link>
      <description>&lt;P&gt;CapnSlipp, &lt;/P&gt;&lt;P&gt;Thank you for the information. This will be helpful for other users.&lt;/P&gt;&lt;P&gt;Kevin M&lt;/P&gt;</description>
      <pubDate>Thu, 18 Sep 2014 16:26:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Graphics/GLSL-driver-bug-mat4x3-vec4-vec4/m-p/351674#M22759</guid>
      <dc:creator>Kevin_M_Intel</dc:creator>
      <dc:date>2014-09-18T16:26:50Z</dc:date>
    </item>
  </channel>
</rss>

