Guys, I fixed it thanks xD
I used this function + converted everything to 512^2 dds, renders like 8 times faster and so on. Thank you guys, you revived my game!