Big polys and problems with the Camera

Blitz3D Forums/Blitz3D Programming/Big polys and problems with the Camera

PaulJG(Posted 2003) [#1]
My game involves a really close up camera with huge towering objects. Problem is as the camera is so close its cutting off polys that arent fully drawn. (before the camera and past it)

Bit hard to explain.. But onscreen I've got objects that are half off and half on (past the camera) - so some of the polys just arent been drawn ?.

I could move the camera out a bit, but then I lose the viewpoint I need.

Any advice please ?.


Koriolis(Posted 2003) [#2]
See the CameraRange command. It will let you set the near and far clipping distances. Lower the near clipping distance, and you'll get what you want.


PaulJG(Posted 2003) [#3]
Thanks.


yinch(Posted 2003) [#4]
Just a small note to say that setting a lower near value can 'dilute' the accuracy of the z-buffer for objects farther away.

If you arent having any problems with that then just ignore this.

y'03


jhocking(Posted 2003) [#5]
No, don't just ignore it. A REALLY common problem with stuff developed in Blitz3D is improperly set CameraRange. This problem isn't noticed by many people because of their newer hardware. But on older hardware which has a coarser z-buffer (eg. mine) there are horrible z-fighting visual artifacts.

If you change the near clipping distance (actually, even if you don't since you need to set the far clipping distance correctly) you should adjust the far clipping distance so that it is pretty much exactly how far you want the camera to render. In other words any closer is too close. Anything beyond the distance you need/want is just a waste of z-buffer accuracy.


Robert(Posted 2003) [#6]
When you say "coarser" Z-Buffer, do you mean that newer chips have a higher floating point accuracy? Or do Z-Buffers work differently (sorry - I'm fairly new to Blitz).


Anthony Flack(Posted 2003) [#7]

When you say "coarser" Z-Buffer, do you mean that newer chips have a higher floating point accuracy?



Yup. you got your 32 bit z-buffers, and then you got your 16 bit z-buffers.


Koriolis(Posted 2003) [#8]
Just a small note to say that setting a lower near value can 'dilute' the accuracy of the z-buffer for objects farther away.
Perfectly true. But it only depends on the near diestance/far distance ratio, so if you divide your near distance by ten to resolve the clipping problem, just also divide the far distance by ten and you'll have the exact same accuracy with your depth buffer.


mrtricks(Posted 2003) [#9]
Another post mentions that the near:far ratio always needs to be 1:10000. I was having horrible graphical glitches and since I took that ratio on board, they all went away.


ashmantle(Posted 2003) [#10]
so a ratio of 0,01:100 is also acceptable?


Shambler(Posted 2003) [#11]
The best idea is to run your game in a 16 bit mode and see what Z buffer artifacts you get then adjust the CameraRange accordingly.


MadJack(Posted 2003) [#12]
it's probably also not a good idea to have huge single polys either - perhaps split them

and if your cam has a collision radius or a parent with collision radius, perhaps increase that radius so the camera can't get quite so close to a polygon?


DrakeX(Posted 2003) [#13]
"so a ratio of 0,01:100 is also acceptable?"

i guess it would be, because ratios are usually simplified, so 0.01:100 would be 1:10000.