sm64 icon indicating copy to clipboard operation
sm64 copied to clipboard

Paintings fixed math

Open AngelTomkins opened this issue 11 months ago • 2 comments

Vertex displacement math is very slow, it currently uses floating point math. Per vertex it runs 16 floating point operations. (including a square root) This implementation only affects the graphical rendering of paintings and "floor paintings" like HMC and CotMC.

This PR converts all the values of the painting used in the vertex displacement math once per frame and operates on them all. This change makes the frame rate in HMC's room in the basement stay below 33 ms frame time. Thus staying at 30 fps. This affects the wobble effect when bonking or jumping into paintings too.

This change does not preserve the build for non DSi targets.

AngelTomkins avatar Mar 05 '24 03:03 AngelTomkins

This PR now preserves the build for non TARGET_NDS devices

AngelTomkins avatar Mar 06 '24 21:03 AngelTomkins

The graphics looks identical to me everywhere except for in HMC entrance, the centre of the "wobble" is slightly offset, and I'm not sure why. I will keep looking into this. image

AngelTomkins avatar Mar 06 '24 21:03 AngelTomkins