- dp_model_t *model = r_refdef.scene.worldmodel;
- //if (rsurface.entity == r_refdef.scene.worldentity)
- // return;
- rsurface.entity = r_refdef.scene.worldentity;
- rsurface.skeleton = NULL;
- memset(rsurface.userwavefunc_param, 0, sizeof(rsurface.userwavefunc_param));
- rsurface.ent_skinnum = 0;
- rsurface.ent_qwskin = -1;
- rsurface.ent_flags = r_refdef.scene.worldentity->flags;
- rsurface.shadertime = r_refdef.scene.time;
- rsurface.matrix = identitymatrix;
- rsurface.inversematrix = identitymatrix;
- rsurface.matrixscale = 1;
- rsurface.inversematrixscale = 1;
- R_EntityMatrix(&identitymatrix);
- VectorCopy(r_refdef.view.origin, rsurface.localvieworigin);
- Vector4Copy(r_refdef.fogplane, rsurface.fogplane);
- rsurface.fograngerecip = r_refdef.fograngerecip;
- rsurface.fogheightfade = r_refdef.fogheightfade;
- rsurface.fogplaneviewdist = r_refdef.fogplaneviewdist;
- rsurface.fogmasktabledistmultiplier = FOGMASKTABLEWIDTH * rsurface.fograngerecip;
- VectorSet(rsurface.modellight_ambient, 0, 0, 0);
- VectorSet(rsurface.modellight_diffuse, 0, 0, 0);
- VectorSet(rsurface.modellight_lightdir, 0, 0, 1);
- VectorSet(rsurface.colormap_pantscolor, 0, 0, 0);
- VectorSet(rsurface.colormap_shirtcolor, 0, 0, 0);
- VectorSet(rsurface.colormod, r_refdef.view.colorscale, r_refdef.view.colorscale, r_refdef.view.colorscale);
- rsurface.colormod[3] = 1;
- VectorSet(rsurface.glowmod, r_refdef.view.colorscale * r_hdr_glowintensity.value, r_refdef.view.colorscale * r_hdr_glowintensity.value, r_refdef.view.colorscale * r_hdr_glowintensity.value);
- memset(rsurface.frameblend, 0, sizeof(rsurface.frameblend));
- rsurface.frameblend[0].lerp = 1;
- rsurface.ent_alttextures = false;
- rsurface.basepolygonfactor = r_refdef.polygonfactor;
- rsurface.basepolygonoffset = r_refdef.polygonoffset;
- rsurface.entityskeletaltransform3x4 = NULL;
- rsurface.entityskeletaltransform3x4buffer = NULL;
- rsurface.entityskeletaltransform3x4offset = 0;
- rsurface.entityskeletaltransform3x4size = 0;;
- rsurface.entityskeletalnumtransforms = 0;
- rsurface.modelvertex3f = model->surfmesh.data_vertex3f;
- rsurface.modelvertex3f_vertexbuffer = model->surfmesh.vbo_vertexbuffer;
- rsurface.modelvertex3f_bufferoffset = model->surfmesh.vbooffset_vertex3f;
- rsurface.modelsvector3f = model->surfmesh.data_svector3f;
- rsurface.modelsvector3f_vertexbuffer = model->surfmesh.vbo_vertexbuffer;
- rsurface.modelsvector3f_bufferoffset = model->surfmesh.vbooffset_svector3f;
- rsurface.modeltvector3f = model->surfmesh.data_tvector3f;
- rsurface.modeltvector3f_vertexbuffer = model->surfmesh.vbo_vertexbuffer;
- rsurface.modeltvector3f_bufferoffset = model->surfmesh.vbooffset_tvector3f;
- rsurface.modelnormal3f = model->surfmesh.data_normal3f;
- rsurface.modelnormal3f_vertexbuffer = model->surfmesh.vbo_vertexbuffer;
- rsurface.modelnormal3f_bufferoffset = model->surfmesh.vbooffset_normal3f;
- rsurface.modellightmapcolor4f = model->surfmesh.data_lightmapcolor4f;
- rsurface.modellightmapcolor4f_vertexbuffer = model->surfmesh.vbo_vertexbuffer;
- rsurface.modellightmapcolor4f_bufferoffset = model->surfmesh.vbooffset_lightmapcolor4f;
- rsurface.modeltexcoordtexture2f = model->surfmesh.data_texcoordtexture2f;
- rsurface.modeltexcoordtexture2f_vertexbuffer = model->surfmesh.vbo_vertexbuffer;
- rsurface.modeltexcoordtexture2f_bufferoffset = model->surfmesh.vbooffset_texcoordtexture2f;
- rsurface.modeltexcoordlightmap2f = model->surfmesh.data_texcoordlightmap2f;
- rsurface.modeltexcoordlightmap2f_vertexbuffer = model->surfmesh.vbo_vertexbuffer;
- rsurface.modeltexcoordlightmap2f_bufferoffset = model->surfmesh.vbooffset_texcoordlightmap2f;
- rsurface.modelskeletalindex4ub = model->surfmesh.data_skeletalindex4ub;
- rsurface.modelskeletalindex4ub_vertexbuffer = model->surfmesh.vbo_vertexbuffer;
- rsurface.modelskeletalindex4ub_bufferoffset = model->surfmesh.vbooffset_skeletalindex4ub;
- rsurface.modelskeletalweight4ub = model->surfmesh.data_skeletalweight4ub;
- rsurface.modelskeletalweight4ub_vertexbuffer = model->surfmesh.vbo_vertexbuffer;
- rsurface.modelskeletalweight4ub_bufferoffset = model->surfmesh.vbooffset_skeletalweight4ub;
- rsurface.modelelement3i = model->surfmesh.data_element3i;
- rsurface.modelelement3i_indexbuffer = model->surfmesh.data_element3i_indexbuffer;
- rsurface.modelelement3i_bufferoffset = model->surfmesh.data_element3i_bufferoffset;
- rsurface.modelelement3s = model->surfmesh.data_element3s;
- rsurface.modelelement3s_indexbuffer = model->surfmesh.data_element3s_indexbuffer;
- rsurface.modelelement3s_bufferoffset = model->surfmesh.data_element3s_bufferoffset;
- rsurface.modellightmapoffsets = model->surfmesh.data_lightmapoffsets;
- rsurface.modelnumvertices = model->surfmesh.num_vertices;
- rsurface.modelnumtriangles = model->surfmesh.num_triangles;
- rsurface.modelsurfaces = model->data_surfaces;
- rsurface.modelvertexmesh = model->surfmesh.data_vertexmesh;
- rsurface.modelvertexmesh_vertexbuffer = model->surfmesh.vbo_vertexbuffer;
- rsurface.modelvertexmesh_bufferoffset = model->surfmesh.vbooffset_vertex3f;
- rsurface.modelgeneratedvertex = false;
- rsurface.batchgeneratedvertex = false;
- rsurface.batchfirstvertex = 0;
- rsurface.batchnumvertices = 0;
- rsurface.batchfirsttriangle = 0;
- rsurface.batchnumtriangles = 0;
- rsurface.batchvertex3f = NULL;
- rsurface.batchvertex3f_vertexbuffer = NULL;
- rsurface.batchvertex3f_bufferoffset = 0;
- rsurface.batchsvector3f = NULL;
- rsurface.batchsvector3f_vertexbuffer = NULL;
- rsurface.batchsvector3f_bufferoffset = 0;
- rsurface.batchtvector3f = NULL;
- rsurface.batchtvector3f_vertexbuffer = NULL;
- rsurface.batchtvector3f_bufferoffset = 0;
- rsurface.batchnormal3f = NULL;
- rsurface.batchnormal3f_vertexbuffer = NULL;
- rsurface.batchnormal3f_bufferoffset = 0;
- rsurface.batchlightmapcolor4f = NULL;
- rsurface.batchlightmapcolor4f_vertexbuffer = NULL;
- rsurface.batchlightmapcolor4f_bufferoffset = 0;
- rsurface.batchtexcoordtexture2f = NULL;
- rsurface.batchtexcoordtexture2f_vertexbuffer = NULL;
- rsurface.batchtexcoordtexture2f_bufferoffset = 0;
- rsurface.batchtexcoordlightmap2f = NULL;
- rsurface.batchtexcoordlightmap2f_vertexbuffer = NULL;
- rsurface.batchtexcoordlightmap2f_bufferoffset = 0;
- rsurface.batchskeletalindex4ub = NULL;
- rsurface.batchskeletalindex4ub_vertexbuffer = NULL;
- rsurface.batchskeletalindex4ub_bufferoffset = 0;
- rsurface.batchskeletalweight4ub = NULL;
- rsurface.batchskeletalweight4ub_vertexbuffer = NULL;
- rsurface.batchskeletalweight4ub_bufferoffset = 0;
- rsurface.batchvertexmesh = NULL;
- rsurface.batchvertexmesh_vertexbuffer = NULL;
- rsurface.batchvertexmesh_bufferoffset = 0;
- rsurface.batchelement3i = NULL;
- rsurface.batchelement3i_indexbuffer = NULL;
- rsurface.batchelement3i_bufferoffset = 0;
- rsurface.batchelement3s = NULL;
- rsurface.batchelement3s_indexbuffer = NULL;
- rsurface.batchelement3s_bufferoffset = 0;
- rsurface.passcolor4f = NULL;
- rsurface.passcolor4f_vertexbuffer = NULL;
- rsurface.passcolor4f_bufferoffset = 0;
- rsurface.forcecurrenttextureupdate = false;
-}
-
-void RSurf_ActiveModelEntity(const entity_render_t *ent, qboolean wantnormals, qboolean wanttangents, qboolean prepass)
-{
- dp_model_t *model = ent->model;
- //if (rsurface.entity == ent && (!model->surfmesh.isanimated || (!wantnormals && !wanttangents)))