CameraClsMode (Zbuffer Clearing)..

Blitz3D Forums/Blitz3D Programming/CameraClsMode (Zbuffer Clearing)..

AntonyWells(Posted 2004) [#1]
Is it just my imagination or has cameraClsMode stopped working? (I'm refering to Zbuffer clearing)

Now it doesn't matter what I render to the screen, even when I turn off zbuffer clearing, it still renders geo that is beyond the previous renders depth.(I.e shouldn't be rendered.)..


fredborg(Posted 2004) [#2]
Multiple cameras perhaps?


AntonyWells(Posted 2004) [#3]
Nope. Have been going through the source for the last couple of hours, definitely not working...

Can someone else throw together a quick test and see if it runs on their set up? And if so, post the source here so I can confirm one way or the other if I'm just making some idiotic mistake somewhere. :)


fredborg(Posted 2004) [#4]
If you have used EntityOrder it might draw something on top...


AntonyWells(Posted 2004) [#5]
Only on the gun, but I just did some tests and it is working, under normal conditions. But something about what I'm doing doesn't agree with it to well,

What I want to do is, render from 2 to 1000.

But just using camera Range once isn't good enough, because then you get polys showing up that shouldn't be visible..
so I want to render from 0.01 to 2, then clear, and disable zbuffer, then render from 2 to 1000. In theory it should render from 2 to 1000 but not pixels that fall behind the non-cleared zbuffer. In theory, but not in practise, because as soon as geo gets closer than 2 units to the camera, it pops out of existence as it should(As I cls between renders)
it also stops obscuring geo behind it, even though the zbuffer is not cleared.

grr.


AntonyWells(Posted 2004) [#6]
To be clearer, i'm doing this,

     cameraClsMode vCam,true,true 
     cameraRange vCam,0.01,2
     renderWorld()
     cameraClsMode vCam,true,false;disable zbuffer clearing
     cameraRange vCam,2,1000
     renderWorld()



fredborg(Posted 2004) [#7]
Changing the CameraRange between renders changes the precision of the ZBuffer, as the 16 or 32 bits used for it are scaled differently depending on the range of the camera.

You should keep the range the same, and use HideEntity + ShowEntity instead.


AntonyWells(Posted 2004) [#8]
Ah, feared it might be something like that :/

Oh well, thanks for helping clear that up anyway.