]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - render.h
added r_renderview cvar (similar to scr_refresh but disables only 3D
[xonotic/darkplaces.git] / render.h
index c39b4032901dd277c6a7e0518338a58a9e77b1d9..66128bb58d47e133d51583053816235d889605d5 100644 (file)
--- a/render.h
+++ b/render.h
@@ -163,6 +163,7 @@ int R_CullBoxCustomPlanes(const vec3_t mins, const vec3_t maxs, int numplanes, c
 #include "r_lerpanim.h"
 
 extern cvar_t r_render;
+extern cvar_t r_renderview;
 extern cvar_t r_waterwarp;
 
 extern cvar_t r_textureunits;
@@ -175,6 +176,8 @@ extern cvar_t r_glsl_deluxemapping;
 extern cvar_t gl_polyblend;
 extern cvar_t gl_dither;
 
+extern cvar_t cl_deathfade;
+
 extern cvar_t r_smoothnormals_areaweighting;
 
 extern cvar_t r_test;
@@ -191,6 +194,11 @@ extern rtexture_t *r_texture_normalizationcube;
 extern rtexture_t *r_texture_fogattenuation;
 //extern rtexture_t *r_texture_fogintensity;
 
+#define R_MAX_OCCLUSION_QUERIES 4096
+extern unsigned int r_queries[R_MAX_OCCLUSION_QUERIES];
+extern unsigned int r_numqueries;
+extern unsigned int r_maxqueries;
+
 void R_TimeReport(char *name);
 
 // r_stain
@@ -296,7 +304,7 @@ typedef struct rsurfacestate_s
        matrix4x4_t matrix;
        matrix4x4_t inversematrix;
        // animation blending state from entity
-       frameblend_t frameblend[4];
+       frameblend_t frameblend[MAX_FRAMEBLENDS];
        // directional model shading state from entity
        vec3_t modellight_ambient;
        vec3_t modellight_diffuse;
@@ -335,6 +343,11 @@ typedef struct rsurfacestate_s
        matrix4x4_t entitytoattenuationxyz;
        // this transforms only the Z to S, and T is always 0.5
        matrix4x4_t entitytoattenuationz;
+
+       // pointer to an entity_render_t used only by R_GetCurrentTexture and
+       // RSurf_ActiveWorldEntity/RSurf_ActiveModelEntity as a unique id within
+       // each frame (see r_frame also)
+       entity_render_t *entity;
 }
 rsurfacestate_t;
 
@@ -346,14 +359,10 @@ void RSurf_SetupDepthAndCulling(void);
 
 void R_Mesh_ResizeArrays(int newvertices);
 
-struct entity_render_s;
-struct texture_s;
-struct msurface_s;
-void R_UpdateTextureInfo(const entity_render_t *ent, texture_t *t);
-void R_UpdateAllTextureInfo(entity_render_t *ent);
-void R_QueueTextureSurfaceList(int texturenumsurfaces, msurface_t **texturesurfacelist);
-void R_DrawWorldSurfaces(qboolean skysurfaces, qboolean writedepth, qboolean depthonly, qboolean addwaterplanes, qboolean debug);
-void R_DrawModelSurfaces(entity_render_t *ent, qboolean skysurfaces, qboolean writedepth, qboolean depthonly, qboolean addwaterplanes, qboolean debug);
+texture_t *R_GetCurrentTexture(texture_t *t);
+void R_DrawWorldSurfaces(qboolean skysurfaces, qboolean writedepth, qboolean depthonly, qboolean debug);
+void R_DrawModelSurfaces(entity_render_t *ent, qboolean skysurfaces, qboolean writedepth, qboolean depthonly, qboolean debug);
+void R_AddWaterPlanes(entity_render_t *ent);
 
 void RSurf_PrepareVerticesForBatch(qboolean generatenormals, qboolean generatetangents, int texturenumsurfaces, msurface_t **texturesurfacelist);
 void RSurf_DrawBatch_Simple(int texturenumsurfaces, msurface_t **texturesurfacelist);
@@ -400,12 +409,17 @@ typedef enum gl20_texunit_e
        // conflicts with lightmap/deluxemap
        GL20TU_ATTENUATION = 9,
        GL20TU_CUBE = 10,
+       GL20TU_SHADOWMAPRECT = 11,
+       GL20TU_SHADOWMAPCUBE = 11,
+       GL20TU_SHADOWMAP2D = 11,
+       GL20TU_CUBEPROJECTION = 12
 }
 gl20_texunit;
 
 void R_SetupGenericShader(qboolean usetexture);
 void R_SetupGenericTwoTextureShader(int texturemode);
 void R_SetupDepthOrShadowShader(void);
+void R_SetupShowDepthShader(void);
 void R_SetupSurfaceShader(const vec3_t lightcolorbase, qboolean modellighting, float ambientscale, float diffusescale, float specularscale, rsurfacepass_t rsurfacepass);
 
 typedef struct r_waterstate_waterplane_s