Everything clipped after a while. my.eflags&CLIPPED gets set

Posted By: BoH_Havoc

Everything clipped after a while. my.eflags&CLIPPED gets set - 04/12/13 12:03

Hi,

we have a strange problem in our game. After a while, EVERYTHING (except skyboxes) is being clipped away. We checked for my.eflags&CLIPPED and can confirm that this flag is set when the bug occurs. Also when looking in a specific direction, the clipped entities will reappear, but only as long as you look in said specific direction.

Any ideas whats going on here?
Posted By: rojart

Re: Everything clipped after a while. my.eflags&CLIPPED gets set - 04/12/13 20:04

Hi,

sometimes I use clipfactor higher than the default, maybe this will help.

Code:
my.clipfactor = 999999; // never clip this entity


Posted By: BoH_Havoc

Re: Everything clipped after a while. my.eflags&CLIPPED gets set - 04/13/13 18:05

Well, we absolutely need clipping as the game might run way too slow on low end PCs if we don't use it. So setting clipfactor to a higher value won't be an option for us i guess.
Also, everything runs fine at first. It's only after some time that the whole scene gets clipped away.

As far as i know, only the main camera can change eflag&CLIPPED . Or are there any other ways to change that flag? Maybe we are doing something wrong by accident and turn on clipping for the whole scene because of a bug in our code...?
Posted By: rojart

Re: Everything clipped after a while. my.eflags&CLIPPED gets set - 04/13/13 18:35

I had the same problem with my ragdoll example some time ago.
I noticed, when the camera was moved outside the global axis center XYZ=0, my ragdoll was clipped, therfore I used clipfactor.
Posted By: Superku

Re: Everything clipped after a while. my.eflags&CLIPPED gets set - 04/13/13 19:22

Quote:
Maybe we are doing something wrong by accident and turn on clipping for the whole scene because of a bug in our code...?

I think this sadly is the reason for your problem, i.e. you overwrite some memory or something like that. Every now and then there is a "bug" or small problem where a terrain or an object gets clipped too early, but not the whole scene and esp. only after quite some time.
I would ask myself some questions such as when did the problem appear the first time (/ was noticed the first time), what did you implement or change in the recent time and open some old versions (that you hopefully have) and observe if the problem appears there, too.
Posted By: BoH_Havoc

Re: Everything clipped after a while. my.eflags&CLIPPED gets set - 04/14/13 10:48

Quote:
I had the same problem with my ragdoll example some time ago.


Were you using Shade-C in that example by an chance? If so, that would helps us in narrowing down the error source. If you were using Shade-C, could you try removing it from the example and see if the bug still appears?

Quote:
i.e. you overwrite some memory or something like that


That's an option we also thought about but as there's lots and lots of code to go through we hoped there might be another (simpler) reason for this behaviour. Oh well... frown

Oh and happy birthday! laugh
Posted By: rojart

Re: Everything clipped after a while. my.eflags&CLIPPED gets set - 04/14/13 14:15

As I remember was without Shade-C.

I tested with the last beta 8.42.0, but I can't reproduce the issue any more, maybe was fixed.

ps
Happy Birthday Superku!
Posted By: sivan

Re: Everything clipped after a while. my.eflags&CLIPPED gets set - 04/14/13 17:55

last week, my shade-c 0.90 water disappeared when I moved camera to its edge, depending on camera angle (tile<45), but only in my editor where I used only water related things (everything else removed), and only in case of one level, when normal-map was the 1st skin. when I put there a texture and used bmap_to_normals, and 2nd and 3rd skins were added also by script, it was fine. I don't really understand it, but I hope it might help a bit...
Posted By: Superku

Re: Everything clipped after a while. my.eflags&CLIPPED gets set - 04/14/13 21:40

Thanks guys!

Havoc, have you tried to run an old(er) version yet?
Posted By: Germanunkol

Re: Everything clipped after a while. my.eflags&CLIPPED gets set - 04/30/13 17:00

I really dislike the way we're having to debug this. Why is it always so much trial and error?
There's an eflag being set... why can't we work backwards from there? What functions can set eflags? And why?
Is there any material callback or return that will set the eflag for an entity?

Wolfgang, do you have time on Wednesday?
Then we could give it a test run with all clipping disabled.
© 2024 lite-C Forums