<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: snake lil</title>
    <description>The latest articles on DEV Community by snake lil (@lilsnake).</description>
    <link>https://dev.to/lilsnake</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4193159%2F15dde75d-d061-4986-984f-9387bbe3202a.jpg</url>
      <title>DEV Community: snake lil</title>
      <link>https://dev.to/lilsnake</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lilsnake"/>
    <language>en</language>
    <item>
      <title>UV Bounds Do Not Prove Independent Texture Regions</title>
      <dc:creator>snake lil</dc:creator>
      <pubDate>Mon, 02 Nov 2026 03:43:10 +0000</pubDate>
      <link>https://dev.to/lilsnake/uv-bounds-do-not-prove-independent-texture-regions-287a</link>
      <guid>https://dev.to/lilsnake/uv-bounds-do-not-prove-independent-texture-regions-287a</guid>
      <description>&lt;p&gt;&lt;strong&gt;AI assistance disclosure:&lt;/strong&gt; AI assisted with research, drafting, and execution of the Python example below. The results come from constructed UV fixtures, not an imported vehicle asset or a browser-rendering experiment.&lt;/p&gt;

&lt;p&gt;A UV range check answers a useful but narrow question: are these coordinates inside the intended texture tile?&lt;/p&gt;

&lt;p&gt;It does not answer whether two mesh faces can be textured independently. Even adding “no zero-area triangles” and “total UV triangle area equals one” leaves a simple failure case.&lt;/p&gt;

&lt;p&gt;Here is a reproducible counterexample. Two layouts both contain two nondegenerate UV triangles, span exactly &lt;code&gt;[0, 1] × [0, 1]&lt;/code&gt;, and have a summed triangle area of &lt;code&gt;1&lt;/code&gt;. One covers the square without interior overlap. The other maps both faces onto the same half of it.&lt;/p&gt;

&lt;p&gt;That distinction matters when a mesh will receive separate labels, decals, or artwork. A clean range report is useful evidence. It is not a certificate of region isolation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two layouts that pass the same simple checks
&lt;/h2&gt;

&lt;p&gt;Define these triangles in normalized UV space:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;lower = (0,0), (1,0), (0,1)
upper = (1,1), (0,1), (1,0)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The partitioned layout uses &lt;code&gt;lower&lt;/code&gt; once and &lt;code&gt;upper&lt;/code&gt; once. The stacked layout uses &lt;code&gt;lower&lt;/code&gt; twice, assigning the same UV triangle to two faces. The example concerns UV assignments; it does not create a mesh file or specify physical dimensions.&lt;/p&gt;

&lt;p&gt;The signed double area of a triangle is the two-dimensional cross product:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(bx - ax) * (cy - ay) - (by - ay) * (cx - ax)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Take its absolute value and divide by two for ordinary area. Each triangle here has area &lt;code&gt;1/2&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;A third fixture reverses the vertex order of the second stacked triangle. This checks that the duplicate diagnostic below does not depend on winding order.&lt;/p&gt;

&lt;p&gt;The following results were obtained by executing the Python example on November 2, 2026:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Check&lt;/th&gt;
&lt;th&gt;Partitioned&lt;/th&gt;
&lt;th&gt;Stacked&lt;/th&gt;
&lt;th&gt;Stacked, second order reversed&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Triangle count&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bounds &lt;code&gt;(min U, min V, max U, max V)&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;&lt;code&gt;(0,0,1,1)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;(0,0,1,1)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;(0,0,1,1)&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Every coordinate inside the unit square&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Degenerate triangle count&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sum of triangle areas&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Exact duplicate UV triangle pairs&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The first five rows cannot distinguish these layouts. The last row can distinguish these particular fixtures.&lt;/p&gt;

&lt;h2&gt;
  
  
  Area sum counts repeated coverage
&lt;/h2&gt;

&lt;p&gt;For the partitioned layout, the two triangle interiors are disjoint and their union is the square. They share a diagonal, which has zero area.&lt;/p&gt;

&lt;p&gt;For either stacked layout, both triangles occupy exactly the same lower half-square. Adding their areas counts that region twice. The upper half remains unused.&lt;/p&gt;

&lt;p&gt;These are exact geometric consequences of the listed coordinates:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layout&lt;/th&gt;
&lt;th&gt;Union area&lt;/th&gt;
&lt;th&gt;Area covered by both triangles&lt;/th&gt;
&lt;th&gt;Uncovered area in the unit square&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Partitioned&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Either stacked fixture&lt;/td&gt;
&lt;td&gt;1/2&lt;/td&gt;
&lt;td&gt;1/2&lt;/td&gt;
&lt;td&gt;1/2&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This second table is derived directly from the complementary or identical half-squares. The code below does not implement a general polygon-union or intersection algorithm.&lt;/p&gt;

&lt;p&gt;The useful observation is that &lt;code&gt;sum(triangle areas) == 1&lt;/code&gt; is compatible with both complete coverage and substantial overlap. An area sum is not a union-area calculation. Checking that sum more precisely would not resolve the ambiguity.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reproduce the checks with the Python standard library
&lt;/h2&gt;

