]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix a bug that prevented coronas from being rendered for lights with no
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 27 Feb 2010 21:12:40 +0000 (21:12 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 27 Feb 2010 21:12:40 +0000 (21:12 +0000)
diffuse or specular intensity

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10032 d7cf8633-e32d-0410-b094-e92efae38249

r_shadow.c

index b47711144f1845bff441a76804743a8b248ef7f4..67449fc6b4c6fafd6affd86f66c1691282e31cde 100644 (file)
@@ -3485,19 +3485,19 @@ void R_Shadow_PrepareLight(rtlight_t *rtlight)
        static entity_render_t *lightentities_noselfshadow[MAX_EDICTS];
        static entity_render_t *shadowentities[MAX_EDICTS];
        static entity_render_t *shadowentities_noselfshadow[MAX_EDICTS];
+       qboolean nolight;
 
        rtlight->draw = false;
 
        // skip lights that don't light because of ambientscale+diffusescale+specularscale being 0 (corona only lights)
        // skip lights that are basically invisible (color 0 0 0)
-       if (VectorLength2(rtlight->color) * (rtlight->ambientscale + rtlight->diffusescale + rtlight->specularscale) < (1.0f / 1048576.0f))
-               return;
+       nolight = VectorLength2(rtlight->color) * (rtlight->ambientscale + rtlight->diffusescale + rtlight->specularscale) < (1.0f / 1048576.0f);
 
        // loading is done before visibility checks because loading should happen
        // all at once at the start of a level, not when it stalls gameplay.
        // (especially important to benchmarks)
        // compile light
-       if (rtlight->isstatic && (!rtlight->compiled || (rtlight->shadow && rtlight->shadowmode != (int)r_shadow_shadowmode)) && r_shadow_realtime_world_compile.integer)
+       if (rtlight->isstatic && !nolight && (!rtlight->compiled || (rtlight->shadow && rtlight->shadowmode != (int)r_shadow_shadowmode)) && r_shadow_realtime_world_compile.integer)
        {
                if (rtlight->compiled)
                        R_RTLight_Uncompile(rtlight);
@@ -3522,6 +3522,10 @@ void R_Shadow_PrepareLight(rtlight_t *rtlight)
        if (VectorLength2(rtlight->currentcolor) < (1.0f / 1048576.0f))
                return;
 
+       // skip processing on corona-only lights
+       if (nolight)
+               return;
+
        // if the light box is offscreen, skip it
        if (R_CullBox(rtlight->cullmins, rtlight->cullmaxs))
                return;