Open Rinnegatamante opened 8 years ago
A frame drop was expected because operation HARD_LIGHT is much more complex then SRC or OVER.
But I'm surprised that it is below 16 FPS. See also: http://cairographics.org/operators/
To everyone who wants to try to solve this: A possible solution is to swap from sf2dlib to citro3D and then using a vertex shader to perform HARD_LIGHT operation on the 2D texture rendered in the same method as sf2dlib currently does.
I tried to write a GLSL shader for Hard light based on the Cairo formula last weekend but I couldn't get the correct result. When that shader works will try porting it to PICA.
There is no programmable pixel shader support on the PICA200, so using a shader to fix this is out of the question. Have you tested other operations that could achieve somewhat similar results with better performance?
I don't think we can get a similiar result because HARD_LIGHT result depends on if the color value is below or above 128... I will try to use a precalculated lookup table which gives a not-perfect result but should be much faster.
But all other operations should be replacable, which will only give a minor boost but summed up should give a nice FPS boost: OP_OVER which is just a blend of SRC on DEST and OP_SRC which is just SRC overwriting DEST. Also zoom, rotate & co. can be easily hardware accelerated.
Screen Tone feature causes a drastic framedrop (32 -> 9 fps on O3DS).