PDA

View Full Version : Increasing camera far distance



lummxx
02-18-2016, 02:12 AM
I have a terrain mesh generated in 3ds Max that is of size 10k by 10k. My problem is that far clipping is just to close and I can not see as far as I would like to. I am trying to implement a fog shader and what i see now is just not OK.

My camera constructor looks like this


Camera::Camera():
cameraPosition_(glm::vec3(-1.0f, 1000.0f, 20.0f)),
cameraLook_(glm::vec3(0.0f, 800.0f, 200.0f)),
lookAt_(glm::lookAt(cameraPosition_,
cameraLook_,
WORLD_YAXIS)),
near_(0.1f),
far_(10000.0f),

projection_(glm::perspective(
70.0f,
4.0f / 3.0f,
near_,
far_)),
name_("Default Camera")
{
}

and the result looks like this (PS I am sorry but i can not upload pictures in the forum for some reasons)

https://www.dropbox.com/s/kzng5wi8a7a0twj/Capture.JPG?dl=0

lummxx
02-18-2016, 11:01 AM
Fixed it, setting my near plane to 1.0 resolved the issue.

The problem was that 0.1f was too low even for double floating point precision number thus limiting my far plane distance.