Block Renderer [Forge/Fabric]

Block Renderer [Forge/Fabric]

3.3k Downloads

Correct animated rendering by using frametime

Tslat opened this issue ยท 3 comments

commented

Not sure if it's possible with the way you're doing it - but currently the 'animated' render option doesn't quite work because it seems to just use frametime 1

For blocks where the frametime has been altered via the .mcmeta file, can we account for that in the animated renderer?

E.G.

{
"animation": {
"frametime": 3
}
}

Attempting to render an animated block with the above causes the animation to run 3x faster than it does ingame, which isn't really representative

commented

I can see the issue, its not with the frametime but with me using the wrong constant for the frame delay which should affect all gifs.

I'm passing in 20 ticks rather than the delay in ms of 1000 / 20 so should be roughly a 25x difference, not sure how I didnt notice that.

The animation frametime will cause issues currently with the gif render, the current setup simulates in ingame tick to forward the animations and has no concept of frametime, this mean you will get partial frames at the start of the gif and partial frames at the end.
I think I can fix this however by dropping the first frame (and frames that are identical) at the start and continuing rendering at the end until we hit a frame that isn't identical.

commented

Generated Render

Screencaptured.Render.mp4

I've uploaded both an ingame capture and an output render of the same block for comparison

commented

Something's still not quite right with this - See updated render & ingame recording for reference

Render

13_16_17_54_861.mp4

This was done with 1.16.4-1.4.3, Auto loop ticked, 302px size, 8 animation length

For reference, the file is 8 frames long, with a 3 frametime in the mcmeta
The render always seems to be slower than ingame for some reason - or are my eyes just deceiving me?

EDIT: Scratch that - I was watching it really closely on here after uploading it and double checked, it seems my image viewer is rendering it slower than it should - it appears to be correct on here and elsewhere when I checked.

Please ignore this post