&lt;p&gt;Save and run the following with Python 3. It uses integer-coordinate fixtures and exact rational arithmetic for their areas. No renderer, model download, or third-party package is required.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;collections&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Counter&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;fractions&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Fraction&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;twice_area&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ax&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ay&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;by&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;
    &lt;span class="nf"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bx&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;ax&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cy&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;ay&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;by&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;ay&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cx&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;ax&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;audit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;triangles&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;points&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;triangles&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;keys&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Counter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;tuple&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;sorted&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;triangles&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;bounds&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;points&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="nf"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;points&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
                   &lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;points&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;points&lt;/span&gt;&lt;span class="p"&gt;)],&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;in_unit_square&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;points&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sum_area&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nf"&gt;abs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Fraction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;twice_area&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;triangles&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="nc"&gt;Fraction&lt;/span&gt;&lt;span class="p"&gt;()),&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;degenerate_count&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;twice_area&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;triangles&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;duplicate_pairs&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;values&lt;/span&gt;&lt;span class="p"&gt;()),&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;lower&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="n"&gt;upper&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="n"&gt;fixtures&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;partitioned&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;upper&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;stacked&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;stacked_reversed&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;tuple&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;reversed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;))]}&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;triangles&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;fixtures&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;items&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;audit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;triangles&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;assert&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;bounds&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;assert&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;in_unit_square&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sum_area&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="k"&gt;assert&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;degenerate_count&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="k"&gt;assert&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;duplicate_pairs&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;partitioned&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The assertions check the reported bounds, range, total area, degeneracy, and duplicate-pair counts. The printed &lt;code&gt;sum_area&lt;/code&gt; is &lt;code&gt;Fraction(1, 1)&lt;/code&gt; in every row. The duplicate count is &lt;code&gt;0&lt;/code&gt;, &lt;code&gt;1&lt;/code&gt;, and &lt;code&gt;1&lt;/code&gt; respectively.&lt;/p&gt;

&lt;p&gt;Sorting each triangle's three coordinate pairs creates an order-independent key. This is deliberately a small diagnostic, not an overlap detector for arbitrary assets. It misses partial intersections, near-equal floating-point coordinates, and two different triangulations of the same covered region. It also does not interpret a glTF index buffer, a material, a texture transform, or a UV channel.&lt;/p&gt;

&lt;p&gt;Do not round imported UVs until they match these keys and treat the result as a rigorous intersection test. A real asset audit needs an explicit numerical tolerance policy and a suitable geometry method.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this is an editing requirement, not a glTF validity rule
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html" rel="noopener noreferrer"&gt;glTF 2.0 specification&lt;/a&gt; defines texture coordinates as &lt;code&gt;TEXCOORD_n&lt;/code&gt; attributes. Its &lt;a href="https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html" rel="noopener noreferrer"&gt;wrapping section&lt;/a&gt; describes how samplers handle coordinates outside the normalized image interval.&lt;/p&gt;

&lt;p&gt;A unit-square rule can be an application requirement for a particular atlas. It should not be presented as a universal glTF requirement. Similarly, sharing texture space may be intentional when multiple faces should use the same artwork.&lt;/p&gt;

&lt;p&gt;The problem appears when the requested operation requires different artwork on those faces. If they use the same texture binding and the same UV region, editing that shared texture region cannot independently target only one of them through UV coordinates alone. That conclusion follows from the mapping; this example does not measure the behavior of a particular editing application.&lt;/p&gt;

&lt;p&gt;Blender's &lt;a href="https://docs.blender.org/manual/en/4.5/editors/uv/selecting.html" rel="noopener noreferrer"&gt;UV selection documentation&lt;/a&gt; lists a Select Overlap operation. That is a relevant inspection aid, but the documentation reference is not a claim that this example was opened or tested in Blender.&lt;/p&gt;

&lt;h2&gt;
  
  
  A report that is more useful than one green checkbox
&lt;/h2&gt;

&lt;p&gt;For an asset intended for local artwork placement, record several separate findings:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Which coordinates are actually used.&lt;/strong&gt; Record the target material, texture, and UV set. In Three.js, &lt;a href="https://threejs.org/docs/pages/Texture.html" rel="noopener noreferrer"&gt;Texture&lt;/a&gt; exposes the coordinate channel and UV transformation matrix. Inspect the binding used by the operation rather than assuming the first UV set is the relevant one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Whether the intended regions share texture space.&lt;/strong&gt; Check interior overlap between faces that must be independent. Shared boundaries and positive-area overlap are different cases. Record intentional sharing explicitly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Which faces belong to each editable region.&lt;/strong&gt; Non-overlapping UVs still do not identify a door, a hood, or a rear panel. That requires a separate semantic assignment and inspection of the corresponding geometry.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What the actual editing path does.&lt;/strong&gt; Exercise a distinctive, asymmetric label or image on the intended region and inspect other regions and multiple views. Test intermediate and completed states if they follow different rendering paths.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Those are proposed acceptance steps, not results produced by this numerical example. Filtering near island borders, padding, texture resolution, orientation, distortion, and physical scale also remain separate concerns. Passing the checks here establishes none of them.&lt;/p&gt;

