Skip to content

Commit 00ea198

Browse files
facelessusersvgeesus
authored andcommitted
[css-color-4] Correction to ray trace to avoid throwing off our intersection calculation
The suggested fix via #10579 (comment) was not the ideal fix and artificially limited `tnear`. This is a numerical instability issue and should be addressed as such by using an epsilon compare to prevent rays that are too small. Related #10579
1 parent 8b60dd2 commit 00ea198

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

css-color-4/Overview.bs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6155,7 +6155,7 @@ Sample Pseudocode for the Ray Trace Gamut Mapping</h4>
61556155
<li>let |d| be |b| - |a|</li>
61566156
<li>let |direction|<i>[i]</i> be |d|</li>
61576157
<!-- Non parallel cases -->
6158-
<li>if (d != 0):
6158+
<li>if abs(|d|) < 1E-15
61596159
<ul>
61606160
<li>let |inv_d| be 1 / |d|</li>
61616161
<li>let |t1| be (|bmin|<i>[i]</i> - |a|) * |inv_d|</li>
@@ -6185,7 +6185,7 @@ Sample Pseudocode for the Ray Trace Gamut Mapping</h4>
61856185
</li>
61866186
</ul>
61876187
</li>
6188-
<li>if (|tnear| > 10)
6188+
<li>if |tnear| is infinite (or matches the initial very large value)
61896189
<ul>
61906190
<li>return INTERSECTION NOT FOUND</li>
61916191
</ul>

0 commit comments

Comments
 (0)