SoulKarl honestly thought a billboard script would be somehow heavier to run than a shader lol. If that is not the case I'll just do that since I agree that's a lot easier π
Basically you move a calculation that is done once per object on the CPU to doing the same calculation repeatedly for each vertex on the GPU. Unless you have very few vertices per object that need to be facing the camera, then using a script to change the Transforms accordingly should be preferable. Of course, it depends whether you're CPU or GPU bound, etc. As always, you only can say for sure if you measure the result on the target device with the actual scenario. It should only be measurable with loads of billboard objects anyway, if at all.
To keep any script Update()
overhead minimal, you could just create a single BillboardManager
script which holds a list of Transforms which shall be rotated accordingly, then you only have a single script with one Update()
or LateUpdate()
call. You could use a Billboard
script at each GameObject just to add itself to this list of billboards and do nothing else, or use tags for that.
SoulKarl I did some more testing and there are two possibilities. However, when testing I now have pieces of the model disappearing completely using this same approach so that's not great (did not happen last time).
I'm not sure I understand what you mean by that. Which "two possibilities" are you talking about? Do you mean that you assume that one of the two following points causes the issues you see?
-Turning off mipmaps gets rid of the overlap aliasing, but then obviously gets rid of mipmaps which isn't exactly ideal (so it's related to that).
Could you please share some screenshots? Are you sure you have set some Z Spacing
other than 0 at your skeleton? In general mipmaps should not change anything in regards to the observed outline aliasing. Did you check your Materials Depth Alpha Cutoff
threshold, perhaps it is set to an unfortunate value which triggers at certain mipmap levels? Apart from that, are you sure that the mip level bias at the texture is not modified to be more blurry than it should be?
SoulKarl Realized I never mentioned that I'm currently using spine-unity-4.1-2022-08-03 in the event this is out of date and that is somehow contributing to potential problems here.
In this case I'm afraid that updating the runtime will not resolve the issues you're seeing. Nevertheless, whenever reporting any issues, be sure to update to the latest runtime version first to see whether any bugfix was released in the meantime (and backup your project first to be on the safe side).