&lt;p&gt;The next time an asset report says “UVs are valid,” ask what was checked. “All coordinates are in the intended tile” is a clear and useful result. “The intended faces can receive independent artwork” is a different claim, requiring different evidence.&lt;/p&gt;

</description>
      <category>graphics</category>
      <category>gltf</category>
      <category>python</category>
      <category>debugging</category>
    </item>
    <item>
      <title>A Screenshot MAE Is Not a Material Accuracy Score</title>
      <dc:creator>snake lil</dc:creator>
      <pubDate>Sun, 01 Nov 2026 02:29:15 +0000</pubDate>
      <link>https://dev.to/lilsnake/a-screenshot-mae-is-not-a-material-accuracy-score-4420</link>
      <guid>https://dev.to/lilsnake/a-screenshot-mae-is-not-a-material-accuracy-score-4420</guid>
      <description>&lt;p&gt;&lt;strong&gt;AI assistance disclosure:&lt;/strong&gt; AI assisted with research, drafting and the numerical analysis reported here. The source images are direct WebGL renders, not AI-generated images.&lt;/p&gt;

&lt;p&gt;A screenshot difference can confirm that a rendering changed. Calling the same number a material-accuracy score requires evidence that the comparison does not provide.&lt;/p&gt;

&lt;p&gt;Here is a small example: the same pair of retained PNGs gives an RGB mean absolute difference of &lt;strong&gt;6.407536&lt;/strong&gt; over the full image and &lt;strong&gt;18.313377&lt;/strong&gt; over a shared non-background mask. No material, lighting or pixel value changed between those calculations. Only the averaging domain changed.&lt;/p&gt;

&lt;p&gt;This is new analysis of an existing capture set, performed on October 31, 2026. It is not another rendering experiment, a physical-film comparison or a new benchmark of Three.js.&lt;/p&gt;

&lt;h2&gt;
  
  
  The inputs and the question
&lt;/h2&gt;

&lt;p&gt;The source frames are the procedural-sphere renders from the October 30 update to &lt;a href="https://dev.to/lilsnake/high-roughness-sharp-highlights-auditing-a-gltf-material-in-threejs-4i1i"&gt;this material audit&lt;/a&gt;. All three PNGs are 640 × 480. Their camera, geometry, lights, environment, exposure and base color were fixed. Base roughness was &lt;code&gt;0.86&lt;/code&gt; and metalness &lt;code&gt;0.02&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Download the source PNG copies as &lt;a href="https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/dkr69mcdqaqtssq7b6y1.png" rel="noopener noreferrer"&gt;A.png&lt;/a&gt;, &lt;a href="https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/4bhgqskq7ma8ppkpcqmd.png" rel="noopener noreferrer"&gt;B.png&lt;/a&gt; and &lt;a href="https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/f1qdd9gfycba6y9wzbi9.png" rel="noopener noreferrer"&gt;C.png&lt;/a&gt;. On November 1, each download was checked against the retained source: the PNG file bytes differ, but all decoded RGB pixel bytes are identical. That observation does not establish what changed the file encoding. It does make decoded-pixel hashes the useful input check for this calculation.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Frame&lt;/th&gt;
&lt;th&gt;Clearcoat&lt;/th&gt;
&lt;th&gt;Clearcoat roughness&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;0.04&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;B&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0.04&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;0.86&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A/B changes coating intensity. A/C changes coating roughness. B/C changes both, so it is included as a descriptive image comparison rather than a single-variable intervention.&lt;/p&gt;

&lt;p&gt;The original capture sequence returned to A twice, with identical PNG bytes. That helps establish repeatability within that session. It does not supply a physically correct target image: none of A, B or C is a measured real material used as ground truth.&lt;/p&gt;

&lt;p&gt;For this analysis, the question is narrower: how much does the definition of the screenshot statistic affect the number we report?&lt;/p&gt;

&lt;h2&gt;
  
  
  Background pixels participate in the average
&lt;/h2&gt;

&lt;p&gt;For an image domain containing N pixels, the metric used here is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;RGB8 MAE = sum over pixels and RGB channels of |left - right| / (3 × N)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Its units are encoded 8-bit channel values, on a 0–255 scale. Every included pixel contributes to the denominator, even when its difference is zero.&lt;/p&gt;

&lt;p&gt;The three images have the same flat background. Every outer-border pixel in every source PNG is exactly &lt;code&gt;(28, 35, 27)&lt;/code&gt;. A single common mask was constructed by including a pixel if it differed from that background color in &lt;strong&gt;any&lt;/strong&gt; of A, B or C. The same mask was then used for all comparisons.&lt;/p&gt;

&lt;p&gt;This mask includes &lt;strong&gt;107,484 of 307,200 pixels&lt;/strong&gt;, or &lt;strong&gt;34.98828125%&lt;/strong&gt; of the frame. All pairwise differences lie inside it; the sum of differences outside it is zero.&lt;/p&gt;

