PeterBacall wroteNeatWolf wrotePeterBacall wroteWARNING NOOB Questions below: :sweat:
Is this bad for performance?
I'm not an animator but I suppose it could be bad depending on how many chars like that you have on screen, but I simply don't have the required info about the use you want to do of it to provide a clear answer. Also, if you need the character to simply bend a bit (unless you're doing something procedural like applying a vertex shader which displaces the vertexes in some way), having that mesh is probably going to be a bit overkill, and I suppose you may end up having weird overlapping issues.
Thank you for the quick response! Here comes more info, correct me if I'm wrong:
I am using the Vertex Lit option in the Sprite Shaders. More verts (as ToddRivers stated earlier) gives a higher resolution light. So I generated a lot of them in Spine, mesh editor. I tried this and it surely results in a high resolution light.
My question is: at what point does the amount of verts get overkill for lighting (performance)?
![]()
I noticed I need a lot of vertices for the "Vertex Lit" option to be even near the result of "Pixel Lit". Why I'm not using "Pixel Lit" is because of the problems that occur, for example the Z-spacing making the sorting orders out of order. Overlapping characters were blending with each other etc. Therefore Vertex Lit seemed like a better choice. Can I have 400 verts on each character without really bad performance? I'm aiming for PC and MAC (no mobile).
Honestly, if you're on PC, and are aiming to create a scrolling beat'em'up or platform, I suppose you're going to have about 5-30 Spine entities on screen.
Even on old hardware, per pixel lighting shouldn't affect performance too much, I'd honestly stick with that and find a way to make them work (try both the ToddRiver's and the Spine version of the pixel lit shader, I'm experiencing totally different behaviours).
If you really have to fall back to vertex lit, you could still use a low-med grid, but positioning the rows and columns in a way that they form a bevel around the shape, and also by making the lines follow both the texture details and the general 3D shape of the character. A plain grid gives a suboptimal result in my opinion. You may even fake some sort of bump mapping or rim lighting by positioning the vertexes appropriately.
I suggest to stop and take some time to think about this decision, since changing everything in the middle of the project could simply make you want to trash everything and start over. Or, at least, many would be prone to do that.