]> git.mxchange.org Git - flightgear.git/commitdiff
Require /sim/rendering/experimental-lighting to be true before using
authordavid <david>
Tue, 31 Dec 2002 01:15:59 +0000 (01:15 +0000)
committerdavid <david>
Tue, 31 Dec 2002 01:15:59 +0000 (01:15 +0000)
experimental lighting rendering (which is very expensive on my
machine, for example).  To use distance attenuation,
/sim/rendering/distance-attenuation must also be true.

src/Main/main.cxx

index 9c6a6ac11633b6abf96ed9d7f5906641255a8b8f..029a1c74e0aaa3e675196ec9c6cad1e3d0e38a3f 100644 (file)
@@ -738,21 +738,24 @@ void fgRenderFrame() {
        glFogf (GL_FOG_DENSITY, rwy_exp2_punch_through);
         ssgSetNearFar( scene_nearplane, scene_farplane );
 
-        // Enable states for drawing points with GL_extension
-        glEnable(GL_POINT_SMOOTH);
-
-        if ( fgGetBool("/sim/rendering/distance-attenuation")
-            && glutExtensionSupported("GL_EXT_point_parameters") )
-        {
-            float quadratic[3] = {1.0, 0.001, 0.0000001};
-            // makes the points fade as they move away
-            glPointParameterfvEXT(GL_DISTANCE_ATTENUATION_EXT, quadratic);
-            glPointParameterfEXT(GL_POINT_SIZE_MIN_EXT, 1.0); 
-       }
-        glPointSize(4.0);
+        if (fgGetBool("/sim/rendering/experimental-lighting")) {
+
+            // Enable states for drawing points with GL_extension
+            glEnable(GL_POINT_SMOOTH);
+
+            if ( fgGetBool("/sim/rendering/distance-attenuation")
+                 && glutExtensionSupported("GL_EXT_point_parameters") )
+            {
+                float quadratic[3] = {1.0, 0.001, 0.0000001};
+                // makes the points fade as they move away
+                glPointParameterfvEXT(GL_DISTANCE_ATTENUATION_EXT, quadratic);
+                glPointParameterfEXT(GL_POINT_SIZE_MIN_EXT, 1.0); 
+            }
+            glPointSize(4.0);
 
-        // blending function for runway lights
-        glBlendFunc ( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) ;
+            // blending function for runway lights
+            glBlendFunc ( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) ;
+        }
 
         glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
         glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
@@ -785,15 +788,17 @@ void fgRenderFrame() {
        //_frame_count++;
 
 
-        if ( fgGetBool("/sim/rendering/distance-attenuation")
-            && glutExtensionSupported("GL_EXT_point_parameters") )
-        {
-            glPointParameterfvEXT(GL_DISTANCE_ATTENUATION_EXT,
-                                  default_attenuation);
-       }
+        if (fgGetBool("/sim/rendering/experimental-lighting")) {
+            if ( fgGetBool("/sim/rendering/distance-attenuation")
+                 && glutExtensionSupported("GL_EXT_point_parameters") )
+            {
+                glPointParameterfvEXT(GL_DISTANCE_ATTENUATION_EXT,
+                                      default_attenuation);
+            }
 
-        glPointSize(1.0);
-        glDisable(GL_POINT_SMOOTH);
+            glPointSize(1.0);
+            glDisable(GL_POINT_SMOOTH);
+        }
 
         // draw ground lighting
        glFogf (GL_FOG_DENSITY, ground_exp2_punch_through);