&lt;p&gt;This is a convenient mask for these synthetic images, not a general foreground-segmentation technique. An object region matching the background could be omitted. Real scenes with gradients, shadows or textured backgrounds need a different, explicitly defined region of interest.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Pair&lt;/th&gt;
&lt;th&gt;Full-frame RGB8 MAE&lt;/th&gt;
&lt;th&gt;Common-mask RGB8 MAE&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A / B&lt;/td&gt;
&lt;td&gt;6.407536&lt;/td&gt;
&lt;td&gt;18.313377&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A / C&lt;/td&gt;
&lt;td&gt;5.679630&lt;/td&gt;
&lt;td&gt;16.232949&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;B / C&lt;/td&gt;
&lt;td&gt;4.714180&lt;/td&gt;
&lt;td&gt;13.473596&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Both columns describe the same original pixels. They answer different questions: average difference over the complete output, or average difference over this particular shared mask. The larger masked value does not indicate a worse renderer, and the smaller full-frame value does not indicate a more faithful material.&lt;/p&gt;

&lt;p&gt;There is an even simpler consequence. If identical background were added around both images until the total area was four times larger, the difference sum would stay constant and full-frame MAE would be divided by four. A/B would become &lt;strong&gt;1.601884&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That last value is an algebraic padding calculation. No padded images were created, resized or rendered. It illustrates why scores from differently framed screenshots should not be compared without specifying their averaging domains.&lt;/p&gt;

&lt;h2&gt;
  
  
  Encoded RGB and decoded display output are different statistics
&lt;/h2&gt;

&lt;p&gt;The render setup used ACES Filmic tone mapping and sRGB output. Three.js distinguishes its linear working space from the nonlinear display encoding; those roles are described in its &lt;a href="https://threejs.org/manual/pages/color-management.html" rel="noopener noreferrer"&gt;Color Management manual&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The analysis also decoded each 8-bit channel with the inverse sRGB transfer function before taking absolute differences. For normalized values &lt;code&gt;s&lt;/code&gt; in &lt;code&gt;[0, 1]&lt;/code&gt;, that conversion is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;decode_srgb&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mf"&gt;12.92&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mf"&gt;0.04045&lt;/span&gt; &lt;span class="nf"&gt;else &lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;0.055&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mf"&gt;1.055&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt; &lt;span class="mf"&gt;2.4&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The formula is consistent with the conversion example in &lt;a href="https://www.w3.org/TR/css-color-4/#color-conversion-code" rel="noopener noreferrer"&gt;CSS Color 4&lt;/a&gt;, a work-in-progress specification. Only nonnegative, in-range inputs are needed for these RGB8 files.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Pair&lt;/th&gt;
&lt;th&gt;Full-frame MAE after inverse-sRGB decoding, scale 0–1&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A / B&lt;/td&gt;
&lt;td&gt;0.020100281&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A / C&lt;/td&gt;
&lt;td&gt;0.019102066&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;B / C&lt;/td&gt;
&lt;td&gt;0.012787025&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These values are not directly comparable in magnitude to the RGB8 column because their scales and encodings differ. The ordering happens to remain the same in this dataset; no general ordering guarantee follows.&lt;/p&gt;

&lt;p&gt;Crucially, inverse-sRGB decoding does &lt;strong&gt;not&lt;/strong&gt; undo the earlier tone mapping, recover the scene's HDR radiance, or undo quantization. These are differences in decoded display output. Neither this calculation nor the encoded-RGB version is ΔE, a measured gloss value or a perceptual fidelity assessment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reproduce the domain comparison
&lt;/h2&gt;

&lt;p&gt;Use the original PNGs as &lt;code&gt;A.png&lt;/code&gt;, &lt;code&gt;B.png&lt;/code&gt; and &lt;code&gt;C.png&lt;/code&gt;, with Python and Pillow. Avoid JPEG conversions, resized copies or screenshots of the article page. This compact calculation reproduces the first table and the decoded-output table:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;hashlib&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;sha256&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;itertools&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;combinations&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;PIL&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Image&lt;/span&gt;

&lt;span class="n"&gt;frames&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;.png&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;convert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;RGB&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ABC&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;assert&lt;/span&gt; &lt;span class="nf"&gt;all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;frame&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;640&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;480&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;frame&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;frames&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;expected&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;05727ba66b1b305b38c0f689a76c69191d147a04b5a12bc7b7ea962d6c3d3a7e&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;8d55da1b08820728d1f0358424216aa9de46823ddfa82d09bc3b990fb55ce313&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ca5556ae171ed681114fe0c229f6eead1cdffaf5b47e428836dfcd4a680df1c4&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;assert&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;sha256&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;frame&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;tobytes&lt;/span&gt;&lt;span class="p"&gt;()).&lt;/span&gt;&lt;span class="nf"&gt;hexdigest&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;frame&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;frames&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;expected&lt;/span&gt;
&lt;span class="n"&gt;pixels&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;frame&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getdata&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;frame&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;frames&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;640&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;480&lt;/span&gt;
&lt;span class="n"&gt;background&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pixels&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;border&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;640&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;480&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;640&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
          &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;639&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;479&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;span class="k"&gt;assert&lt;/span&gt; &lt;span class="nf"&gt;all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;frame&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;background&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;frame&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;pixels&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;border&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;mask&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;any&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;frame&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;background&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;frame&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;pixels&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mask&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;assert&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;255&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mf"&gt;12.92&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mf"&gt;0.04045&lt;/span&gt; &lt;span class="nf"&gt;else &lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;0.055&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mf"&gt;1.055&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt; &lt;span class="mf"&gt;2.4&lt;/span&gt;

