complete terrain ent clipping away

Posted By: Wjbender

complete terrain ent clipping away - 12/08/14 14:00

I have 2 terrain entities created , each is 128 by 128 vertices with 256 size for each terrain cell .

the first terrain is centered at 0,0,0 .
the second terrain is centered at 0,0+first_terrain.max_y*2,0

both use the same material and textures/skins .

the second terrain is wholly clipped away at certain angles by the engine , even when I am directly on top of it ,while the first terrain remains visible .

why would my second terrain clip away completely even though my camera is right on top or near it ?

Thanks.

jb
Posted By: sivan

Re: complete terrain ent clipping away - 12/08/14 14:46

I think it is a level_ent size problem, when camera goes out of it terrain is clipped. I had something similar problem earlier.... you can set its min_x and max_x vectors manually.
Posted By: Wjbender

Re: complete terrain ent clipping away - 12/08/14 14:56

I tried setting level_ent min and max to -90000 and 90000 , before , but it still happens at certain camera angles ,no matter where the camera is positioned ,it clips away at pan 19 and pan 157 also tilt -40 ..

edit : got it , added a wait (1) after each terrain was modified
Posted By: sivan

Re: complete terrain ent clipping away - 12/08/14 21:02

wait(1) is our best friend grin (I laughed on last AUM interview, when read that if something does not work add some random waits grin it is so true)
Posted By: FEL

Re: complete terrain ent clipping away - 12/08/14 21:04

Its a little bit sad... I mean programming is ment to not understand the code but it actually works somehow...
Posted By: Wjbender

Re: complete terrain ent clipping away - 12/08/14 21:25

this one is on me , I sequenced 2 terrain's modifications within one frame , jcl said it needs a frame to update so makes sense to wait a frame for each terrain piece to do it's updates , what is difficult however is to actually figure out that some bizarre behaviour is the result of a needed wait ,not something you would always expect .

I had a smile when i started noticing that somehow what I read in aum became true in a creepy way ,in most cases the wait seems to do magical unexplainable repairs ,for instance take my recent bug report where a wait somehow made something work wich aren't suppose to work ,and turned out to not even be a frame wait problem ,but by Jupiter how it read my mind I don't know !

the wait seems to have a much bigger importance than one would expect ,there seems to be a lot linked to what happens after one frame under the correct circumstances .

the "make game" or "fix game" button must be titled "wait"


© 2024 lite-C Forums