commit 8069e8065e48e58ad707dbac1b142cfea223dc35
Author: Leszek Koltunski <leszek@distoretedandroid.org>
Date:   Mon Apr 3 16:46:10 2017 +0100

    Improve Projection.

diff --git a/src/main/java/org/distorted/library/DistortedOutputSurface.java b/src/main/java/org/distorted/library/DistortedOutputSurface.java
index 1339285..5183bd8 100644
--- a/src/main/java/org/distorted/library/DistortedOutputSurface.java
+++ b/src/main/java/org/distorted/library/DistortedOutputSurface.java
@@ -297,8 +297,23 @@ abstract class DistortedOutputSurface extends DistortedSurface implements Distor
  */
   public void setProjection(float fov, float near)
     {
-    if( fov < 180.0f && fov >=0.0f ) mFOV = fov;
-    if( near<   1.0f && near> 0.0f ) mNear= near;
+    if( fov < 180.0f && fov >=0.0f )
+      {
+      mFOV = fov;
+      }
+
+    if( near<   1.0f && near> 0.0f )
+      {
+      mNear= near;
+      }
+    else if( near<=0.0f )
+      {
+      mNear = 0.01f;
+      }
+    else if( near>=1.0f )
+      {
+      mNear=0.99f;
+      }
 
     createProjection();
     }
