Skip to content

Conversation

@lincoln-lm
Copy link

AnimatedTextures currently fail to render properly (OpenGL debug message, id=1000, source=API, type=ERROR, severity=HIGH, message=glTexImage2D has generated an error (GL_INVALID_VALUE)) when provided textures > 16384 pixels tall. This limits the length of animations based on the resolution of the image. This PR attempts to allow providing multiple animated texture files that will be displayed one after another to get around this limit and allow animated textures of (theoretically) arbitrary length.

I am not confident this is the most elegant approach to solving the problem (and storing animated images the way MC does is very inefficient storage-wise) but it was the simplest I could think of.

@contariaa
Copy link
Owner

I am very worried about the performance impact of this, have you done any testing regarding load times, memory usage and framerate (on wall or ingame)?
If the performance is okay, I'm not opposed to adding something like this, but in general I would prefer to move to gif or webp or whatever file format is appropriate for longer animations, see #40, i also have some work on gif parsing locally, if you're interested I could push that aswell.

Implementation wise I'd prefer adding a seedqueue:columns parameter or something like that to mcmeta to allow for bigger animations in the same texture, since the name-x.png syntax is already used for randomizing locks.
I'm assuming (haven't tested it) that this would limit animations to 16384x16384, but that should be more than enough anyway, probably well above the threshold of causing serious performance issues

@lincoln-lm
Copy link
Author

I'm not sure the best way to go about profiling this but in my personal use with a very large animation (2 minutes, 20 fps, 1056x594) I haven't noticed any hiccups, rps drops, or other obvious issues unless the animation is chunked such that the individual .pngs are very large (splitting at a threshold lower than 16384 fixes this). I do think webp or gif support is ideal but it seemed out of my depth wrt java/mc modding. 16384x16384 isn't enough for my particular use case, though I do admit it is likely completely reasonable for more sane packs.

@contariaa
Copy link
Owner

If it works performantly enough for you that seems fine then, if it doesnt work well for other people they just wont be able to make use of this.
I don't like how this format clashes with the locked texture randomization, would get very weird if I ever want to implement randomization of other textures (or chunking of locked textures), not sure what the best alternative would be but i could be convinced of a folder structure, so /textures/gui/wall/background.png would just be the single image and to get multiple youd do /textures/gui/wall/background/0.png, /textures/gui/wall/background/1.png, ...

@contariaa
Copy link
Owner

so /textures/gui/wall/background.png would just be the single image and to get multiple youd do /textures/gui/wall/background/0.png, /textures/gui/wall/background/1.png, ...

This wouldnt work great with multiple resourcepacks but neither does lock randomization, probably something i'll look at improving in the eventual customization update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants