phetsims / alpenglow

Experimental rasterization engine, by PhET Interactive Simulations
MIT License
9 stars 0 forks source link

Radial gradient split failure with EdgedFace #7

Open jonathanolson opened 11 months ago

jonathanolson commented 11 months ago

(Hard, this is the bug I was describing with the circular clipping where we're getting a mismatch of edges).

It seems like EdgedFace.getBinaryCircularClip is outputting invalid data. As discussed, later stages need the start/end points of edges to match up precisely. I probably screwed up something like this in CircularClipping.binaryCircularClipEdges.

To reproduce, apply the patch below (or just... enable the one test in RasterizeTests.ts), and run the unit tests.

Subject: [PATCH] Enable test
---
Index: js/raster/RasterizeTests.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/raster/RasterizeTests.ts b/js/raster/RasterizeTests.ts
--- a/js/raster/RasterizeTests.ts   (revision 5e56f9c48be2d1fe4b67f2f93ce2980a7d1f4e8d)
+++ b/js/raster/RasterizeTests.ts   (date 1697254991298)
@@ -14,7 +14,7 @@

 QUnit.module( 'Rasterize' );

-QUnit.skip( 'split clip start end matches', assert => {
+QUnit.test( 'split clip start end matches', assert => {

   const colors = _.range( 0, 100 ).map( i => new RenderColor( new Vector4( i / 100, 0, 0, 1 ) ) );
   const outputSize = 768 * 2;
jonathanolson commented 11 months ago

I believe the other two circular clip tests that are skipped are likely to be the same issue. If the area is off... I might have a bigger bug.