&lt;span class="n"&gt;lut&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;256&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;left&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;right&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;combinations&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;total&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;masked&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="n"&gt;linear&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;enumerate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;zip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pixels&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;left&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;pixels&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;right&lt;/span&gt;&lt;span class="p"&gt;])):&lt;/span&gt;
        &lt;span class="n"&gt;delta&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;abs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;zip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
        &lt;span class="n"&gt;total&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;delta&lt;/span&gt;
        &lt;span class="n"&gt;masked&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;delta&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;mask&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
        &lt;span class="n"&gt;linear&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;abs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lut&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;lut&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;zip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="k"&gt;assert&lt;/span&gt; &lt;span class="n"&gt;total&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;masked&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ABC&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;left&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ABC&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;right&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;total&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
          &lt;span class="n"&gt;masked&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;linear&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pillow 12.3.0 was used for the retained-file analysis and the downloaded-copy checks. The hashes in the code are for row-major RGB bytes, after conversion to RGB, not the PNG container bytes. Image dimensions are checked separately.&lt;/p&gt;

&lt;p&gt;The full-frame RGB8 results were checked against the earlier independent PNG analysis. The new analysis also checked that every difference was inside the common mask. No source image was modified, and no product code or rendering setting changed for this follow-up.&lt;/p&gt;

&lt;h2&gt;
  
  
  A useful reporting boundary
&lt;/h2&gt;

&lt;p&gt;For screenshot regression work, record the source files, alignment, output encoding, averaging domain and formula alongside the score. If a region of interest is used, define it before comparing candidates and keep it common across the comparisons.&lt;/p&gt;

&lt;p&gt;With those conditions fixed, a difference statistic can help detect a change or an exact return to a baseline. The separate question—whether the rendered material matches a real one—still needs an appropriate physical reference and a defined validation method. A low screenshot MAE alone cannot provide that reference.&lt;/p&gt;

</description>
      <category>python</category>
      <category>webgl</category>
      <category>threejs</category>
      <category>debugging</category>
    </item>
    <item>
      <title>High Roughness, Sharp Highlights: Auditing a glTF Material in Three.js</title>
      <dc:creator>snake lil</dc:creator>
      <pubDate>Tue, 27 Oct 2026 03:57:00 +0000</pubDate>
      <link>https://dev.to/lilsnake/high-roughness-sharp-highlights-auditing-a-gltf-material-in-threejs-4i1i</link>
      <guid>https://dev.to/lilsnake/high-roughness-sharp-highlights-auditing-a-gltf-material-in-threejs-4i1i</guid>
      <description>&lt;p&gt;An imported car-body model still showed sharp highlights on its hood and rear fender after switching to a preset labeled &lt;strong&gt;Matte&lt;/strong&gt;. The overall reflection became weaker, but some bright patches remained.&lt;/p&gt;

&lt;p&gt;That observation prompted a material audit: what did the preset actually change, and what properties had arrived with the imported asset?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Affiliation:&lt;/strong&gt; This case comes from WrapPrism, a project I work on.&lt;/p&gt;

&lt;p&gt;The browser capture session and file checks described below took place on October 27, 2026.&lt;/p&gt;

&lt;h2&gt;
  
  
  Establishing a comparable capture sequence
&lt;/h2&gt;

&lt;p&gt;The comparison used one BMW M4 G82 ADRO-kit body study in the same Chrome tab and the same initial front three-quarter view. Between captures, there was no rotation, zoom, camera reset, vehicle switch, navigation, or window resizing.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Recorded item&lt;/th&gt;
&lt;th&gt;Capture conditions&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Renderer marker&lt;/td&gt;
&lt;td&gt;Three.js r186&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Viewport&lt;/td&gt;
&lt;td&gt;1470 × 775 CSS pixels; device pixel ratio 2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3D canvas&lt;/td&gt;
&lt;td&gt;881 × 565 CSS pixels; drawing buffer 1762 × 1130&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Reported camera distance&lt;/td&gt;
&lt;td&gt;7.8000 in every capture&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Environment&lt;/td&gt;
&lt;td&gt;Same RoomEnvironment / PMREM setup&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Lighting configuration&lt;/td&gt;
&lt;td&gt;Hemisphere light intensity 1.2; directional light intensity 2.5 at &lt;code&gt;(4, 8, 3)&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Exposure&lt;/td&gt;
&lt;td&gt;0.9&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Base-color inputs&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;#AB645B&lt;/code&gt; and &lt;code&gt;#343B3A&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Finish presets&lt;/td&gt;
&lt;td&gt;Gloss, Satin, Matte&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The lighting settings were checked against the inspected application source snapshot and the script loaded by the browser. GPU uniforms were not inspected directly. Camera azimuth, elevation, and the complete Chrome version were not recorded either, so this is an application-level comparison with repeatability evidence, rather than a claim of pixel-identical reproduction across devices.&lt;/p&gt;

