extern cvar_t r_sky;
extern cvar_t r_skyscroll1;
extern cvar_t r_skyscroll2;
-extern int skyrendernow, skyrendermasked;
+extern int skyrenderlater, skyrendermasked;
extern int R_SetSkyBox(const char *sky);
extern void R_SkyStartFrame(void);
extern void R_Sky(void);
skinframe_t *R_SkinFrame_LoadExternal_CheckAlpha(const char *name, int textureflags, qboolean complain, qboolean *has_alpha);
skinframe_t *R_SkinFrame_LoadInternalBGRA(const char *name, int textureflags, const unsigned char *skindata, int width, int height);
skinframe_t *R_SkinFrame_LoadInternalQuake(const char *name, int textureflags, int loadpantsandshirt, int loadglowtexture, const unsigned char *skindata, int width, int height);
+skinframe_t *R_SkinFrame_LoadInternal8bit(const char *name, int textureflags, const unsigned char *skindata, int width, int height, const unsigned int *palette, const unsigned int *alphapalette);
skinframe_t *R_SkinFrame_LoadMissing(void);
void R_View_WorldVisibility(qboolean forcenovis);
#include "r_lerpanim.h"
extern cvar_t r_render;
+extern cvar_t r_renderview;
extern cvar_t r_waterwarp;
extern cvar_t r_textureunits;
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;
float *texcoordlightmap2f;
int texcoordlightmap2f_bufferobject;
size_t texcoordlightmap2f_bufferoffset;
+ // some important fields from the entity
+ int ent_skinnum;
+ int ent_qwskin;
+ int ent_flags;
+ float ent_shadertime;
+ float ent_color[4];
// transform matrices to render this entity and effects on this entity
matrix4x4_t matrix;
matrix4x4_t inversematrix;
+ // scale factors for transforming lengths into/out of entity space
+ float matrixscale;
+ float inversematrixscale;
// 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;
// colormapping state from entity (these are black if colormapping is off)
vec3_t colormap_pantscolor;
vec3_t colormap_shirtcolor;
+ // special coloring of glow textures
+ vec3_t glowmod;
// view location in model space
- vec3_t modelorg; // TODO: rename this
+ vec3_t localvieworigin;
// polygon offset data for submodels
float basepolygonfactor;
float basepolygonoffset;
// whether lightmapping is active on this batch
// (otherwise vertex colored)
qboolean uselightmaptexture;
+ // fog plane in model space for direct application to vertices
+ float fograngerecip;
+ float fogmasktabledistmultiplier;
// rtlight rendering
// light currently being rendered
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;
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);
// 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