Saturday, June 1, 2019

SVG textures for 3D game objects in Unity?


Is there a way to make textures using vector graphics and use it for 3d models so that textures would be object size independent and won't get blurry?



Answer




Possible? Sure, all you would need to do is implement a custom pixel shader which can renders SVG files instead of using an albedo texture.


Is it a good idea? Likely not, because vector graphics are usually not rendered pixel-by-pixel but shape-by-shape. GPUs are not optimized for that. I doubt you would manage to achieve a passable performance, even with very trivial SVGs.


It would very likely be a better idea to just use higher resolution textures. If you want to use vector graphics just to save file space (would of course only work if your textures are of an aesthetic which is expressed well in vector graphics) you could render the SVGs to textures at game start.


No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...