Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Camera Cutting Into Objects Close To Camera

Author
Message
ReiKumar
16
Years of Service
User Offline
Joined: 23rd Sep 2008
Location:
Posted: 1st Oct 2008 22:57
What can I do to stop the camera from cutting into objects that are close to it?

A code snippet would be nice.

P.S. If you post, please check back in case I have a question.
SushiBox
16
Years of Service
User Offline
Joined: 20th Sep 2008
Location: Ohio
Posted: 1st Oct 2008 23:12
This here sets the near and far distance that your camera is able to see. Be careful though, the more you can see in frame = lower FPS. There are two usages, one is for setting the range for a specific camera. The other is for just one.



I found this right in the docs, there are also many threads about this. If you use the search, you could save a lot of time waiting for a response. If all else fails, try experimenting.

www.Helios-Online.net
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 2nd Oct 2008 00:19
Just don't do the 'obvious thing' and reduce the near range to zero - that breaks the equations (it does that for all other rendering libraries too).

Try and keep the ratio of near:far below 1:5000, or you'll have problems with the Z buffer at the higher distances, i.e. you'll get objects displaying in the wrong order. The higher the ratio, the worse it will get.

ReiKumar
16
Years of Service
User Offline
Joined: 23rd Sep 2008
Location:
Posted: 2nd Oct 2008 06:21
I tried changing the settings but I ended up deleting everything on the screen and making everything blue.
AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 2nd Oct 2008 13:03
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 2nd Oct 2008 22:43
- Anything nearer to the camera than your near range will not be drawn.
- Anything further from the camera than your far range will not be drawn.

You did one or both of the above.

ReiKumar
16
Years of Service
User Offline
Joined: 23rd Sep 2008
Location:
Posted: 3rd Oct 2008 00:04
Thanks I got it to work.
Just had to set the right values.

I did end up having to make the near value 0.001 and the far value 5000.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 3rd Oct 2008 00:50
That's a ratio of 1:5000000 - watch out for z-fighting at higher distances.

ReiKumar
16
Years of Service
User Offline
Joined: 23rd Sep 2008
Location:
Posted: 3rd Oct 2008 02:12
Quote: "That's a ratio of 1:5000000 - watch out for z-fighting at higher distances."


Z-Fighting?
Niels Henriksen
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 3rd Oct 2008 02:28
http://en.wikipedia.org/wiki/Z-fighting (first link on Google when searching for z-fighting)

Niels Henriksen
www.tales-of-the-realms.com
if Microsoft can sell software with bugs, so can I.
sydbod
16
Years of Service
User Offline
Joined: 14th Jun 2008
Location: Just look at the picture
Posted: 3rd Oct 2008 05:34
I have also had good results with
0.2 to 300000 with units as representing meters.

Here are some numbers:
Required 0.2 meters so I could see the interior of the cockpit properly.
Required 300000 so that the pilot had a realistic clear air view distance of 300KM.

ratio of 1500000

With a 1024x1024 terrain that is magnified by x1000, it gives a land area of 1000KMx1000KM and with the pilot view distance of 300KM, it gives an aircraft combat area of 400KMx400KM in the middle.

A wider Z range than that causes my mountain terrain for my flight sim to have terrain breakup.

Maybe the above numbers may be of some value to others.
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 4th Oct 2008 01:06
That's troublesome for me.

I have a space game... and it's also an FPS.

What that means for me? Bad stuff. D:

I need to have the near range really low, to see the gun or whatever... but still far enough that you can see the sun from a planet!

Login to post a reply

Server time is: 2024-09-30 07:29:37
Your offset time is: 2024-09-30 07:29:37