Jump to content
Official BF Editor Forums

How To Prevent Culling


neurall
 Share

Recommended Posts

Hi guys renderer culls my tall buildings

EDIT:

Solved. Chael found out that meshes without cols are culled.

buildings are generated with one geom0 and one just one lod0 since right now they are just stupid debug boxes.

EDIT:

it's happening also on 3ds max exported boxes with lods and textures.

it is not happening on small buildings but taller the building is the worse it gets.

the boxes in video are 20m wide and 100m tall.

Video sample showing the issue

and here is problematic level.

http://www.gamefront.com/files/22102125/MyMod.zip

over 1 week i tryed everything I found in forums.

ObjectTemplate.cullradiusscale 1000

in box.tweak

GeometryTemplate.setSubGeometryLodDistance 0 0 10000

GeometryTemplate.setSubGeometryLodDistance 1 0 10000

in box.con

in init.con

terrain.lodswitchdistance 1000

terrainCuller.setUseStitchedLods 0

terrainCuller.baseCellSize 1000

terrainCuller.cullerType 2

terrainCuller.detailCullMaxLevel 2000

terrainCuller.lod0SwitchStart 2400

terrainCuller.lod0SwitchStop 2400

terrainCuller.lod1SwitchStart 2400

terrainCuller.lod1SwitchStop 2400

terrainCuller.lod2Start 2400

terrainCuller.lodSwitchDistance 2400

terrainCuller.updateLodLevel 2400

i have no idea what to try else :(

Sincetime is precious I try to move to arma 2 I guess. too bad since I was so close to this procedural BF city

Edited by neurall
Link to comment
Share on other sites

You need to split those buildings into multiple pieces (maybe one object per floor).

split? but then those floors not hitting frustum (top floors ?) will be culled again. I don't wana any partof city to dissapear in front of me.

but who knows Iam gona try it. thx for tip man ;)

Link to comment
Share on other sites

Come to think of it... how are you generating those buildings? Are you using the converter you wrote? I'm pretty sure that the bounding radius is defined in the .bundledMesh or .collisionMesh files, so maybe you have this set wrong? I'll try to test it real quick.

EDIT: Didn't find the bounding radius in either files, then I noticed the bounding box coords in your other post. If you are in fact creating those buildings with your own code, I'd check that the bounding box is being scaled along with the box, as BF2 uses this to decide whether or not to render an object.

BTW, the main obstacle in terms of view distance is the skydome; It has a radius of something like 2000m and even if you manage to get rid of it (I forget exactly what I did) anything beyond it's limits will just be black. Not to mention the spatial jitter at distances far from the origin. I really like what you're doing, so if you need any help I'll see what I can do.

Edited by Chael
Link to comment
Share on other sites

Chael thank you man that you are trying to help.

You have no idea how I appreciate it. :D

Well you are right first I need to exclude possibility that there is problem with the meshes i generateor or indeed renderer.

Don't know about radius. dind't found anything like radius in fileformat(v 4 meshes had vector instead of box thou) but there are only bounding boxes(in v 11 one more but the same values). And they seem ok as far as I checked since it's stupid box.

But yes there are still 2 dwords in format that I dont know what they mean(engine seems to ignore them anyway)

Anyway best way to chech if its problem with mesh or renderer is to export boxes of the same size from max wia official plugin and see if the problem with dissapearing persists.

will report back soon.

EDIT:Well I created the same size scyscrappers (boxes) in max

this time with lod0 and lod1 and even textured them but

the problem is still the same.

buildings dissapear right in front of chopper when flying near them

video with max exported meshes with lods

new mod with max exported box meshes

dumping max exported meshes reveals that thay are indeed the same (except useless 3 more uv channels taking space) and also bounding boxes are the same

from this bounding box we see it is 20 m wide and 100m tall

bounding box 2 vectors :

-1.0000000000e+001 0.0000000000e+000 -1.0000000000e+001

1.0000000000e+001 1.0000000000e+002 1.0000000000e+001

= you should have the same problems for simmilar or larger static objects.

my last hope are probably some of these

renderer.distancecullconst

renderer.distancecullconstpco

renderer.minculldistance

renderer.forceskinnedmeshlod

renderer.forcebundledmeshlod

renderer.forcestaticmeshskiplod

renderer.forcestaticmeshmaxpolypercentage

renderer.tweaknearplane

renderer.tweaknearplane1p

renderer.tweakfarplane1p

Edited by neurall
Link to comment
Share on other sites

I decided to test this for myself, but was unable to reproduce the error. I created a box with dimensions 20/100/20, origin at the base of the object, one geom, one lod, triangulated, textured, etc.

I tried running your mod, but there were texture conflicts (tried to find a texture called "a" with no extension). Also, your col meshes had no file extension. IIRC the col mesh (particularly col0) affects rendering in some cases, so this could have something to do with your problem as well; do your skyscrapers have collisions?

It would be helpful if I knew the dimensions of your skyscrapers (both the large and small ones).

