So far I'm doing so by lerping from 0f to 1f on the alpha-value on the Color-property on the SpriteRenderer. Could you plese give me a hint if I am missing something? Thanks in advance!Īnother question - this might be more of a shader/material-thing! Just to mention: MSAA was NOT active during these tests. My main confusion is: How is possible that FPS is 3 times lower with this plugin when the stats are showing better numbers with it? I tested also on lower end hardware, results were similar, so SVGImporter offered 3 times better FPS. * UnityVectorGRaphics had less triangles for similar quality * UnityVectorGraphics had dynamic batching, SVGImporter didn't * FPS with SVGImporter was 90, with UnityVectorGraphics 30 What was confusing to me were the results of the test I mentioned above: I like that I have ability to set up the tesselation options exactly how I need them. I was able to show SVGs very quickly, and code was very intuitive. It also enables creating vector graphics from runtime, which is very cool. Answer was that it uses more GPU friendly meshes. The question is - why is UnityVectorGraphics better? What has been improved etc. * I read your previous posts, and I saw that someone asked similar question. I do have sprite caching, so once I create a sprite using tesselator, I am reusing it next 9 times I need it. On scene, I have 1200 gameobjects with Sprite renderers. I used the "Runtime loading" example to create vector sprites of them, and assign them to SpriteRenderers on scene. * I load 120 distinct SVG assets from our server. Because of the lack of the support, we are looking for a better solution, and I got assignment to try out Unity Vector Graphics. I am working on big project where we already use vector graphics plugin - SVGImporter. So is there any other alternative or i am wrong at converting sprite to texture? or all materials are messed up when this texture is applied at runtime with shader unlit/Vector. Tshirt.GetComponent().material.SetTexture("_MainTex",coloredTexture) Īnd here i am using svg mat with shader unlit/Vector.īut my tshirt mesh front part is looking like a transparent mesh. Texture2D coloredTexture = VectorUtils.RenderSpriteToTexture2D(sprite, 5000, 5000, svgMat, 1, true) Var sprite = VectorUtils.BuildSprite(geoms, 1000.0f,, Vector2.zero, 128, true) Īnd after getting all different colours on sprite i wanted to convert this sprite to texture like this: Var geoms = VectorUtils.TessellateScene(sceneInfo.Scene, tessOptions) Var sceneInfo = SVGParser.ImportSVG(new StringReader(svgFile)) Var tessOptions = new VectorUtils.TessellationOptions() Hello, i am using vector graphics to change the colour of T-shirt sleeves, collar etc., so i have successfully filled the colours on sprite with this code.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |