X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=render.h;h=d567b5425312fae24d9ecdba388197c297e7ec83;hb=b8ed5f4b75295236ff94f09fc54e45bf10cfcf3f;hp=a0406d4b0efd651b07410b67552e7fda8216464f;hpb=0e6f1ee37a279e6224129b8eb4346592cc6b9885;p=xonotic%2Fdarkplaces.git diff --git a/render.h b/render.h index a0406d4b..d567b542 100644 --- a/render.h +++ b/render.h @@ -126,6 +126,7 @@ extern cvar_t r_dynamic; void R_Init(void); void R_UpdateVariables(void); // must call after setting up most of r_refdef, but before calling R_RenderView void R_RenderView(void); // must set r_refdef and call R_UpdateVariables first +void R_RenderView_UpdateViewVectors(void); // just updates r_refdef.view.{forward,left,up,origin,right,inverse_matrix} typedef enum r_refdef_scene_type_s { RST_CLIENT, @@ -222,8 +223,8 @@ void R_TimeReport(const char *name); // r_stain void R_Stain(const vec3_t origin, float radius, int cr1, int cg1, int cb1, int ca1, int cr2, int cg2, int cb2, int ca2); -void R_CalcBeam_Vertex3f(float *vert, const vec3_t org1, const vec3_t org2, float width); -void R_CalcSprite_Vertex3f(float *vertex3f, const vec3_t origin, const vec3_t left, const vec3_t up, float scalex1, float scalex2, float scaley1, float scaley2); +void R_CalcBeam_Vertex3f(float *vert, const float *org1, const float *org2, float width); +void R_CalcSprite_Vertex3f(float *vertex3f, const float *origin, const float *left, const float *up, float scalex1, float scalex2, float scaley1, float scaley2); extern mempool_t *r_main_mempool; @@ -243,7 +244,15 @@ typedef struct rsurfacestate_s // // this indicates the model* arrays are pointed at array_model* buffers // (in other words, the model has been animated in software) + qboolean forcecurrenttextureupdate; // set for RSurf_ActiveCustomEntity to force R_GetCurrentTexture to recalculate the texture parameters (such as entity alpha) qboolean modelgeneratedvertex; + // skeletal animation can be done by entity (animcache) or per batch, + // batch may be non-skeletal even if entity is skeletal, indicating that + // the dynamicvertex code path had to apply skeletal manually for a case + // where gpu-skinning is not possible, for this reason batch has its own + // variables + int entityskeletalnumtransforms; // how many transforms are used for this mesh + float *entityskeletaltransform3x4; // use gpu-skinning shader on this mesh float *modelvertex3f; const r_meshbuffer_t *modelvertex3f_vertexbuffer; size_t modelvertex3f_bufferoffset; @@ -265,6 +274,12 @@ typedef struct rsurfacestate_s float *modeltexcoordlightmap2f; const r_meshbuffer_t *modeltexcoordlightmap2f_vertexbuffer; size_t modeltexcoordlightmap2f_bufferoffset; + unsigned char *modelskeletalindex4ub; + const r_meshbuffer_t *modelskeletalindex4ub_vertexbuffer; + size_t modelskeletalindex4ub_bufferoffset; + unsigned char *modelskeletalweight4ub; + const r_meshbuffer_t *modelskeletalweight4ub_vertexbuffer; + size_t modelskeletalweight4ub_bufferoffset; r_vertexmesh_t *modelvertexmesh; const r_meshbuffer_t *modelvertexmeshbuffer; const r_meshbuffer_t *modelvertex3fbuffer; @@ -285,6 +300,9 @@ typedef struct rsurfacestate_s // deformvertexes is used in a q3 shader, and consequently these can // change on a per-surface basis (according to rsurface.texture) qboolean batchgeneratedvertex; + qboolean batchmultidraw; + int batchmultidrawnumsurfaces; + const msurface_t **batchmultidrawsurfacelist; int batchfirstvertex; int batchnumvertices; int batchfirsttriangle; @@ -313,12 +331,20 @@ typedef struct rsurfacestate_s float *batchtexcoordlightmap2f; const r_meshbuffer_t *batchtexcoordlightmap2f_vertexbuffer; size_t batchtexcoordlightmap2f_bufferoffset; + unsigned char *batchskeletalindex4ub; + const r_meshbuffer_t *batchskeletalindex4ub_vertexbuffer; + size_t batchskeletalindex4ub_bufferoffset; + unsigned char *batchskeletalweight4ub; + const r_meshbuffer_t *batchskeletalweight4ub_vertexbuffer; + size_t batchskeletalweight4ub_bufferoffset; int *batchelement3i; const r_meshbuffer_t *batchelement3i_indexbuffer; size_t batchelement3i_bufferoffset; unsigned short *batchelement3s; const r_meshbuffer_t *batchelement3s_indexbuffer; size_t batchelement3s_bufferoffset; + int batchskeletalnumtransforms; + float *batchskeletaltransform3x4; // rendering pass processing arrays in GL11 and GL13 paths float *passcolor4f; const r_meshbuffer_t *passcolor4f_vertexbuffer; @@ -419,13 +445,16 @@ void R_DrawCustomSurface_Texture(texture_t *texture, const matrix4x4_t *texmatri #define BATCHNEED_VERTEXMESH_VERTEXCOLOR (1<< 4) // set up vertex colors in rsurface.batchvertexmesh if BATCHNEED_MESH, set up rsurface.batchlightmapcolor4f if BATCHNEED_ARRAYS #define BATCHNEED_VERTEXMESH_TEXCOORD (1<< 5) // set up vertex colors in rsurface.batchvertexmesh if BATCHNEED_MESH, set up rsurface.batchlightmapcolor4f if BATCHNEED_ARRAYS #define BATCHNEED_VERTEXMESH_LIGHTMAP (1<< 6) // set up vertex colors in rsurface.batchvertexmesh if BATCHNEED_MESH, set up rsurface.batchlightmapcolor4f if BATCHNEED_ARRAYS -#define BATCHNEED_ARRAY_VERTEX (1<< 7) // set up rsurface.batchvertex3f and optionally others -#define BATCHNEED_ARRAY_NORMAL (1<< 8) // set up normals in rsurface.batchvertexmesh if BATCHNEED_MESH, set up rsurface.batchnormal3f if BATCHNEED_ARRAYS -#define BATCHNEED_ARRAY_VECTOR (1<< 9) // set up vectors in rsurface.batchvertexmesh if BATCHNEED_MESH, set up rsurface.batchsvector3f and rsurface.batchtvector3f if BATCHNEED_ARRAYS -#define BATCHNEED_ARRAY_VERTEXCOLOR (1<<10) // set up vertex colors in rsurface.batchvertexmesh if BATCHNEED_MESH, set up rsurface.batchlightmapcolor4f if BATCHNEED_ARRAYS -#define BATCHNEED_ARRAY_TEXCOORD (1<<11) // set up vertex colors in rsurface.batchvertexmesh if BATCHNEED_MESH, set up rsurface.batchlightmapcolor4f if BATCHNEED_ARRAYS -#define BATCHNEED_ARRAY_LIGHTMAP (1<<12) // set up vertex colors in rsurface.batchvertexmesh if BATCHNEED_MESH, set up rsurface.batchlightmapcolor4f if BATCHNEED_ARRAYS -#define BATCHNEED_NOGAPS (1<<13) // force vertex copying (no gaps) +#define BATCHNEED_VERTEXMESH_SKELETAL (1<< 7) // set up skeletal index and weight data for vertex shader +#define BATCHNEED_ARRAY_VERTEX (1<< 8) // set up rsurface.batchvertex3f and optionally others +#define BATCHNEED_ARRAY_NORMAL (1<< 9) // set up normals in rsurface.batchvertexmesh if BATCHNEED_MESH, set up rsurface.batchnormal3f if BATCHNEED_ARRAYS +#define BATCHNEED_ARRAY_VECTOR (1<<10) // set up vectors in rsurface.batchvertexmesh if BATCHNEED_MESH, set up rsurface.batchsvector3f and rsurface.batchtvector3f if BATCHNEED_ARRAYS +#define BATCHNEED_ARRAY_VERTEXCOLOR (1<<11) // set up vertex colors in rsurface.batchvertexmesh if BATCHNEED_MESH, set up rsurface.batchlightmapcolor4f if BATCHNEED_ARRAYS +#define BATCHNEED_ARRAY_TEXCOORD (1<<12) // set up vertex colors in rsurface.batchvertexmesh if BATCHNEED_MESH, set up rsurface.batchlightmapcolor4f if BATCHNEED_ARRAYS +#define BATCHNEED_ARRAY_LIGHTMAP (1<<13) // set up vertex colors in rsurface.batchvertexmesh if BATCHNEED_MESH, set up rsurface.batchlightmapcolor4f if BATCHNEED_ARRAYS +#define BATCHNEED_ARRAY_SKELETAL (1<<14) // set up skeletal index and weight data for vertex shader +#define BATCHNEED_NOGAPS (1<<15) // force vertex copying if firstvertex is not zero or there are gaps +#define BATCHNEED_ALLOWMULTIDRAW (1<<16) // allow multiple draws void RSurf_PrepareVerticesForBatch(int batchneed, int texturenumsurfaces, const msurface_t **texturesurfacelist); void RSurf_DrawBatch(void); @@ -442,8 +471,7 @@ rsurfacepass_t; void R_SetupShader_Generic(rtexture_t *first, rtexture_t *second, int texturemode, int rgbscale, qboolean usegamma, qboolean notrippy, qboolean suppresstexalpha); void R_SetupShader_Generic_NoTexture(qboolean usegamma, qboolean notrippy); -void R_SetupShader_DepthOrShadow(qboolean notrippy, qboolean depthrgb); -void R_SetupShader_ShowDepth(qboolean notrippy); +void R_SetupShader_DepthOrShadow(qboolean notrippy, qboolean depthrgb, qboolean skeletal); void R_SetupShader_Surface(const vec3_t lightcolorbase, qboolean modellighting, float ambientscale, float diffusescale, float specularscale, rsurfacepass_t rsurfacepass, int texturenumsurfaces, const msurface_t **texturesurfacelist, void *waterplane, qboolean notrippy); void R_SetupShader_DeferredLight(const rtlight_t *rtlight); @@ -519,6 +547,7 @@ extern r_framebufferstate_t r_fb; extern cvar_t r_viewfbo; +void R_ResetViewRendering2D_Common(int fbo, rtexture_t *depthtexture, rtexture_t *colortexture, float x2, float y2); // this is called by R_ResetViewRendering2D and _DrawQ_Setup and internal void R_ResetViewRendering2D(int fbo, rtexture_t *depthtexture, rtexture_t *colortexture); void R_ResetViewRendering3D(int fbo, rtexture_t *depthtexture, rtexture_t *colortexture); void R_SetupView(qboolean allowwaterclippingplane, int fbo, rtexture_t *depthtexture, rtexture_t *colortexture); @@ -531,6 +560,13 @@ extern cvar_t r_shadows_throwdistance; extern cvar_t r_shadows_throwdirection; extern cvar_t r_shadows_focus; extern cvar_t r_shadows_shadowmapscale; +extern cvar_t r_shadows_shadowmapbias; +extern cvar_t r_transparent_alphatocoverage; +extern cvar_t r_transparent_sortsurfacesbynearest; +extern cvar_t r_transparent_useplanardistance; +extern cvar_t r_transparent_sortarraysize; +extern cvar_t r_transparent_sortmindist; +extern cvar_t r_transparent_sortmaxdist; void R_Model_Sprite_Draw(entity_render_t *ent); @@ -569,5 +605,7 @@ void R_LightningBeams_Init(void); void Mod_RenderInit(void); void Font_Init(void); -#endif +qboolean R_CompileShader_CheckStaticParms(void); +void R_GLSL_Restart_f(void); +#endif