3dreamengine / 3DreamEngine

3DreamEngine is an *awesome* 3d engine for LÖVE.
MIT License
393 stars 18 forks source link

Fast in frustum function #6

Closed thisnickwasfree closed 4 years ago

thisnickwasfree commented 4 years ago

Any chances to get fast "in frustum" function to draw only those meshes which in camera's fow? I can check it in love.draw, but it slows down the scene (25 vs ~115 fps). But! The same mechanism gives 165 Vs 140 fps while watching to the area where no meshes placed.

Luke100000 commented 4 years ago

Feature in todo, together with LODs. I expected a lower FPS yield, thanks for the benchmark.

Luke100000 commented 4 years ago

Implemented. Not perfectly but it works. Dream.frustumCheck (default true) can toggle it. Manual usage is not necessary, but the function would be:

--cam (e.g. the default cam dream.cam)
--pos is the center of the object to check
--size is the radius
dream:inFrustum(cam, pos, size)