]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - tools/quake3/q3map2/light.c
allowing to customize how directional the light is
[xonotic/netradiant.git] / tools / quake3 / q3map2 / light.c
index 5b868bc82c3181332152c249e9e99cd10eca5ca1..9f06cfd361e6955e61057dca3b81a58d1b6f7175 100644 (file)
@@ -1455,6 +1455,8 @@ void TraceGrid( int num )
        {
                /* get relative directed strength */
                d = DotProduct( contributions[ i ].dir, gp->dir );
+               /* we map 1 to gridDirectionality, and 0 to gridAmbientDirectionality */
+               d = gridAmbientDirectionality + d * (gridDirectionality - gridAmbientDirectionality);
                if( d < 0.0f )
                        d = 0.0f;
                
@@ -1987,6 +1989,26 @@ int LightMain( int argc, char **argv )
                        gridAmbientScale *= f;
                        i++;
                }
+
+               else if( !strcmp( argv[ i ], "-griddirectionality" ) )
+               {
+                       f = atof( argv[ i + 1 ] );
+                       if(f < 0) f = 0;
+                       if(f > gridAmbientDirectionality) f = gridAmbientDirectionality;
+                       Sys_Printf( "Grid directionality is %f\n", f );
+                       gridDirectionality *= f;
+                       i++;
+               }
+
+               else if( !strcmp( argv[ i ], "-gridambientdirectionality" ) )
+               {
+                       f = atof( argv[ i + 1 ] );
+                       if(f > gridDirectionality) f = gridDirectionality
+                       if(f > 1) f = 1;
+                       Sys_Printf( "Grid ambient directionality is %f\n", f );
+                       gridAmbientDirectionality *= f;
+                       i++;
+               }
                
                else if( !strcmp( argv[ i ], "-gamma" ) )
                {