Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Information
My attempt at supporting SVG loading as part of the resource pipeline. Works with both desktop/native build and wasm. Needs only the
resvg
crate to do so.Read in the linked issue in #4 that users wanted SVGs automatically rendered to a texture. That is what I have tried (and in my view succeeded) to accomplish here 🙂
The code in
Deserialize
forTexture2D
might be refactored, but found no prettier way to do it right now.Fixes #4
Testing
Simply modified the logo example in
three-d
to only show the colors of the image. (that examples fragment shader does some minor processing I did not look into, but simply removed when testing).Loaded the following image from wikimedia for testing wasm build, as it doesn't seem like the local resources were included.
https://upload.wikimedia.org/wikipedia/commons/5/54/Bot%C3%B3n_Me_gusta.svg
wasm:
native on Mac OS X (with the test.svg image included here):
Image is probably stretched a tiny bit in both cases, but mostly so on the native version.