]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_rsurf.c
added r_smoothnormals_areaweighting cvar (default 1, suggested by Black as a better...
[xonotic/darkplaces.git] / gl_rsurf.c
index 664f70e600ab0ec5073753f51f4219a5aae081f1..898da1fbffc9acf85e73007a77a6fb5b68405f3e 100644 (file)
@@ -711,7 +711,7 @@ void R_Q1BSP_DrawShadowVolume(entity_render_t *ent, vec3_t relativelightorigin,
        }
        else
        {
-               projectdistance = lightradius + ent->model->radius;
+               projectdistance = lightradius + ent->model->radius*2;
                Matrix4x4_Transform(&ent->inversematrix, r_vieworigin, modelorg);
                for (surfacelistindex = 0;surfacelistindex < numsurfaces;surfacelistindex++)
                {
@@ -785,14 +785,14 @@ void R_Q1BSP_DrawLight(entity_render_t *ent, float *lightcolor, int numsurfaces,
                                rsurface_svector3f = varray_svector3f;
                                rsurface_tvector3f = varray_tvector3f;
                                rsurface_normal3f = varray_normal3f;
-                               Mod_BuildTextureVectorsAndNormals(surface->num_firstvertex, surface->num_vertices, surface->num_triangles, rsurface_vertex3f, surface->groupmesh->data_texcoordtexture2f, surface->groupmesh->data_element3i + surface->num_firsttriangle * 3, rsurface_svector3f, rsurface_tvector3f, rsurface_normal3f);
+                               Mod_BuildTextureVectorsAndNormals(surface->num_firstvertex, surface->num_vertices, surface->num_triangles, rsurface_vertex3f, surface->groupmesh->data_texcoordtexture2f, surface->groupmesh->data_element3i + surface->num_firsttriangle * 3, rsurface_svector3f, rsurface_tvector3f, rsurface_normal3f, r_smoothnormals_areaweighting.integer);
                        }
                        if (ent->colormap >= 0)
                        {
                                vec3_t lightcolorpants, lightcolorshirt;
                                // 128-224 are backwards ranges
                                int b = (ent->colormap & 0xF) << 4;b += (b >= 128 && b < 224) ? 4 : 12;
-                               if (texture->skin.pants && b >= 224)
+                               if (texture->skin.pants && b < 224)
                                {
                                        qbyte *bcolor = (qbyte *) (&palette_complete[b]);
                                        lightcolorpants[0] = lightcolor[0] * bcolor[0] * (1.0f / 255.0f);
@@ -803,7 +803,7 @@ void R_Q1BSP_DrawLight(entity_render_t *ent, float *lightcolor, int numsurfaces,
                                        VectorClear(lightcolorpants);
                                // 128-224 are backwards ranges
                                b = (ent->colormap & 0xF0);b += (b >= 128 && b < 224) ? 4 : 12;
-                               if (texture->skin.shirt && b >= 224)
+                               if (texture->skin.shirt && b < 224)
                                {
                                        qbyte *bcolor = (qbyte *) (&palette_complete[b]);
                                        lightcolorshirt[0] = lightcolor[0] * bcolor[0] * (1.0f / 255.0f);