&lt;p&gt;Two colors across three finishes produced six conditions. Two return-to-baseline captures brought the total to eight unmodified screenshots.&lt;/p&gt;

&lt;p&gt;Color changes were visible on the hood, doors, and fenders, while the glass, wheels, and dark carbon components retained their appearance. Both colors showed changes between Gloss and Matte, although some sharp highlights remained under Matte.&lt;/p&gt;

&lt;p&gt;The dark-gray sequence was &lt;strong&gt;Satin → Gloss → Matte → Satin&lt;/strong&gt;. A second sequence switched away from the copper-colored Satin condition and then restored it. In both cases, the returning screenshot had the same whole-file SHA-256 hash as its corresponding baseline. That supports the absence of visible framing or scene drift within these sequences.&lt;/p&gt;

&lt;p&gt;The original screenshots and model binary are not distributed with this article because their source-license provenance still needs clarification. The tables below summarize retained internal records; the exact asset-specific images cannot be independently reproduced from this article alone.&lt;/p&gt;

&lt;h2&gt;
  
  
  One preset changed more than one parameter
&lt;/h2&gt;

&lt;p&gt;The finish mapping was verified in the script loaded by the browser:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Preset&lt;/th&gt;
&lt;th&gt;Base roughness&lt;/th&gt;
&lt;th&gt;Metalness&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Gloss&lt;/td&gt;
&lt;td&gt;0.16&lt;/td&gt;
&lt;td&gt;0.24&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Satin&lt;/td&gt;
&lt;td&gt;0.42&lt;/td&gt;
&lt;td&gt;0.24&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Matte&lt;/td&gt;
&lt;td&gt;0.86&lt;/td&gt;
&lt;td&gt;0.02&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Of these two parameters, only roughness changed between Gloss and Satin. Switching to Matte also changed metalness.&lt;/p&gt;

&lt;p&gt;Consequently, the full three-preset comparison does not isolate roughness. Three.js defines roughness and metalness as separate material properties; metalness is not a general-purpose gloss control. &lt;a href="https://threejs.org/docs/pages/MeshStandardMaterial.html" rel="noopener noreferrer"&gt;MeshStandardMaterial documentation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The original rationale for these values was not established, and no physical film samples were used for calibration. They are application presets, not universal physical definitions of gloss, satin, or matte.&lt;/p&gt;

&lt;p&gt;To check that the changes extended beyond the selected UI control, the screenshots were compared using mean absolute differences in decoded RGB values:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Comparison&lt;/th&gt;
&lt;th&gt;Mean absolute difference, 0–255&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Copper Satin / dark-gray Satin&lt;/td&gt;
&lt;td&gt;6.996&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Dark-gray Satin / dark-gray Gloss&lt;/td&gt;
&lt;td&gt;1.047&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Dark-gray Gloss / dark-gray Matte&lt;/td&gt;
&lt;td&gt;1.765&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Copper Satin / copper Gloss&lt;/td&gt;
&lt;td&gt;0.700&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Copper Gloss / copper Matte&lt;/td&gt;
&lt;td&gt;1.542&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Each of the two baseline-return comparisons&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The comparison region was the same screenshot rectangle: &lt;code&gt;x = 100…959&lt;/code&gt;, &lt;code&gt;y = 130…684&lt;/code&gt;. It includes background pixels, and the originals are JPEGs. These values establish image changes and returns to baseline within this capture session. They are not ΔE measurements, physical gloss readings, or material-accuracy scores.&lt;/p&gt;

&lt;h2&gt;
  
  
  The imported material had another reflective layer
&lt;/h2&gt;

&lt;p&gt;The paint material in the actual GLB contained these extension fields:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"extensions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"KHR_materials_clearcoat"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"clearcoatFactor"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"clearcoatRoughnessFactor"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;0.04&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Khronos extension defines a clearcoat layer over the base material, with its own intensity and roughness. Setting &lt;code&gt;clearcoatFactor&lt;/code&gt; to zero disables that layer. &lt;a href="https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_clearcoat/README.md" rel="noopener noreferrer"&gt;KHR_materials_clearcoat specification&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Three.js exposes the corresponding &lt;code&gt;clearcoat&lt;/code&gt; and &lt;code&gt;clearcoatRoughness&lt;/code&gt; properties. A rough base can therefore have a much smoother coating above it. &lt;a href="https://threejs.org/docs/pages/MeshPhysicalMaterial.html" rel="noopener noreferrer"&gt;MeshPhysicalMaterial documentation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The r186 loader provides a concrete explanation of how those properties enter the scene. When the clearcoat extension is present, &lt;code&gt;GLTFLoader&lt;/code&gt; selects &lt;code&gt;MeshPhysicalMaterial&lt;/code&gt; and maps the glTF factors to its clearcoat properties. &lt;a href="https://github.com/mrdoob/three.js/blob/r186/examples/jsm/loaders/GLTFLoader.js#L848" rel="noopener noreferrer"&gt;Three.js r186 GLTFLoader source&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The inspected application path then clones the imported material and replaces its base roughness, metalness, and color map without resetting clearcoat. The r186 material-copy implementation preserves the clearcoat properties and associated maps. &lt;a href="https://github.com/mrdoob/three.js/blob/r186/src/materials/MeshPhysicalMaterial.js#L514" rel="noopener noreferrer"&gt;Three.js r186 material-copy source&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Along that code path, a base roughness of &lt;code&gt;0.86&lt;/code&gt; can coexist with a clearcoat roughness of &lt;code&gt;0.04&lt;/code&gt;. The base roughness value alone does not describe the complete material.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;This is a plausible explanation for the remaining highlights, not an experimentally established cause.&lt;/strong&gt; The capture session did not include a clearcoat-disabled comparison or direct inspection of the final material uniforms. Surface normals, bright regions in the environment, and other material settings can also affect the image. A preset named Matte does not imply zero reflection.&lt;/p&gt;

