Search Issue Tracker

By Design

Votes

0

Found in [Package]

2.0.0-preview.21

Issue ID

VGB-7

Regression

No

[Vector Graphics] Resolution loss and artifacts when importing SVG with the Vector Graphics package

Package: Vector Graphics

-

Reproduction steps:
1. Open the attached project "ReproProj"
2. Open the “/Assets/Scenes/SampleScene.unity” Scene
3. Enter the Play Mode
4. Observe the Game view window

Expected result: SVG on the right looks the same as SVG seen on the left side
Actual result: Right SVG differs from the SVG seen on the left side

Reproducible with: 2.0.0-preview.6 (2021.3.28f1), 2.0.0-preview.21 (2021.3.28f1, 2022.3.6f1, 2023.1.5f1, 2023.2.0b1)
Could not test with: 2.0.0-preview.5 (2021.3.28f1) (Library\PackageCache\com.unity.vectorgraphics@2.0.0-preview.5\Runtime\InternalBridge\VectorImageBridge.cs(88,25): error CS0117: 'Vertex' does not contain a definition for 'settingIndex')

Reproduces on: Windows 10 Enterprise 21H2

Notes:
- SVG is imported from a script using the VectorUtils.VectorUtils.TessellateScene and VectorUtils.FillMesh methods
- The Tesselation is not uniform
- Looks like the StepDistance gets bigger and bigger over time with an increased resolution loss and artifacts: those are well visible with dashed strokes
- On the left, there is the correct result using the Sprite Renderer, while on the right the erroneous import via Script
- Could not test with Windows Standalone Player due to the right SVG not being rendered

  1. Resolution Note:

    This is expected. The SamplingStepSize value should be equivalent to 1/"Sampling Steps" provided in the SVGImporter. So to have 100 steps, you would provide a value of 0.01 for the SamplingStepSize.

    We may eventually either revise this API or fix the documentation for that behaviour.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.