EDIT: Just looked through your files a bit (because your skyscrapers don't show up on my end) and noticed you aren't even using collision meshes. Add col meshes and I bet it will solve your problem.

EDIT2: Removed the col mesh from my test box and now I'm getting the error; there's your problem ;)

Edited by Chael
Link to comment
Share on other sites

I decided to test this for myself, but was unable to reproduce the error. I created a box with dimensions 20/100/20, origin at the base of the object, one geom, one lod, triangulated, textured, etc.

I tried running your mod, but there were texture conflicts (tried to find a texture called "a" with no extension). Also, your col meshes had no file extension. IIRC the col mesh (particularly col0) affects rendering in some cases, so this could have something to do with your problem as well; do your skyscrapers have collisions?

It would be helpful if I knew the dimensions of your skyscrapers (both the large and small ones).

wow thats great news. that means that its solvable afterall.

If you manage to create the same size boxes that dont dissapear from chopper that would be fantastic.

here are the dimensions (dumped with mesh tool)

box width 20 height 100

bounding box 2 vectors :

-1.0000000000e+001 0.0000000000e+000 -1.0000000000e+001

1.0000000000e+001 1.0000000000e+002 1.0000000000e+001

box2 width 2 height 10

bounding box 2 vectors :

-1.0000000000e+000 0.0000000000e+000 -1.0000000000e+000

1.0000000000e+000 1.0000000000e+001 1.0000000000e+000

box3 width 20 height 1000

bounding box 2 vectors :

-1.0000000000e+001 0.0000000000e+000 -1.0000000000e+001

1.0000000000e+001 1.0000000000e+003 1.0000000000e+001

Edited by neurall
Link to comment
Share on other sites

^ Check my edits ^

Just add col meshes to your boxes and the problem will disappear.

Chael you are mine hero :D

So arma is on hold now. even thou I just made mesh exporter for arma native mesh format.

But that know how will be of use one time. convertor between arma and bf meshes if there is demand.

suprisingly arma p3d format is very simmilar to staticmesh.

I had no idea cols are used also for culling(althou it does make sense now)

vines meshes from original bf had no cols and were not culled thats what confused me.

now only find out how to place spawnpoints far from each other (50000)and we can make large complex procedural city from suburban areas to scyscrapper center instead of small (4096) patch

Chael you are more experienced than me. Do you have any idea how to solve this ?

http://www.bfeditor.org/forums/index.php?showtopic=15706

Edited by neurall
Link to comment
Share on other sites

I messed with the terrain files a bit, but haven't found a solution yet.

I used to have a map with staticObject terrain that was 8192m X 8192m, but it was deleted with some other data when I reformated (stupid!). I can't remember what I did with the terrain, but the key to it all was setting a large combat area; it gave me some extra space. I'll try to figure out how I did this, but it still has it's limits (probably still loading terrain into memory, but it was scaled up so it should help).

AFAIK it is possible to spawn at spawnpoints outside the combat area via python (pretty sure this happens with our mod). It may be possible to create a hud element that replaces the spawn map with clickable spawn positions outside the combat area. The spawnpoints probably wouldn't work the same (click to spawn as opposed to click, enter, spawn), but it should work.

I guess I should ask: are your spawnpoints red? can you click them, but don't spawn, or are they outside of the visible map?

Another important thing is spatial jitter; if you intend to have objects really far away from the center of the map, they're going to look like crap (usually). I think you might be okay depending on the object, but if not you'll find out what I'm talking about.

BTW it's Chael, not Cael, just sayin' :)

Edited by Chael
Link to comment
Share on other sites

I messed with the terrain files a bit, but haven't found a solution yet.

I used to have a map with staticObject terrain that was 8192m X 8192m, but it was deleted with some other data when I reformated (stupid!). I can't remember what I did with the terrain, but the key to it all was setting a large combat area; it gave me some extra space. I'll try to figure out how I did this, but it still has it's limits (probably still loading terrain into memory, but it was scaled up so it should help).

AFAIK it is possible to spawn at spawnpoints outside the combat area via python (pretty sure this happens with our mod). It may be possible to create a hud element that replaces the spawn map with clickable spawn positions outside the combat area. The spawnpoints probably wouldn't work the same (click to spawn as opposed to click, enter, spawn), but it should work.

I guess I should ask: are your spawnpoints red? can you click them, but don't spawn, or are they outside of the visible map?

Another important thing is spatial jitter; if you intend to have objects really far away from the center of the map, they're going to look like crap (usually). I think you might be okay depending on the object, but if not you'll find out what I'm talking about.

BTW it's Chael, not Cael, just sayin' :)

Thx Chael for looking at this.

Seems like a real problem ;( althou probably solvable with a lot of effort.

I meantime progressed on decoding of collision meshes.

Seems like they are using BSP Axis alligned KD Tree.

new mesh tool v1.4 will dump it decoded.

Generating collision meshes seems more real than ever.

Right now I am able to generate staticmeshes but without collisions.

Anyway thx for trying to solve this far flag distances issue.

I wish I had time to learn bf python to solve this but It seems unevitable anyway.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...