Rinnegatamante / easyrpg-player-3ds

EasyRPG Player port for 3DS.
GNU General Public License v3.0
13 stars 1 forks source link

Screen Tone causes an huge framedrop #11

Open Rinnegatamante opened 8 years ago

Rinnegatamante commented 8 years ago

Screen Tone feature causes a drastic framedrop (32 -> 9 fps on O3DS).

Ghabry commented 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/

Rinnegatamante commented 8 years ago

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.

Ghabry commented 8 years ago

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.

masterfeizz commented 8 years ago

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?

Ghabry commented 8 years ago

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.