&lt;h2&gt;
  
  
  A follow-up comparison that could distinguish the causes
&lt;/h2&gt;

&lt;p&gt;The next diagnostic step would keep the model, camera, color, base roughness, metalness, and environment fixed in an isolated scene:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Proposed condition&lt;/th&gt;
&lt;th&gt;Base roughness&lt;/th&gt;
&lt;th&gt;Metalness&lt;/th&gt;
&lt;th&gt;Clearcoat&lt;/th&gt;
&lt;th&gt;Clearcoat roughness&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A: retain the coating&lt;/td&gt;
&lt;td&gt;0.86&lt;/td&gt;
&lt;td&gt;0.02&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;0.04&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;B: disable only the coating&lt;/td&gt;
&lt;td&gt;0.86&lt;/td&gt;
&lt;td&gt;0.02&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0.04&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C: increase only coating roughness&lt;/td&gt;
&lt;td&gt;0.86&lt;/td&gt;
&lt;td&gt;0.02&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;0.86&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A/B would examine the coating's contribution. A/C would examine the effect of its roughness. &lt;strong&gt;At the time of the October 27 capture, these comparisons had not been performed.&lt;/strong&gt; The October 30 update below reports a procedural-sphere comparison; the original vehicle-specific comparison remains unperformed. The values are diagnostic choices, not calibrated settings for a real wrap film.&lt;/p&gt;

&lt;p&gt;For a similar investigation:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Record the actual material type, asset version, and glTF extensions.&lt;/li&gt;
&lt;li&gt;List every property changed by the UI action.&lt;/li&gt;
&lt;li&gt;Inspect the base and coating layers separately, including their maps and normals.&lt;/li&gt;
&lt;li&gt;Keep the camera, environment, exposure, and output pipeline fixed while changing one diagnostic variable.&lt;/li&gt;
&lt;li&gt;Return to the starting condition and capture it again.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Keep the color pipeline consistent as well. Three.js distinguishes color inputs, its linear working space, and display output. A base-color input is not a promise that the illuminated body will have the same pixel values. Color textures and roughness-data textures also require different color-space treatment. &lt;a href="https://threejs.org/manual/pages/color-management.html" rel="noopener noreferrer"&gt;Three.js Color Management manual&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The eight captures establish recoverable image changes between color and finish presets. The asset fields, loader, and copy implementation establish a documented route by which an imported coating can survive those preset changes. Whether that coating caused the particular sharp highlights on the original vehicle remains a question for a vehicle-specific controlled comparison.&lt;/p&gt;




&lt;h2&gt;
  
  
  Update — October 30, 2026: a controlled procedural-sphere comparison
&lt;/h2&gt;

&lt;p&gt;The follow-up now has a result for a simpler scene. A procedural sphere was used to test the clearcoat mechanism without importing the vehicle asset or its materials. This does not establish the cause of every highlight on the original car model.&lt;/p&gt;

&lt;p&gt;The study used the installed &lt;strong&gt;Three.js 0.186.1 (REVISION 186)&lt;/strong&gt; and one &lt;code&gt;SphereGeometry(1, 96, 64)&lt;/code&gt; with &lt;code&gt;MeshPhysicalMaterial&lt;/code&gt;. The base color was &lt;code&gt;#343B3A&lt;/code&gt;, base roughness &lt;code&gt;0.86&lt;/code&gt;, and metalness &lt;code&gt;0.02&lt;/code&gt;. There were no color, roughness, metalness, normal or clearcoat maps.&lt;/p&gt;

