]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
UNMERGE
authorhavoc havoc@d7cf8633-e32d-0410-b094-e92efae38249 <>
Sun, 9 May 2010 00:13:51 +0000 (00:13 +0000)
committerRudolf Polzer <divverent@alientrap.org>
Fri, 24 Sep 2010 20:02:13 +0000 (22:02 +0200)
fix a stencil shadowvolume bug with models that use dynamic batches

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10177 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::unmerge=dfd1c391f1e669db38ae21e776707c0ec791b7e2

gl_rsurf.c

index bd084c162aba448d2def27aadf258cc24435e1a4..615119baf09c8db359bd2db01c2849d58ad3ddbb 100644 (file)
@@ -1084,9 +1084,10 @@ void R_Q1BSP_DrawShadowVolume(entity_render_t *ent, const vec3_t relativelightor
                        rsurface.texture = R_GetCurrentTexture(surface->texture);
                        if (rsurface.texture->currentmaterialflags & MATERIALFLAG_NOSHADOW)
                                continue;
-                       R_Shadow_MarkVolumeFromBox(surface->num_firsttriangle, surface->num_triangles, rsurface.modelvertex3f, rsurface.modelelement3i, relativelightorigin, relativelightdirection, lightmins, lightmaxs, surface->mins, surface->maxs);
+                       RSurf_PrepareVerticesForBatch(BATCHNEED_ARRAY_VERTEX, 1, &surface);
+                       R_Shadow_MarkVolumeFromBox(surface->num_firsttriangle, surface->num_triangles, rsurface.batchvertex3f, rsurface.modelelement3i, relativelightorigin, relativelightdirection, lightmins, lightmaxs, surface->mins, surface->maxs);
                }
-               R_Shadow_VolumeFromList(model->surfmesh.num_vertices, model->surfmesh.num_triangles, rsurface.modelvertex3f, model->surfmesh.data_element3i, model->surfmesh.data_neighbor3i, relativelightorigin, relativelightdirection, projectdistance, numshadowmark, shadowmarklist, ent->mins, ent->maxs);
+               R_Shadow_VolumeFromList(model->surfmesh.num_vertices, model->surfmesh.num_triangles, rsurface.batchvertex3f, model->surfmesh.data_element3i, model->surfmesh.data_neighbor3i, relativelightorigin, relativelightdirection, projectdistance, numshadowmark, shadowmarklist, ent->mins, ent->maxs);
        }
        if (ent->model->brush.submodel)
                GL_PolygonOffset(r_refdef.shadowpolygonfactor, r_refdef.shadowpolygonoffset);