Canvas Renderer

Canvas Renderer

202k Downloads

Vanilla Bug: Alpha Interpolate on Animated Textures

grondag opened this issue ยท 1 comments

commented

Consider fixing, per conversation below:

@grondag does indigo/canvas by any chance fix animated sprite interpolation not interpolating alpha? ๐Ÿ‘€
i forget where exactly but the code is somewhere in Sprite
interpolated opacity is ๐Ÿ‘Œ
i perstered tterrag to implement it in CTM for 1.12
the asm for it is here if you wanna peek https://github.com/Chisel-Team/ConnectedTexturesMod/blob/6bab85ef64b098b9ab854757c3b388f182f60e80/src/main/java/team/chisel/ctm/client/asm/CTMTransformer.java#L192-L220
(dont scroll up if you want to avoid mcp names)
the bytecode is pretty impressive tbh
super clean
i doubt you could get it as high precision as that with a mixin lol
but maybe.. would need to look at the code again
problem is you cant manipulate bitshifts
you might be able to slice and capture mixin-generated locals mid-op :ThinkNoose:
im not sure if youd be able to get into a spot where the local would be visible though.. ive rarely gotten generated locals to capture
i think ive only achieved it once
and it was probably a bug
lol

GrondagToday at 6:58 PM
Canvas doesn't do anything about that. Was not even aware of the bug. If I were going to fix I'd probably just redirect interpolateFrames() altogether and make it a config option.
If I had to do it as a Mixin I'd probably capture the two calls to getFramePixel(), compute my result on the second one, and then hook the call to setPixelRGB and mask in my alpha there. Still a mess.

commented

Will likely pursue procedural texturing for animated translucency - animated textures aren't performant.