Another fix for flipbook to work with all cases

#3381
This commit is contained in:
Wojtek Figat
2025-04-16 10:01:55 +02:00
parent 9dba7caa88
commit e267db7fac

View File

@@ -309,7 +309,7 @@ float3 AOMultiBounce(float visibility, float3 albedo)
float2 Flipbook(float2 uv, float frame, float2 sizeXY, float2 flipXY = 0.0f)
{
uint tile = (uint)fmod(frame, sizeXY.x * sizeXY.y);
float tile = fmod(frame, sizeXY.x * sizeXY.y);
float2 tileCount = float2(1.0, 1.0) / sizeXY;
float tileY = abs(flipXY.y * sizeXY.y - (floor(tile * tileCount.x) + flipXY.y * 1));
float tileX = abs(flipXY.x * sizeXY.x - ((tile - sizeXY.x * floor(tile * tileCount.x)) + flipXY.x * 1));