Hi guys,
I’m creating some 2d primitives like triangles/square/polygons etc using babylonjs. Although there are great 2d rendering engines, I’d really like to do everything with babylonjs if possible. Now, to the point, strokes are very much essential in 2d primitives. I’m trying to create strokes around babylon meshes. My initial exploration has resulted in these two approaches largely(trying to render strokes around a triangle) -
-
Rendering edges with
enableEdgesRendering
. Pg - https://playground.babylonjs.com/#MVSQWZ#40. This draws really smooth edges, but the ends are not pointed/round, they end abruptly. -
Using HighlightLayer with
isStroke
as true. This doesn’t have the above problem, but seems the lines are jagged and not as smooth as above. Are there some engine params or post processing steps that can improve this? Pg - https://playground.babylonjs.com/#MVSQWZ#39 Joints aren’t pointed, a little round, but that is fine for me. 1 is a little unacceptable as it leaves gaps in line joints which doesn’t look appealing.
Any ideas on how this could be handled better are greatly appreciated. Thanks a lot.