]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_rmain.c
skel_build: normalize the per-bone matrices
[xonotic/darkplaces.git] / gl_rmain.c
index 9499f16c8611554e532c5a09f40c1e1b87a71ede..a242ce912ff7c90085806175cfc28146a7fdef61 100644 (file)
@@ -120,6 +120,7 @@ cvar_t r_shadows_drawafterrtlighting = {CVAR_SAVE, "r_shadows_drawafterrtlightin
 cvar_t r_shadows_castfrombmodels = {CVAR_SAVE, "r_shadows_castfrombmodels", "0", "do cast shadows from bmodels"};
 cvar_t r_shadows_focus = {CVAR_SAVE, "r_shadows_focus", "0 0 0", "offset the shadowed area focus"};
 cvar_t r_shadows_shadowmapscale = {CVAR_SAVE, "r_shadows_shadowmapscale", "1", "increases shadowmap quality (multiply global shadowmap precision) for fake shadows. Needs shadowmapping ON."};
+cvar_t r_shadows_shadowmapbias = {CVAR_SAVE, "r_shadows_shadowmapbias", "-1", "sets shadowmap bias for fake shadows. -1 sets the value of r_shadow_shadowmapping_bias. Needs shadowmapping ON."};
 cvar_t r_q1bsp_skymasking = {0, "r_q1bsp_skymasking", "1", "allows sky polygons in quake1 maps to obscure other geometry"};
 cvar_t r_polygonoffset_submodel_factor = {0, "r_polygonoffset_submodel_factor", "0", "biases depth values of world submodels such as doors, to prevent z-fighting artifacts in Quake maps"};
 cvar_t r_polygonoffset_submodel_offset = {0, "r_polygonoffset_submodel_offset", "14", "biases depth values of world submodels such as doors, to prevent z-fighting artifacts in Quake maps"};
@@ -220,7 +221,7 @@ cvar_t r_smoothnormals_areaweighting = {0, "r_smoothnormals_areaweighting", "1",
 
 cvar_t developer_texturelogging = {0, "developer_texturelogging", "0", "produces a textures.log file containing names of skins and map textures the engine tried to load"};
 
-cvar_t gl_lightmaps = {0, "gl_lightmaps", "0", "draws only lightmaps, no texture (for level designers)"};
+cvar_t gl_lightmaps = {0, "gl_lightmaps", "0", "draws only lightmaps, no texture (for level designers), a value of 2 keeps normalmap shading"};
 
 cvar_t r_test = {0, "r_test", "0", "internal development use only, leave it alone (usually does nothing anyway)"};
 
@@ -4230,6 +4231,7 @@ void GL_Main_Init(void)
        Cvar_RegisterVariable(&r_shadows_throwdirection);
        Cvar_RegisterVariable(&r_shadows_focus);
        Cvar_RegisterVariable(&r_shadows_shadowmapscale);
+       Cvar_RegisterVariable(&r_shadows_shadowmapbias);
        Cvar_RegisterVariable(&r_q1bsp_skymasking);
        Cvar_RegisterVariable(&r_polygonoffset_submodel_factor);
        Cvar_RegisterVariable(&r_polygonoffset_submodel_offset);
@@ -6380,6 +6382,8 @@ static void R_BlendView(int fbo, rtexture_t *depthtexture, rtexture_t *colortext
        unsigned int permutation;
        float uservecs[4][4];
 
+       R_EntityMatrix(&identitymatrix);
+
        switch (vid.renderpath)
        {
        case RENDERPATH_GL20:
@@ -7972,13 +7976,15 @@ texture_t *R_GetCurrentTexture(texture_t *t)
                t->basetexture = r_texture_grey128;
                t->pantstexture = r_texture_black;
                t->shirttexture = r_texture_black;
-               t->nmaptexture = r_texture_blanknormalmap;
+               if (gl_lightmaps.integer < 2)
+                       t->nmaptexture = r_texture_blanknormalmap;
                t->glosstexture = r_texture_black;
                t->glowtexture = NULL;
                t->fogtexture = NULL;
                t->reflectmasktexture = NULL;
                t->backgroundbasetexture = NULL;
-               t->backgroundnmaptexture = r_texture_blanknormalmap;
+               if (gl_lightmaps.integer < 2)
+                       t->backgroundnmaptexture = r_texture_blanknormalmap;
                t->backgroundglosstexture = r_texture_black;
                t->backgroundglowtexture = NULL;
                t->specularscale = 0;