I am working on 3d game.
When i play html build on laptop with(built-in graphics card) i spend 20-25 ms to draw frame. I think that because i have a lot of go and sprites in screen. So i think that if i draw only visible sprites it will be good.
I split my map to chunks(5x5), then make ray cast in player fov. If ray intersept chunk, chunk visible. If ray intersept wall stop ray.
Without cunk i draw 950 sprites.
With chunk i draw:
best: 100 sprites
worst:600 sprites
average: about 300 sprites
I hide only walls, so all other objects are drawn
It don’t gave me visible boost in graphics, but also add additional work in script. At all i lost some more frames. I can make some optimisation for sctipt, but it is not help globaly.
1)Maybe i am doing something wrong?
2)Chunks contains one more problem. Sometimes i hide chunk, when i can see it. I can increase number of rays. But it is not 100% solution.
3)So delete objects or not?