CameraClsMode (Zbuffer Clearing)..
Blitz3D Forums/Blitz3D Programming/CameraClsMode (Zbuffer Clearing)..
| ||
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.).. |
| ||
Multiple cameras perhaps? |
| ||
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. :) |
| ||
If you have used EntityOrder it might draw something on top... |
| ||
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. |
| ||
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() |
| ||
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. |
| ||
Ah, feared it might be something like that :/ Oh well, thanks for helping clear that up anyway. |