]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - r_light.c
coronas now scale with the light radius
[xonotic/darkplaces.git] / r_light.c
index 9ec152afa1975531dc0f2fb4a7cd89dbeb99bedc..5659ef377db717c1e83762b1546beb418b14f49d 100644 (file)
--- a/r_light.c
+++ b/r_light.c
@@ -180,7 +180,7 @@ void R_DrawCoronas(void)
                {
                        // trace to a point just barely closer to the eye
                        VectorSubtract(rd->origin, vpn, diff);
-                       if (TraceLine(r_origin, diff, NULL, NULL, 0) == 1)
+                       if (TraceLine(r_origin, diff, NULL, NULL, 0, true) == 1)
                        {
                                scale = 1.0f / 65536.0f;//64.0f / (dist * dist + 1024.0f);
                                m.cr = rd->light[0] * scale;
@@ -194,7 +194,8 @@ void R_DrawCoronas(void)
                                }
                                // make it larger in the distance to keep a consistent size
                                //scale = 0.4f * dist;
-                               scale = 128.0f;
+                               //scale = 128.0f;
+                               scale = rd->cullradius;
                                tvxyz[0][0] = rd->origin[0] - vright[0] * scale - vup[0] * scale;
                                tvxyz[0][1] = rd->origin[1] - vright[1] * scale - vup[1] * scale;
                                tvxyz[0][2] = rd->origin[2] - vright[2] * scale - vup[2] * scale;
@@ -269,7 +270,7 @@ loc0:
        }
 
 // mark the polygons
-       surf = cl.worldmodel->surfaces + node->firstsurface;
+       surf = currentrenderentity->model->surfaces + node->firstsurface;
        for (i=0 ; i<node->numsurfaces ; i++, surf++)
        {
                int d, impacts, impactt;