Closed JeroenoBoy closed 1 year ago
Yes, it can be implemented, but it should be a part of Transform2D
and have all stuff like parent -> child rotation computations OR foundation should refuse to use 2D and instead use all 3D Unity.Transform
components and instead of constructing matrix in shader just pass it in. So I need to think what is a better way.
If you want it right here and now, then you can implement it by yourself. There are 3 possible ways I can imagine of how it can be done. (as a shader reference I will use https://github.com/Antoshidza/NSprites-Foundation/blob/main/Graphics/Regular%20Render/RegularNSprites_Shader.shader)
float4
struct to StructuredBuffer<float4>
in your shader and then in setup
function apply this structure as a rotation (quaternion
) in float4x4
matrix construction. Though I'm not sure of how to apply rotation to matrix (seems we can use this as an example)Unity.Transform
systems to have float4x4
matrix and pass this value to shader (in this way all we need is to just stop using Transform2D
from this foundation and use built-in solution + register it's matrix component as instanced, if I'm not mistaken it called something like LocalToWorld
)Unity.Transforms
matrix but only for 2D needs. It can be smaller matrix or just leave unused 4x4 matrix components in default values. Then as previous way says - pass it in shader as StructuredBuffer<float4x4>
.After a bit thinking I've decide that
Unity.Transforms
and register theirs components as instanced components for NSprites.What type of game you developing? 2D / 2,5D / 3D ?
Hi, the game I'm currently making is 2d. If you want an idea of what I'm trying to make, think reassembly, but way bigger.
After some fiddeling around, I've got it to work on my fork https://github.com/JeroenoBoy/Fundering
That's good. I've been on vacation, so now can return to work. I need to complete authoring refactoring, and then merge your changes, because I see that you also find and fix those bugs.
From now this package allows rotations (merged). Thanks for @JeroenoBoy
For the game I am making, I need sprites to be able to rotate.
Could this feature be added to the library?