Antoshidza / NSprites-Foundation

Basic assets for working with NSprites package
MIT License
65 stars 17 forks source link

Flipbook animation not updating under Property Set #1

Closed belbeeno closed 1 year ago

belbeeno commented 1 year ago

I believe the update mode for _uvAtlasBuffer should be changed from Static to Reactive as it is updated every time the NSprite.UVAtlas component changes.

https://github.com/Antoshidza/NSprites-Foundation/blob/a4b75ea4ed2e8877c29402e463f56e3b502d31e1/Graphics/Regular%20Render/RegularSprite_PropertiesSet.asset#L17

Antoshidza commented 1 year ago

The idea was: UVAtlas is to locate texture part on atlas and it shouldn't be changed in common case after sprite was created. The one who should be changed during runtime is UVTilingAndOffset which has Reactive update mode.

belbeeno commented 1 year ago

Oh, huh... is that like a planned change to Foundation for later? Because I see the update to the shader as well as the baker in a4b75ea but can't find any changes to SpriteUVAnimationSystem.cs to reflect the use of this new UVTilingAndOffset component... unless I'm missing something?

Antoshidza commented 1 year ago

Yeah, you're right, I have a little mess with those UV components. So animation system now uses UVAtlas but it should use UVTilingAndOffset but later uses different calculation, so I must rewrite animation system a bit. For a meantime I will set UVAtlas to Reactive mode.

Antoshidza commented 1 year ago

I was wrong about my vision about what component should be shifted in animation system. I think that tiling and offset should be independent from animation because it is not about locating something on texture in the 1st place but about tiling and offset something (bruh). So now both components are Reactive and animation system works with UVAtlas as previously.