Browse files

Angular camera: fixed wrong renders due to incorrect default clipping

As stated in there was a problem in the Angula Camera rendering. In many cases, the background was shown instead of the surrounding objects.
I've found the problem in the default clipping plane calculation for the camera, when no clipping is supposed to happen. By default, the far clipping distance is set to -1.f, which normally allows rays to travel without clipping as they are not supposed to go behind the camera.
However for angular cameras, rays can actually go behind the camera when using wide angles. In those cases, the rays were incorrectly clipped at a distance of 1.f units behind the camera position.
So, I've set a new default far clipping distance for the angular camera, using a very high negative value. I hope this will allow all rays (in front and behind the camera) to travel without clipping.
  • Loading branch information...
1 parent db6261d commit e22bffc775e995e7e5e830eb8cb8d71a43359d25 @DavidBluecame DavidBluecame committed Dec 16, 2016
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/cameras/
@@ -75,7 +75,7 @@ camera_t* angularCam_t::factory(paraMap_t &params, renderEnvironment_t &render)
int resx=320, resy=200;
double aspect=1.0, angle=90, max_angle=90;
bool circular = true, mirrored = false;
- float nearClip = 0.0f, farClip = -1.0f;
+ float nearClip = 0.0f, farClip = -1.0e38f;
std::string viewName = "";
params.getParam("from", from);

0 comments on commit e22bffc

Please sign in to comment.