I still tried to repeat the same procedure by calculating not in love.draw but by calculating love.graphics.present in love.run and I found again the same results for the 3 shaders (~0.002 seconds on average on the same pc) so I finally also think that these are not good techniques.
Personally I would have learned things from this post, thank you once again !
Edit: I take this opportunity to specify in case someone is in the same situation as me and would like to use the last shader proposed by Sasha264, if the position of the object that the mask must cover is not at the origin of the screen (0,0), this time you need to subtract the position of the object from `screen_coords` AND `light_pos` (unlike the old one where `vec2 current_pos = screen_coords - mask_pos` was enough.
i.e.:
Code: Select all
vec2 a = screen_coords - mask_pos;
vec2 b = light_pos - mask_pos;