Skip to content

Commit 9d43d53

Browse files
docs: clarify drawCircleGradient performance characteristics and limitation
- Note that it batches well with untextured polys - Suggest a baked-texture alternative for mostly-textured scenes - Document the same-position stacking artifact users might encounter Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 4606d0a commit 9d43d53

4 files changed

Lines changed: 12 additions & 0 deletions

File tree

dist/littlejs.esm.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4512,6 +4512,9 @@ function drawCircle(pos, size=1, color=WHITE, lineWidth=0, lineColor=BLACK, useW
45124512
}
45134513

45144514
/** Draw a circle filled with a radial gradient from the center to the rim
4515+
* - Best when batched with other untextured polys
4516+
* - If drawing mostly textured sprites, bake the gradient into a texture and use drawTile instead
4517+
* - Stacking gradients at the exact same position may show a faint vertical artifact
45154518
* @param {Vector2} pos
45164519
* @param {number} [size=1] - Diameter
45174520
* @param {Color} [colorInner=WHITE]

dist/littlejs.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4512,6 +4512,9 @@ function drawCircle(pos, size=1, color=WHITE, lineWidth=0, lineColor=BLACK, useW
45124512
}
45134513

45144514
/** Draw a circle filled with a radial gradient from the center to the rim
4515+
* - Best when batched with other untextured polys
4516+
* - If drawing mostly textured sprites, bake the gradient into a texture and use drawTile instead
4517+
* - Stacking gradients at the exact same position may show a faint vertical artifact
45154518
* @param {Vector2} pos
45164519
* @param {number} [size=1] - Diameter
45174520
* @param {Color} [colorInner=WHITE]

dist/littlejs.release.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3832,6 +3832,9 @@ function drawCircle(pos, size=1, color=WHITE, lineWidth=0, lineColor=BLACK, useW
38323832
}
38333833

38343834
/** Draw a circle filled with a radial gradient from the center to the rim
3835+
* - Best when batched with other untextured polys
3836+
* - If drawing mostly textured sprites, bake the gradient into a texture and use drawTile instead
3837+
* - Stacking gradients at the exact same position may show a faint vertical artifact
38353838
* @param {Vector2} pos
38363839
* @param {number} [size=1] - Diameter
38373840
* @param {Color} [colorInner=WHITE]

src/engineDraw.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,9 @@ function drawCircle(pos, size=1, color=WHITE, lineWidth=0, lineColor=BLACK, useW
728728
}
729729

730730
/** Draw a circle filled with a radial gradient from the center to the rim
731+
* - Best when batched with other untextured polys
732+
* - If drawing mostly textured sprites, bake the gradient into a texture and use drawTile instead
733+
* - Stacking gradients at the exact same position may show a faint vertical artifact
731734
* @param {Vector2} pos
732735
* @param {number} [size=1] - Diameter
733736
* @param {Color} [colorInner=WHITE]

0 commit comments

Comments
 (0)