Game Development Community

Near plane adjustment and Z buff issues

by Valador, Inc. · in Torque Game Engine Advanced · 09/20/2005 (9:53 am) · 2 replies

I know I saw this listed somewhere else, but I was unable to find it.

Currently, TSE hardcodes the nearplane to .1. This happens in the function GameProcessCameraQuery(CameraQuery *query).

This value was way to low for my far clip plane and caused me to loose resolution in the z buffer. Since the buffer is not linear, all of the resolution was very close to the camera. This causes all sorts of strange z fighing issues. The one I wanted to solve was the filckering water on the beach.

I solved it by adding the following line to GameProcessCameraQuery:

query->nearPlane = query->farPlane/1000.0f;

1000 is the number I remember hearing. Not sure if this figure has changed or not but this seemed to work well for me.



Eric P

#1
09/21/2005 (4:52 am)
Ah, this is a good fix. May not make it into TSE (it's kinda of a kludge) but I hope it helps people out. Thanks, Eric!
#2
05/05/2006 (2:19 pm)
Works great, thanks!