Culling system

Blitz3D Forums/Blitz3D Programming/Culling system

gotelin(Posted 2004) [#1]
I have a scenary with 110.000 polygons in format B3d,
Is there any culling system for aplicate in scenary.
Thanks


jfk EO-11110(Posted 2004) [#2]
You can split it up in smaller parts and lower the camera range. Everything that is not within the camera range will be culled pretty efficiently.

You could also write a special function that loads in your mesh and then automaticly splits it up in smaller chunks (just parsing all surfaces and their vertices, then reconstruct copies of it and finally remove the original)


gotelin(Posted 2004) [#3]
Thanks
Can you post any example with that,please?

Thanks


jfk EO-11110(Posted 2004) [#4]
http://www.blitzbasic.com/codearcs/codearcs.php?code=1244


Uber Lieutenant(Posted 2004) [#5]
Hell yea, jfk! :D


DJWoodgate(Posted 2004) [#6]
Nice routine. It might be an idea to display the render times though.

BTW... For t=0 To CountTriangles(surf)-1

I think you will need to copy the normals as well.

PS. I can not do any better, so I am not having a pop. :)


jfk EO-11110(Posted 2004) [#7]
Updatenormals should do the trick too, but you're right, CountTriangles(surf)-1, tho it seems to work anyway.

Render times heavily depend on the situation, since this will generate more surfaces, you need to use it in the right way. eg. maybe you should lower the number of clusters, even 3*3*3 may be useful.

And this thing may also be a basement for an automated VIS system. you could precalculate the visibility of all clusters from inside every cluster. Using the old ICU Method of recognizing unique colors and Terabits speed boster could make it a real useful thing.


DJWoodgate(Posted 2004) [#8]
I changed it to copy the normals because, updatenormals relies on everything being in the same mesh. Remove the entitycolor stuff to see what happens. It's not obvious otherwise. The normals will not be smoothed together at the intersections and you end up with parts being illuminated rather strangely.

I agree it is a useful routine. What is Terabits speed booster? I must have missed that. Do you mean his weld routine?


jfk EO-11110(Posted 2004) [#9]
Ok, I see. Could you post your modified version in that code archive thread too please?

Terabits booster was the way he used the ICU Method. The ICU Method is using unique colors for each mesh. It will then use renderworld and readpixelfast to determine the visibility of the meshes from any (raster)point of the scene. It's a lot faster than linepicking or entityvisible, also allows to see a mesh if only a little part is visible (unlike EntityVisible) etc. and allows to see multiple meshes with one renderworld.

Terabit optimized my source from 5 Minutes to something like 10 Seconds if I remember right, using faster buffers (not the backbuffer) to read the pixels and use 6 cameras for 6FOV side by side canvas rendering with a single Renderworld etc. I don't remember exactly, but I think I saved that thread somewhere.


jfk EO-11110(Posted 2004) [#10]
OK, I replaced the UpdateNormals with the Normals Cloning, that is as you said the real correct solution, thanks.


jfk EO-11110(Posted 2004) [#11]
Anyway, I wonder if the guy who asked for this will ever come back to this thread. This is one of the reasons why I sometimes don't help, because of it sometimes really sucks when you spend a hour or so to help, just to see that the guy never came back to see the answer :) Well, in this case I think it's a useful archive entry anyway.


Uber Lieutenant(Posted 2004) [#12]
Indeed it is. I'll get use out of it pretty soon, methinks.