<?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 OpenGL mix() function not working correctly with Minecraft shaders. in Developing Games on Intel Graphics</title>
    <link>https://community.intel.com/t5/Developing-Games-on-Intel/OpenGL-mix-function-not-working-correctly-with-Minecraft-shaders/m-p/1665023#M2577</link>
    <description>&lt;P&gt;&lt;SPAN class=""&gt;This is a continuation from &lt;/SPAN&gt;&lt;A class="" href="https://community.intel.com/t5/Developing-Games-on-Intel/Driver-level-bugs-causing-issues-in-Minecraft-amp-OpenGL-shaders/td-p/1664368" target="_blank" rel="noopener"&gt;&lt;SPAN class=""&gt;https://community.intel.com/t5/Developing-Games-on-Intel/Driver-level-bugs-causing-issues-in-Minecraft-amp-OpenGL-shaders/td-p/1664368&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN class=""&gt; which will be split into 3 separate reports.&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;The issue:&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;The OpenGL mix() function seems to not work correctly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;It produces NaN's in situations where AMD and Nvidia cards don't have such issues.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;In this particular case the line of code affected is line 21 in blocklightColors.glsl (in the attached shaderpacks.zip)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;vec3 torchBlockSpecialLightColor = mix(vec3(2.0, 0.87, 0.27), fireSpecialLightColor, 0.75);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;Rudimentary investegation:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Doing this will fix the issue and make it behave as expected. This fix makes zero sense however as &lt;SPAN&gt;clamp&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;.75&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;.0&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;.0&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt; should do absolutely nothing to the 0.75&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;vec3 torchBlockSpecialLightColor = mix(vec3(2.0, 0.87, 0.27), fireSpecialLightColor, clamp01(0.75));  //this works as expected&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;clamp01 is just a simple function that looks like this (it's in commonFunctions.glsl)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;float clamp01(float x) {
    return clamp(x, 0.0, 1.0);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What makes even less sense is that, not using the function and directly doing clamp(0.75, 0.0, 1.0) results in different broken behaviour (also a NaN but it doesn't spread over the entire screen anymore)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;vec3 torchBlockSpecialLightColor = mix(vec3(2.0, 0.87, 0.27), fireSpecialLightColor, clamp(0.75, 0.0, 1.0));  //this is broken&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This makes precisely zero sense as clamp01 is just clamp(x , 0.0, 1.0) so there should be absolutely no difference between the two.&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;The suspected culprit is malfunctioning constant folding.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Reproduction Steps&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN class=""&gt;Preparation:&lt;/SPAN&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN class=""&gt;- Install Iris &amp;amp; Sodium for 1.21.4 :&amp;nbsp;&lt;/SPAN&gt;&lt;A class="" href="https://github.com/IrisShaders/Iris/blob/multiloader-new/docs/guide.md" target="_blank" rel="noopener nofollow noreferrer"&gt;&lt;SPAN class=""&gt;https://github.com/IrisShaders/Iris/blob/multiloader-new/docs/guide.md&lt;/SPAN&gt;&lt;/A&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;- Unpack the shaderpacks.zip inside the (...)\AppData\Roaming\.minecraft folder&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;- Unpack the Driver Bug Test.zip inside the \AppData\Roaming\.minecraft\saves folder&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;- Go into options&amp;gt;video settings&amp;gt;shaderpacks and select "complementary unbound 5.4 + euphoria patches 1.5.2"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;- Press apply&lt;/SPAN&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;STRONG&gt;Reproduction:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;- Open the Driver Bug Test world in-game&lt;BR /&gt;- Step on the pressure plate that says "NaN apocalypse"&lt;BR /&gt;- Press the button to place a torch&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 11 Feb 2025 16:56:37 GMT</pubDate>
    <dc:creator>djmrFunnyMan</dc:creator>
    <dc:date>2025-02-11T16:56:37Z</dc:date>
    <item>
      <title>OpenGL mix() function not working correctly with Minecraft shaders.</title>
      <link>https://community.intel.com/t5/Developing-Games-on-Intel/OpenGL-mix-function-not-working-correctly-with-Minecraft-shaders/m-p/1665023#M2577</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;This is a continuation from &lt;/SPAN&gt;&lt;A class="" href="https://community.intel.com/t5/Developing-Games-on-Intel/Driver-level-bugs-causing-issues-in-Minecraft-amp-OpenGL-shaders/td-p/1664368" target="_blank" rel="noopener"&gt;&lt;SPAN class=""&gt;https://community.intel.com/t5/Developing-Games-on-Intel/Driver-level-bugs-causing-issues-in-Minecraft-amp-OpenGL-shaders/td-p/1664368&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN class=""&gt; which will be split into 3 separate reports.&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;The issue:&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;The OpenGL mix() function seems to not work correctly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;It produces NaN's in situations where AMD and Nvidia cards don't have such issues.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;In this particular case the line of code affected is line 21 in blocklightColors.glsl (in the attached shaderpacks.zip)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;vec3 torchBlockSpecialLightColor = mix(vec3(2.0, 0.87, 0.27), fireSpecialLightColor, 0.75);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;Rudimentary investegation:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Doing this will fix the issue and make it behave as expected. This fix makes zero sense however as &lt;SPAN&gt;clamp&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;.75&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;.0&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;.0&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt; should do absolutely nothing to the 0.75&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;vec3 torchBlockSpecialLightColor = mix(vec3(2.0, 0.87, 0.27), fireSpecialLightColor, clamp01(0.75));  //this works as expected&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;clamp01 is just a simple function that looks like this (it's in commonFunctions.glsl)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;float clamp01(float x) {
    return clamp(x, 0.0, 1.0);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What makes even less sense is that, not using the function and directly doing clamp(0.75, 0.0, 1.0) results in different broken behaviour (also a NaN but it doesn't spread over the entire screen anymore)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;vec3 torchBlockSpecialLightColor = mix(vec3(2.0, 0.87, 0.27), fireSpecialLightColor, clamp(0.75, 0.0, 1.0));  //this is broken&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This makes precisely zero sense as clamp01 is just clamp(x , 0.0, 1.0) so there should be absolutely no difference between the two.&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;The suspected culprit is malfunctioning constant folding.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Reproduction Steps&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN class=""&gt;Preparation:&lt;/SPAN&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN class=""&gt;- Install Iris &amp;amp; Sodium for 1.21.4 :&amp;nbsp;&lt;/SPAN&gt;&lt;A class="" href="https://github.com/IrisShaders/Iris/blob/multiloader-new/docs/guide.md" target="_blank" rel="noopener nofollow noreferrer"&gt;&lt;SPAN class=""&gt;https://github.com/IrisShaders/Iris/blob/multiloader-new/docs/guide.md&lt;/SPAN&gt;&lt;/A&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;- Unpack the shaderpacks.zip inside the (...)\AppData\Roaming\.minecraft folder&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;- Unpack the Driver Bug Test.zip inside the \AppData\Roaming\.minecraft\saves folder&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;- Go into options&amp;gt;video settings&amp;gt;shaderpacks and select "complementary unbound 5.4 + euphoria patches 1.5.2"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;- Press apply&lt;/SPAN&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;STRONG&gt;Reproduction:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;- Open the Driver Bug Test world in-game&lt;BR /&gt;- Step on the pressure plate that says "NaN apocalypse"&lt;BR /&gt;- Press the button to place a torch&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2025 16:56:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Developing-Games-on-Intel/OpenGL-mix-function-not-working-correctly-with-Minecraft-shaders/m-p/1665023#M2577</guid>
      <dc:creator>djmrFunnyMan</dc:creator>
      <dc:date>2025-02-11T16:56:37Z</dc:date>
    </item>
    <item>
      <title>Re: OpenGL mix() function not working correctly with Minecraft shaders.</title>
      <link>https://community.intel.com/t5/Developing-Games-on-Intel/OpenGL-mix-function-not-working-correctly-with-Minecraft-shaders/m-p/1665097#M2585</link>
      <description>&lt;P&gt;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/410902"&gt;@djmrFunnyMan&lt;/a&gt;&amp;nbsp;thanks for splitting the cases.&lt;BR /&gt;I'll check this one too&lt;BR /&gt;&lt;BR /&gt;Stay tuned&lt;BR /&gt;&lt;BR /&gt;Karen&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2025 22:24:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Developing-Games-on-Intel/OpenGL-mix-function-not-working-correctly-with-Minecraft-shaders/m-p/1665097#M2585</guid>
      <dc:creator>karen_intel</dc:creator>
      <dc:date>2025-02-11T22:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: OpenGL mix() function not working correctly with Minecraft shaders.</title>
      <link>https://community.intel.com/t5/Developing-Games-on-Intel/OpenGL-mix-function-not-working-correctly-with-Minecraft-shaders/m-p/1753501#M3004</link>
      <description>&lt;P&gt;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/410902"&gt;@djmrFunnyMan&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The official update status for this case can be found here:&amp;nbsp;&lt;BR /&gt;&lt;A href="https://www.intel.com/content/www/us/en/support/articles/000102994.html" target="_blank"&gt;https://www.intel.com/content/www/us/en/support/articles/000102994.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The team is working actively on this case &lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;
&lt;P&gt;Will keep this case open for any new questions arise,&lt;/P&gt;
&lt;P&gt;--Arturo&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2026 17:19:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Developing-Games-on-Intel/OpenGL-mix-function-not-working-correctly-with-Minecraft-shaders/m-p/1753501#M3004</guid>
      <dc:creator>Arturo_Intel</dc:creator>
      <dc:date>2026-07-09T17:19:15Z</dc:date>
    </item>
    <item>
      <title>Re: OpenGL mix() function not working correctly with Minecraft shaders.</title>
      <link>https://community.intel.com/t5/Developing-Games-on-Intel/OpenGL-mix-function-not-working-correctly-with-Minecraft-shaders/m-p/1753526#M3005</link>
      <description>&lt;P&gt;There is a big misunderstanding in the support article.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The direct call is what miscompiles. Using the helper function is a workaround to produce correct results.&lt;BR /&gt;&lt;BR /&gt;Basically you mislabeled the malfunctioning and functioning examples (should be the opposite of how it is now).&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2026 22:14:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Developing-Games-on-Intel/OpenGL-mix-function-not-working-correctly-with-Minecraft-shaders/m-p/1753526#M3005</guid>
      <dc:creator>djmrFunnyMan</dc:creator>
      <dc:date>2026-07-09T22:14:41Z</dc:date>
    </item>
    <item>
      <title>Re: OpenGL mix() function not working correctly with Minecraft shaders.</title>
      <link>https://community.intel.com/t5/Developing-Games-on-Intel/OpenGL-mix-function-not-working-correctly-with-Minecraft-shaders/m-p/1753527#M3006</link>
      <description>&lt;P&gt;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/237045"&gt;@Arturo_Intel&lt;/a&gt;&amp;nbsp;Please check my reply above (I forgot to ping you)&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2026 22:18:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Developing-Games-on-Intel/OpenGL-mix-function-not-working-correctly-with-Minecraft-shaders/m-p/1753527#M3006</guid>
      <dc:creator>djmrFunnyMan</dc:creator>
      <dc:date>2026-07-09T22:18:34Z</dc:date>
    </item>
    <item>
      <title>Re: OpenGL mix() function not working correctly with Minecraft shaders.</title>
      <link>https://community.intel.com/t5/Developing-Games-on-Intel/OpenGL-mix-function-not-working-correctly-with-Minecraft-shaders/m-p/1753528#M3007</link>
      <description>&lt;P&gt;Ow! Thanks for heads up!&lt;/P&gt;
&lt;P&gt;I will change this ASAP.&lt;/P&gt;
&lt;P&gt;-r2&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2026 22:37:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Developing-Games-on-Intel/OpenGL-mix-function-not-working-correctly-with-Minecraft-shaders/m-p/1753528#M3007</guid>
      <dc:creator>Arturo_Intel</dc:creator>
      <dc:date>2026-07-09T22:37:28Z</dc:date>
    </item>
    <item>
      <title>Re: OpenGL mix() function not working correctly with Minecraft shaders.</title>
      <link>https://community.intel.com/t5/Developing-Games-on-Intel/OpenGL-mix-function-not-working-correctly-with-Minecraft-shaders/m-p/1753695#M3014</link>
      <description>&lt;P&gt;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/237045"&gt;@Arturo_Intel&lt;/a&gt;&amp;nbsp;I have found another workaround.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;vec3 torchBlockSpecialLightColor = mix(vec3(2.0, 0.87, 0.27), fireSpecialLightColor, 0.75); //this outputs a NaN&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;uniform float value = 0.75;
vec3 torchBlockSpecialLightColor = mix(vec3(2.0, 0.87, 0.27), fireSpecialLightColor, value); //this outputs the correct result&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;This tells me that the driver can be tricked into behaving correctly by changing how the float is provided, and using helper functions is not the only way of doing so.&lt;/P&gt;</description>
      <pubDate>Sat, 11 Jul 2026 18:53:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Developing-Games-on-Intel/OpenGL-mix-function-not-working-correctly-with-Minecraft-shaders/m-p/1753695#M3014</guid>
      <dc:creator>djmrFunnyMan</dc:creator>
      <dc:date>2026-07-11T18:53:14Z</dc:date>
    </item>
  </channel>
</rss>