&lt;p&gt;A fixed perspective camera used a 33° field of view, position &lt;code&gt;(0, 0, 4.5)&lt;/code&gt;, and target &lt;code&gt;(0, 0, 0)&lt;/code&gt;. The drawing buffer was 640 × 480 at pixel ratio 1. RoomEnvironment was filtered with PMREM sigma &lt;code&gt;0.04&lt;/code&gt;; hemisphere intensity was &lt;code&gt;1.2&lt;/code&gt;, directional intensity &lt;code&gt;2.5&lt;/code&gt; at &lt;code&gt;(4, 8, 3)&lt;/code&gt;, and ACES Filmic exposure &lt;code&gt;0.9&lt;/code&gt; with sRGB output. These are recorded scene inputs, not calibrated film or studio-light settings.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Condition&lt;/th&gt;
&lt;th&gt;Base roughness&lt;/th&gt;
&lt;th&gt;Metalness&lt;/th&gt;
&lt;th&gt;Clearcoat&lt;/th&gt;
&lt;th&gt;Clearcoat roughness&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A: smooth coating&lt;/td&gt;
&lt;td&gt;0.86&lt;/td&gt;
&lt;td&gt;0.02&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;0.04&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;B: coating disabled&lt;/td&gt;
&lt;td&gt;0.86&lt;/td&gt;
&lt;td&gt;0.02&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0.04&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C: rough coating&lt;/td&gt;
&lt;td&gt;0.86&lt;/td&gt;
&lt;td&gt;0.02&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;0.86&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;A — smooth clearcoat over a rough base:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuckiykasliq9p4zssjdz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuckiykasliq9p4zssjdz.png" alt="Procedural sphere A: base roughness 0.86, metalness 0.02, clearcoat 1, clearcoat roughness 0.04" width="640" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;B — only clearcoat intensity changed to zero:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsp0z0mppbf0fixqpwcxi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsp0z0mppbf0fixqpwcxi.png" alt="Procedural sphere B: base roughness 0.86, metalness 0.02, clearcoat 0, clearcoat roughness 0.04" width="640" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;C — only clearcoat roughness changed from 0.04 to 0.86 relative to A:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fh3t3v1ighho6wf5bq49o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fh3t3v1ighho6wf5bq49o.png" alt="Procedural sphere C: base roughness 0.86, metalness 0.02, clearcoat 1, clearcoat roughness 0.86" width="640" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The actual sequence was &lt;strong&gt;A → B → A → C → A&lt;/strong&gt;. One renderer, camera, geometry and material instance remained in use. Each capture checked the fixed inputs, including the camera quaternion and projection matrix, then read the rendered RGBA8 framebuffer with WebGL &lt;code&gt;readPixels&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In A, the sphere displayed concentrated rectangular and point-like highlights. With the coating disabled in B, those sharp patches disappeared while broad shading remained. In C, the coating's reflection became broad and soft. Thus, in this particular scene, changing only a clearcoat property changed the highlight appearance while base roughness and metalness stayed fixed. This is a rendered-image observation, not a measurement of physical surface gloss.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Raw-framebuffer comparison&lt;/th&gt;
&lt;th&gt;Mean absolute RGB8 difference&lt;/th&gt;
&lt;th&gt;Changed pixels / 307,200&lt;/th&gt;
&lt;th&gt;Largest channel difference&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A / B&lt;/td&gt;
&lt;td&gt;6.407536&lt;/td&gt;
&lt;td&gt;106,717&lt;/td&gt;
&lt;td&gt;149&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A / C&lt;/td&gt;
&lt;td&gt;5.679630&lt;/td&gt;
&lt;td&gt;106,684&lt;/td&gt;
&lt;td&gt;139&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;B / C&lt;/td&gt;
&lt;td&gt;4.714180&lt;/td&gt;
&lt;td&gt;107,484&lt;/td&gt;
&lt;td&gt;23&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Each return to A / initial A&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The metric averages absolute differences over all RGB channels of the complete 640 × 480 output, including background. It is measured after the display rendering pipeline and is not a radiometric value, ΔE or a gloss score. B/C is reported descriptively; unlike A/B and A/C, it changes two clearcoat properties and is not the single-variable comparison used for attribution.&lt;/p&gt;

&lt;p&gt;Both returns to A produced exactly the same raw RGBA SHA-256 as the first A frame: &lt;code&gt;b8ff28648db40271a33bb56af6eccb5c2b797e11f393f77cfa3af55527f9be60&lt;/code&gt;. The original PNG files were also byte-identical. An independent PNG decode reproduced the framebuffer comparison values. Pixel reads reported no WebGL errors, and the recorded fixed inputs remained unchanged throughout the sequence.&lt;/p&gt;

&lt;p&gt;These are direct procedural WebGL renders, without image-generation models, retouching or compositing. They demonstrate a clearcoat effect on the specified sphere. They do not validate the original vehicle's complete material pipeline, establish the sole cause of its highlights, calibrate real vinyl, or represent a production fix. The original asset-specific causal question therefore remains narrower than this mechanism demonstration.&lt;/p&gt;

&lt;p&gt;The result is consistent with the independently controlled coating layer described in the &lt;a href="https://threejs.org/docs/pages/MeshPhysicalMaterial.html" rel="noopener noreferrer"&gt;Three.js material documentation&lt;/a&gt;. The environment setup follows the &lt;a href="https://threejs.org/docs/pages/RoomEnvironment.html" rel="noopener noreferrer"&gt;RoomEnvironment&lt;/a&gt; and &lt;a href="https://threejs.org/docs/pages/PMREMGenerator.html" rel="noopener noreferrer"&gt;PMREMGenerator&lt;/a&gt; APIs. The useful debugging step is to isolate the imported material's layers and control them separately before assigning a visual difference to base roughness alone.&lt;/p&gt;

</description>
      <category>threejs</category>
      <category>webgl</category>
      <category>graphics</category>
      <category>debugging</category>
    </item>
  </channel>
</rss>
