LoginLogin
Nintendo shutting down 3DS + Wii U online services, see our post

efficient screen culling

Root / Submissions / [.]

DFrostCreated:
While working on Halo3DS, I came into a LOT of speed issues(obviously), so I made this function:
DEF CULL(X#,Y#,Z#)'other 5 variables are global so no need to require them
 'X#,Y#, AND Z# is the position of an object
 'X,Y,Z are cam coords
 'RX,RY are camera rotation(RZ is not important)
 RETURN ABS(DEG(ATAN(Z#-Z,Y#-Y)))-CX<45&&ABS(DEG(ATAN(Z#-Z,Y#-Y)))-CY<20&&SQR(POW(X#-X,2)+POW(Y#-Y,2)+POW(Z#-Z,2))<100
 'check if it is visible on X axis, check if visible in Y axis, check if near enough
END
I have another Idea for culling, but I need to actually write it.

Further optimization

This will help out:
GCLIP 1,0,0,400,240 'Don't draw off - screen
SPCLIP 0,0,400,240

TYPO! GCLIP not Graphical lips... 😧

Replying to:CyberYoshi64
TYPO! GCLIP not Graphical lips... 😧
THX! I feel like FREAKING GOD because I made an extremely efficient algorithm that can render 10000 objects at a semi - playable speed. (Not really render, but rather process and draw them if they pass the test. This is for Homo - Sapeins 3D and it's going to be the first open - world 3DS game on SB! EDIT: it processes/renders 1000 objects @ 40 Hz(40 FPS)!