Yellow-Dog-Man / Resonite-Issues

Issue repository for Resonite.
https://resonite.com
121 stars 2 forks source link

Add ability to import SVG's #2325

Open epicEaston197 opened 3 weeks ago

epicEaston197 commented 3 weeks ago

Is your feature request related to a problem? Please describe.

You can't import SVG's

Describe the solution you'd like

I want to be able to import SVG's

Describe alternatives you've considered

A mod

Additional Context

SVG's are really useful as it's an infinitely scaling graphic these could be used in things like sprites in your radial menu and such

Requesters

@epicEaston197

shiftyscales commented 3 weeks ago

Seeking input from @Geenz, but I imagine properly supporting vector graphics would be a chunk of work.

gameboycjp commented 3 weeks ago

Perhaps an off the shelf SVG library could do the job, similar to PDF support? I could look into that and provide an example plugin again.

Frooxius commented 3 weeks ago

It depends on how you want the SVG's to be rendered.

With off the shelf library, we can rasterize them - but then they're just textures and you don't get the infinitely scaling graphic.

If we wanted to get fancier, we'd have to have a more native way of rendering them within 3D world, but that's significantly more involved - and the SVG standard includes a lot of complex filters.

Dusty-Sprinkles commented 3 weeks ago

Personally I think the off the shelf library solution would still be nice since some graphics are easier to render with vectors even if you can't get the full advantages of them unless that's too much of a patch job to do one now and swap later

epicEaston197 commented 3 weeks ago

It depends on how you want the SVG's to be rendered.

With off the shelf library, we can rasterize them - but then they're just textures and you don't get the infinitely scaling graphic.

Can add a "scale" slider that would scale the vector graphic and rerender the image?

gameboycjp commented 3 weeks ago

What would be the base resolution there? If there's no hard coded one in the implementation, I feel like having an int2 or such to choose the resolution would be better here.

shiftyscales commented 2 weeks ago

Y'all are getting a bit into the weeds of implementation, @epicEaston197 @gameboycjp - right now we're focused on how we'd even want to go about this, e.g. in the additional context of this issue, infinite scaling was specifically called out- which we don't get if we just use a pre-made library that rasterizes them.

gameboycjp commented 2 weeks ago

I have concerns about possible performance penalties and limitations from rendering all of them within the 3D world. It would be neat to see both later down the line, but it's probably best as a separate issue. Having them rasterized would be more than enough.

Dusty-Sprinkles commented 2 weeks ago

I have concerns about possible performance penalties and limitations from rendering all of them within the 3D world. It would be neat to see both later down the line, but it's probably best as a separate issue. Having them rasterized would be more than enough.

I don't know what the typical implementation of SVG/vector graphics would be but at least for the infinitely scalable case you'd be working with the vectors directly which should only cost as much as the data you use to describe them if its implemented properly. That's one of the major draws of it as a format since its a very fast way to display extremely high resolution graphics.

But again for most uses rasterization is probably fine enough cause it would still make getting SVG-based sprites into resonite a little easier

ThomasSteve83 commented 2 weeks ago

What would be the base resolution there? If there's no hard coded one in the implementation, I feel like having an int2 or such to choose the resolution would be better here.

svg files have a set resolution, which is usualy fine for rasterization

ThomasSteve83 commented 2 weeks ago

maybe importing svgs as meshes could work? don't know about the procedural curves they use tho, polygons would have limitations

epicEaston197 commented 2 weeks ago

maybe importing svgs as meshes could work? don't know about the procedural curves they use tho, polygons would have limitations

no that will not work at all those are useless for putting into sprites and texture inputs

ultrawidegamer commented 2 weeks ago

I feel like if we are going to have svgs it would be pointless to not have infinite scaling, as otherwise we could just quickly convert to a raster outside of the game. As for a use case for svgs, it was brought up in conversation I had earlier that you could have a star skybox without any blurriness or large image files.