checking if entities are seen by the camera

Posted By: Progger

checking if entities are seen by the camera - 09/05/11 21:46

Hello guys im trying to make a culling system because i have over 20000 entities in my level so i want to increase the framerate and i want this invisible which can not seen by the camera is it possible? for example you all know the game minecraft there you can see how good the fps is by thousands of cubes.Thanks for reading laugh
And i hope you can help me laugh
WFG Progger
Posted By: painkiller

Re: checking if entities are seen by the camera - 09/05/11 22:21

search for CLIPPED:

Code:
Tells wether an entity is potentially visible or not, i.e. whether it was clipped away by the culling process during the last frame. Can be evaluated for running entity functions - for instance, particles - depending on its visibility.

if (!(my.eflags&CLIPPED)) { emit_particles(); } // lite-C


Posted By: darkinferno

Re: checking if entities are seen by the camera - 09/06/11 03:23

that only checks if theyre infront of the cam correct? not if theyre behind other ents
Posted By: Progger

Re: checking if entities are seen by the camera - 09/06/11 11:13

@painkiller thanks for the answer laugh
@darkinferno yes you are right i need something that only renders
the entities which are in the front and not behind other ents.
@all
How did they reach that in minecraft i mean i see there thousands of bocks but when i press F3 to see the stats there are only 300and more visible how could that be? laugh i think it is a pretty difficult algorithm what do you think?
WFG Progger laugh
Posted By: xxxxxxx

Re: checking if entities are seen by the camera - 09/06/11 11:47

Hi Progger
In minecraft aren't tousends of blocks. the world is splitten in small parts every part is a big mesh(like chunked terrains in A8), so there aren't much rendercalls( and polygons too laugh ). But if ur game isn't a minecraft clone it could be very hard or impossible to make something like this. I think the best way is such a calling system like u said.
xxxxxxx
Posted By: Rei_Ayanami

Re: checking if entities are seen by the camera - 09/06/11 15:11

The problem is not that there are chunks, but that they use voxels.

The world is array based, and its really easy to check if a block is visible or not. See Richi007's cubeX framework wink
Posted By: Progger

Re: checking if entities are seen by the camera - 09/09/11 09:36

ok thanks for all answers but do ou think it is possible to do something like minecraft with 3dgs script based i mean there is no function to group several entites (models) to a single mesh or chunk.When you think it is possible how to do that
Thanks for reading laugh
greetings Progger
© 2024 lite-C Forums