2010-02-15 23:26:55 +00:00
/*
Copyright ( C ) 1996 - 2001 Id Software , Inc .
Copyright ( C ) 2002 - 2009 John Fitzgibbons and others
Copyright ( C ) 2007 - 2008 Kristian Duske
2014-09-22 08:55:46 +00:00
Copyright ( C ) 2010 - 2014 QuakeSpasm developers
2010-02-15 23:26:55 +00:00
This program is free software ; you can redistribute it and / or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation ; either version 2
of the License , or ( at your option ) any later version .
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE .
See the GNU General Public License for more details .
You should have received a copy of the GNU General Public License
along with this program ; if not , write to the Free Software
Foundation , Inc . , 59 Temple Place - Suite 330 , Boston , MA 02111 - 1307 , USA .
*/
bspfile.h, cdaudio.h, client.h, cmd.h, common.h, console.h, crc.h, cvar.h,
d_ifacea.h, draw.h, gl_texmgr.h, glquake.h, image.h, input.h, keys.h, mathlib.h,
menu.h, modelgen.h, net.h, net_dgrm.h, net_loop.h, net_sdlnet.h, net_udp.h,
net_wins.h, platform.h, pr_comp.h, progdefs.h, progs.h, protocol.h, quakedef.h,
render.h, resource.h, sbar.h, screen.h, server.h, sound.h, spritegn.h, sys.h,
vid.h, view.h, wad.h, world.h, zone.h: added include guards to the headers.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@84 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-21 00:01:08 +00:00
# ifndef __GLQUAKE_H
# define __GLQUAKE_H
2010-02-15 23:26:55 +00:00
void GL_BeginRendering ( int * x , int * y , int * width , int * height ) ;
void GL_EndRendering ( void ) ;
chase.c, cl_input.c, cl_parse.c, client.h, common.c, common.h, console.h,
cvar.h, draw.h, gl_draw.c, gl_fog.c, gl_mesh.c, gl_model.c, gl_model.h,
gl_rmain.c, gl_rmisc.c, gl_screen.c, gl_sky.c, gl_texmgr.c, glquake.h,
host.c, keys.c, keys.h, main.c, menu.c, menu.h, pr_cmds.c, quakedef.h,
r_alias.c, r_brush.c, r_part.c, r_sprite.c, r_world.c, sbar.c, sbar.h,
screen.h, snd_dma.c, snd_mem.c, snd_mix.c, sv_main.c, sys_sdl.c, vid.h,
view.h, world.c, world.h: Loads of warning fixes about missing function
prototypes, missing parens around &, missing braces leading to ambiguous
else statements and unused and uninitialized variables. There are still a
couple of unitialised variables here and there, but not much. The warnings
about strict aliasing violations need taking care of.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@21 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-16 12:01:07 +00:00
void GL_Set2D ( void ) ;
2010-02-15 23:26:55 +00:00
extern int glx , gly , glwidth , glheight ;
2016-04-29 20:00:50 +00:00
# define GL_UNUSED_TEXTURE (~(GLuint)0)
2010-02-15 23:26:55 +00:00
// r_local.h -- private refresh defs
# define ALIAS_BASE_SIZE_RATIO (1.0 / 11.0)
// normalizing factor so player model works out to about
// 1 pixel per triangle
# define MAX_LBM_HEIGHT 480
# define TILE_SIZE 128 // size of textures generated by R_GenTiledSurf
# define SKYSHIFT 7
# define SKYSIZE (1 << SKYSHIFT)
# define SKYMASK (SKYSIZE - 1)
# define BACKFACE_EPSILON 0.01
void R_TimeRefresh_f ( void ) ;
void R_ReadPointFile_f ( void ) ;
texture_t * R_TextureAnimation ( texture_t * base , int frame ) ;
typedef struct surfcache_s
{
struct surfcache_s * next ;
struct surfcache_s * * owner ; // NULL is an empty chunk of memory
2011-12-30 14:00:28 +00:00
int lightadj [ MAXLIGHTMAPS ] ; // checked for strobe flush
int dlight ;
int size ; // including header
unsigned width ;
unsigned height ; // DEBUG only needed for debug
float mipscale ;
2010-02-15 23:26:55 +00:00
struct texture_s * texture ; // checked for animating textures
2011-12-30 14:00:28 +00:00
byte data [ 4 ] ; // width*height elements
2010-02-15 23:26:55 +00:00
} surfcache_t ;
typedef struct
{
pixel_t * surfdat ; // destination for generated surface
2011-12-30 14:00:28 +00:00
int rowbytes ; // destination logical width in bytes
2010-02-15 23:26:55 +00:00
msurface_t * surf ; // description for surface to generate
fixed8_t lightadj [ MAXLIGHTMAPS ] ;
// adjust for lightmap levels for dynamic lighting
texture_t * texture ; // corrected for animating textures
2011-12-30 14:00:28 +00:00
int surfmip ; // mipmapped ratio of surface texels / world pixels
int surfwidth ; // in mipmapped texels
int surfheight ; // in mipmapped texels
2010-02-15 23:26:55 +00:00
} drawsurf_t ;
typedef enum {
pt_static , pt_grav , pt_slowgrav , pt_fire , pt_explode , pt_explode2 , pt_blob , pt_blob2
} ptype_t ;
// !!! if this is changed, it must be changed in d_ifacea.h too !!!
typedef struct particle_s
{
// driver-usable fields
vec3_t org ;
float color ;
// drivers never touch the following fields
struct particle_s * next ;
vec3_t vel ;
float ramp ;
float die ;
ptype_t type ;
} particle_t ;
2017-09-17 02:12:53 +00:00
# define P_INVALID -1
# ifdef PSET_SCRIPT
void PScript_InitParticles ( void ) ;
void PScript_Shutdown ( void ) ;
void PScript_DrawParticles ( void ) ;
struct trailstate_s ;
2019-01-30 04:17:18 +00:00
int PScript_ParticleTrail ( vec3_t startpos , vec3_t end , int type , float timeinterval , int dlkey , vec3_t axis [ 3 ] , struct trailstate_s * * tsk ) ;
2017-09-17 02:12:53 +00:00
int PScript_RunParticleEffectState ( vec3_t org , vec3_t dir , float count , int typenum , struct trailstate_s * * tsk ) ;
void PScript_RunParticleWeather ( vec3_t minb , vec3_t maxb , vec3_t dir , float count , int colour , const char * efname ) ;
void PScript_EmitSkyEffectTris ( qmodel_t * mod , msurface_t * fa , int ptype ) ;
int PScript_FindParticleType ( const char * fullname ) ;
int PScript_RunParticleEffectTypeString ( vec3_t org , vec3_t dir , float count , const char * name ) ;
int PScript_EntParticleTrail ( vec3_t oldorg , entity_t * ent , const char * name ) ;
int PScript_RunParticleEffect ( vec3_t org , vec3_t dir , int color , int count ) ;
void PScript_DelinkTrailstate ( struct trailstate_s * * tsk ) ;
void PScript_ClearParticles ( void ) ;
void PScript_UpdateModelEffects ( qmodel_t * mod ) ;
void PScript_ClearSurfaceParticles ( qmodel_t * mod ) ; //model is being unloaded.
# else
# define PScript_RunParticleEffectState(o,d,c,t,s) true
# define PScript_RunParticleEffectTypeString(o,d,c,n) true //just unconditionally returns an error
# define PScript_EntParticleTrail(o,e,n) true
# define PScript_ParticleTrail(o,e,t,d,a,s) true
# define PScript_EntParticleTrail(o,e,n) true
# define PScript_RunParticleEffect(o,d,p,c) true
# define PScript_RunParticleWeather(min,max,d,c,p,n) true
# define PScript_ClearSurfaceParticles(m)
# define PScript_DelinkTrailstate(tsp)
# endif
2010-02-15 23:26:55 +00:00
//====================================================
extern qboolean r_cache_thrash ; // compatability
extern vec3_t modelorg , r_entorigin ;
extern entity_t * currententity ;
2011-12-30 14:00:28 +00:00
extern int r_visframecount ; // ??? what difs?
extern int r_framecount ;
2010-02-15 23:26:55 +00:00
extern mplane_t frustum [ 4 ] ;
//
// view origin
//
extern vec3_t vup ;
extern vec3_t vpn ;
extern vec3_t vright ;
extern vec3_t r_origin ;
//
// screen size info
//
extern refdef_t r_refdef ;
extern mleaf_t * r_viewleaf , * r_oldviewleaf ;
2019-09-10 14:41:11 +00:00
extern int d_lightstylevalue [ MAX_LIGHTSTYLES ] ; // 8.8 fraction of base light value
2010-02-15 23:26:55 +00:00
extern cvar_t r_norefresh ;
extern cvar_t r_drawentities ;
extern cvar_t r_drawworld ;
extern cvar_t r_drawviewmodel ;
extern cvar_t r_speeds ;
2015-09-12 03:29:41 +00:00
extern cvar_t r_pos ;
2010-02-15 23:26:55 +00:00
extern cvar_t r_waterwarp ;
extern cvar_t r_fullbright ;
extern cvar_t r_lightmap ;
extern cvar_t r_shadows ;
extern cvar_t r_wateralpha ;
new cvars: r_lavaalpha, r_slimealpha, r_telealpha for fine-tuning specific liquid opacities (from DirectQ, RMQEngine)
new worldspawn keys: _wateralpha, _lavaalpha, _slimealpha, _telealpha, _skyfog (unique to Quakespasm)
The lava/slime/telealpha cvars are non-archived, and default to 0, which means to use the value of r_wateralpha, so they have no effect by default.
The worldspawn keys allow custom maps to set these values in a way that only applies while the map is loaded, and doesn't change the cvar value. (similar to the behaviour of the "fog" worldspawn key.) They are accepted with or without the underscore, like "fog".
see also:
http://forums.insideqc.com/viewtopic.php?f=3&t=5532
http://celephais.net/board/view_thread.php?id=60452&start=937
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1238 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-07-26 21:51:25 +00:00
extern cvar_t r_lavaalpha ;
extern cvar_t r_telealpha ;
extern cvar_t r_slimealpha ;
2010-02-15 23:26:55 +00:00
extern cvar_t r_dynamic ;
extern cvar_t r_novis ;
2017-05-26 20:37:48 +00:00
extern cvar_t r_scale ;
2010-02-15 23:26:55 +00:00
extern cvar_t gl_clear ;
extern cvar_t gl_cull ;
extern cvar_t gl_smoothmodels ;
extern cvar_t gl_affinemodels ;
extern cvar_t gl_polyblend ;
extern cvar_t gl_flashblend ;
extern cvar_t gl_nocolors ;
extern cvar_t gl_playermip ;
2011-12-28 17:37:30 +00:00
extern cvar_t gl_subdivide_size ;
extern float load_subdivide_size ; //johnfitz -- remember what subdivide_size value was when this map was loaded
2015-04-16 23:57:45 +00:00
extern int gl_stencilbits ;
2010-02-15 23:26:55 +00:00
// Multitexture
2011-12-30 14:00:28 +00:00
extern qboolean mtexenabled ;
extern qboolean gl_mtexable ;
2010-02-15 23:26:55 +00:00
extern PFNGLMULTITEXCOORD2FARBPROC GL_MTexCoord2fFunc ;
extern PFNGLACTIVETEXTUREARBPROC GL_SelectTextureFunc ;
Load world and brush models into a VBO, and draw it in batches in R_DrawTextureChains_Multitexture. Uses the same immediate mode code as before if VBOs are not available, or if "-novbo" used at the command line. I only touched R_DrawTextureChains_Multitexture because it's usually the main bottleneck aside from alias model rendering.
This seems to help fps a fair bit on maps with a lot of world polys like jam2_tronyn. Tried on a few computers with intel and nvidia gpus, windows, mac os, linux, and there's always at least some fps improvement. Best case was 70fps -> 96fps on jam2_tronyn, on OS X + nvidia 650gt.
Interested to hear how this works for amd gpu's, just do a timedemo with and without "-novbo".
Only downside is I had to disable the fast path in Vid_Toggle_f() because at least with SDL1, the vbo no longer works after a toggle. So as a result, fullscreen toggles with alt-enter are slightly slower.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1018 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-11 04:55:16 +00:00
extern PFNGLCLIENTACTIVETEXTUREARBPROC GL_ClientActiveTextureFunc ;
2014-09-20 01:08:13 +00:00
extern GLint gl_max_texture_units ; //ericw
2010-02-15 23:26:55 +00:00
//johnfitz -- anisotropic filtering
2011-12-30 14:00:28 +00:00
# define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
# define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
extern float gl_max_anisotropy ;
extern qboolean gl_anisotropy_able ;
2010-02-15 23:26:55 +00:00
Load world and brush models into a VBO, and draw it in batches in R_DrawTextureChains_Multitexture. Uses the same immediate mode code as before if VBOs are not available, or if "-novbo" used at the command line. I only touched R_DrawTextureChains_Multitexture because it's usually the main bottleneck aside from alias model rendering.
This seems to help fps a fair bit on maps with a lot of world polys like jam2_tronyn. Tried on a few computers with intel and nvidia gpus, windows, mac os, linux, and there's always at least some fps improvement. Best case was 70fps -> 96fps on jam2_tronyn, on OS X + nvidia 650gt.
Interested to hear how this works for amd gpu's, just do a timedemo with and without "-novbo".
Only downside is I had to disable the fast path in Vid_Toggle_f() because at least with SDL1, the vbo no longer works after a toggle. So as a result, fullscreen toggles with alt-enter are slightly slower.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1018 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-11 04:55:16 +00:00
//ericw -- VBO
extern PFNGLBINDBUFFERARBPROC GL_BindBufferFunc ;
extern PFNGLBUFFERDATAARBPROC GL_BufferDataFunc ;
Alias model rendering fast-path using OpenGL 2.
In GL_MakeAliasModelDisplayLists, after saving the standerd triangle strips and fans onto the hunk, if the system is GL2 capable, we also save a second version of the mdl on the hunk designed to be loaded into a VBO (GL_MakeAliasModelDisplayLists_VBO). In R_NewMap, and on video mode changes, we call GLMesh_LoadVertexBuffers which loops over all precached mdl's and loads the data into a pair of VBO's (vertices and vertex indices).
Finally, in R_DrawAliasModel, assuming no rendering options are disabling the fast-path (r_drawflat 1, r_lightmap 1, or r_fullbright 1 would disable it), we call GL_DrawAliasFrame_GLSL, which sets up all of the bindings and draws the (possibly lerped) mdl in one glDrawElements call.
Special thanks to MH for some of the code from RMQEngine and the general concept.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1151 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-01-20 18:59:15 +00:00
extern PFNGLBUFFERSUBDATAARBPROC GL_BufferSubDataFunc ;
Load world and brush models into a VBO, and draw it in batches in R_DrawTextureChains_Multitexture. Uses the same immediate mode code as before if VBOs are not available, or if "-novbo" used at the command line. I only touched R_DrawTextureChains_Multitexture because it's usually the main bottleneck aside from alias model rendering.
This seems to help fps a fair bit on maps with a lot of world polys like jam2_tronyn. Tried on a few computers with intel and nvidia gpus, windows, mac os, linux, and there's always at least some fps improvement. Best case was 70fps -> 96fps on jam2_tronyn, on OS X + nvidia 650gt.
Interested to hear how this works for amd gpu's, just do a timedemo with and without "-novbo".
Only downside is I had to disable the fast path in Vid_Toggle_f() because at least with SDL1, the vbo no longer works after a toggle. So as a result, fullscreen toggles with alt-enter are slightly slower.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1018 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-11 04:55:16 +00:00
extern PFNGLDELETEBUFFERSARBPROC GL_DeleteBuffersFunc ;
extern PFNGLGENBUFFERSARBPROC GL_GenBuffersFunc ;
extern qboolean gl_vbo_able ;
//ericw
Alias model rendering fast-path using OpenGL 2.
In GL_MakeAliasModelDisplayLists, after saving the standerd triangle strips and fans onto the hunk, if the system is GL2 capable, we also save a second version of the mdl on the hunk designed to be loaded into a VBO (GL_MakeAliasModelDisplayLists_VBO). In R_NewMap, and on video mode changes, we call GLMesh_LoadVertexBuffers which loops over all precached mdl's and loads the data into a pair of VBO's (vertices and vertex indices).
Finally, in R_DrawAliasModel, assuming no rendering options are disabling the fast-path (r_drawflat 1, r_lightmap 1, or r_fullbright 1 would disable it), we call GL_DrawAliasFrame_GLSL, which sets up all of the bindings and draws the (possibly lerped) mdl in one glDrawElements call.
Special thanks to MH for some of the code from RMQEngine and the general concept.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1151 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-01-20 18:59:15 +00:00
//ericw -- GLSL
// SDL 1.2 has a bug where it doesn't provide these typedefs on OS X!
typedef GLuint ( APIENTRYP QS_PFNGLCREATESHADERPROC ) ( GLenum type ) ;
typedef void ( APIENTRYP QS_PFNGLDELETESHADERPROC ) ( GLuint shader ) ;
typedef void ( APIENTRYP QS_PFNGLDELETEPROGRAMPROC ) ( GLuint program ) ;
typedef void ( APIENTRYP QS_PFNGLSHADERSOURCEPROC ) ( GLuint shader , GLsizei count , const GLchar * const * string , const GLint * length ) ;
typedef void ( APIENTRYP QS_PFNGLCOMPILESHADERPROC ) ( GLuint shader ) ;
typedef void ( APIENTRYP QS_PFNGLGETSHADERIVPROC ) ( GLuint shader , GLenum pname , GLint * params ) ;
typedef void ( APIENTRYP QS_PFNGLGETSHADERINFOLOGPROC ) ( GLuint shader , GLsizei bufSize , GLsizei * length , GLchar * infoLog ) ;
typedef void ( APIENTRYP QS_PFNGLGETPROGRAMIVPROC ) ( GLuint program , GLenum pname , GLint * params ) ;
typedef void ( APIENTRYP QS_PFNGLGETPROGRAMINFOLOGPROC ) ( GLuint program , GLsizei bufSize , GLsizei * length , GLchar * infoLog ) ;
typedef GLuint ( APIENTRYP QS_PFNGLCREATEPROGRAMPROC ) ( void ) ;
typedef void ( APIENTRYP QS_PFNGLATTACHSHADERPROC ) ( GLuint program , GLuint shader ) ;
typedef void ( APIENTRYP QS_PFNGLLINKPROGRAMPROC ) ( GLuint program ) ;
typedef void ( APIENTRYP QS_PFNGLBINDATTRIBLOCATIONFUNC ) ( GLuint program , GLuint index , const GLchar * name ) ;
typedef void ( APIENTRYP QS_PFNGLUSEPROGRAMPROC ) ( GLuint program ) ;
typedef GLint ( APIENTRYP QS_PFNGLGETATTRIBLOCATIONPROC ) ( GLuint program , const GLchar * name ) ;
typedef void ( APIENTRYP QS_PFNGLVERTEXATTRIBPOINTERPROC ) ( GLuint index , GLint size , GLenum type , GLboolean normalized , GLsizei stride , const void * pointer ) ;
typedef void ( APIENTRYP QS_PFNGLENABLEVERTEXATTRIBARRAYPROC ) ( GLuint index ) ;
typedef void ( APIENTRYP QS_PFNGLDISABLEVERTEXATTRIBARRAYPROC ) ( GLuint index ) ;
typedef GLint ( APIENTRYP QS_PFNGLGETUNIFORMLOCATIONPROC ) ( GLuint program , const GLchar * name ) ;
typedef void ( APIENTRYP QS_PFNGLUNIFORM1IPROC ) ( GLint location , GLint v0 ) ;
typedef void ( APIENTRYP QS_PFNGLUNIFORM1FPROC ) ( GLint location , GLfloat v0 ) ;
typedef void ( APIENTRYP QS_PFNGLUNIFORM3FPROC ) ( GLint location , GLfloat v0 , GLfloat v1 , GLfloat v2 ) ;
typedef void ( APIENTRYP QS_PFNGLUNIFORM4FPROC ) ( GLint location , GLfloat v0 , GLfloat v1 , GLfloat v2 , GLfloat v3 ) ;
2019-11-02 15:50:53 +00:00
typedef void ( APIENTRYP QS_PFNGLUNIFORM4FVPROC ) ( GLint location , GLsizei count , const GLfloat * value ) ;
Alias model rendering fast-path using OpenGL 2.
In GL_MakeAliasModelDisplayLists, after saving the standerd triangle strips and fans onto the hunk, if the system is GL2 capable, we also save a second version of the mdl on the hunk designed to be loaded into a VBO (GL_MakeAliasModelDisplayLists_VBO). In R_NewMap, and on video mode changes, we call GLMesh_LoadVertexBuffers which loops over all precached mdl's and loads the data into a pair of VBO's (vertices and vertex indices).
Finally, in R_DrawAliasModel, assuming no rendering options are disabling the fast-path (r_drawflat 1, r_lightmap 1, or r_fullbright 1 would disable it), we call GL_DrawAliasFrame_GLSL, which sets up all of the bindings and draws the (possibly lerped) mdl in one glDrawElements call.
Special thanks to MH for some of the code from RMQEngine and the general concept.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1151 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-01-20 18:59:15 +00:00
extern QS_PFNGLCREATESHADERPROC GL_CreateShaderFunc ;
extern QS_PFNGLDELETESHADERPROC GL_DeleteShaderFunc ;
extern QS_PFNGLDELETEPROGRAMPROC GL_DeleteProgramFunc ;
extern QS_PFNGLSHADERSOURCEPROC GL_ShaderSourceFunc ;
extern QS_PFNGLCOMPILESHADERPROC GL_CompileShaderFunc ;
extern QS_PFNGLGETSHADERIVPROC GL_GetShaderivFunc ;
extern QS_PFNGLGETSHADERINFOLOGPROC GL_GetShaderInfoLogFunc ;
extern QS_PFNGLGETPROGRAMIVPROC GL_GetProgramivFunc ;
extern QS_PFNGLGETPROGRAMINFOLOGPROC GL_GetProgramInfoLogFunc ;
extern QS_PFNGLCREATEPROGRAMPROC GL_CreateProgramFunc ;
extern QS_PFNGLATTACHSHADERPROC GL_AttachShaderFunc ;
extern QS_PFNGLLINKPROGRAMPROC GL_LinkProgramFunc ;
extern QS_PFNGLBINDATTRIBLOCATIONFUNC GL_BindAttribLocationFunc ;
extern QS_PFNGLUSEPROGRAMPROC GL_UseProgramFunc ;
extern QS_PFNGLGETATTRIBLOCATIONPROC GL_GetAttribLocationFunc ;
extern QS_PFNGLVERTEXATTRIBPOINTERPROC GL_VertexAttribPointerFunc ;
extern QS_PFNGLENABLEVERTEXATTRIBARRAYPROC GL_EnableVertexAttribArrayFunc ;
extern QS_PFNGLDISABLEVERTEXATTRIBARRAYPROC GL_DisableVertexAttribArrayFunc ;
extern QS_PFNGLGETUNIFORMLOCATIONPROC GL_GetUniformLocationFunc ;
extern QS_PFNGLUNIFORM1IPROC GL_Uniform1iFunc ;
extern QS_PFNGLUNIFORM1FPROC GL_Uniform1fFunc ;
extern QS_PFNGLUNIFORM3FPROC GL_Uniform3fFunc ;
extern QS_PFNGLUNIFORM4FPROC GL_Uniform4fFunc ;
2019-11-02 15:50:53 +00:00
extern QS_PFNGLUNIFORM4FVPROC GL_Uniform4fvFunc ;
Alias model rendering fast-path using OpenGL 2.
In GL_MakeAliasModelDisplayLists, after saving the standerd triangle strips and fans onto the hunk, if the system is GL2 capable, we also save a second version of the mdl on the hunk designed to be loaded into a VBO (GL_MakeAliasModelDisplayLists_VBO). In R_NewMap, and on video mode changes, we call GLMesh_LoadVertexBuffers which loops over all precached mdl's and loads the data into a pair of VBO's (vertices and vertex indices).
Finally, in R_DrawAliasModel, assuming no rendering options are disabling the fast-path (r_drawflat 1, r_lightmap 1, or r_fullbright 1 would disable it), we call GL_DrawAliasFrame_GLSL, which sets up all of the bindings and draws the (possibly lerped) mdl in one glDrawElements call.
Special thanks to MH for some of the code from RMQEngine and the general concept.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1151 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-01-20 18:59:15 +00:00
extern qboolean gl_glsl_able ;
2015-01-26 20:18:45 +00:00
extern qboolean gl_glsl_gamma_able ;
2015-02-20 00:24:05 +00:00
extern qboolean gl_glsl_alias_able ;
Alias model rendering fast-path using OpenGL 2.
In GL_MakeAliasModelDisplayLists, after saving the standerd triangle strips and fans onto the hunk, if the system is GL2 capable, we also save a second version of the mdl on the hunk designed to be loaded into a VBO (GL_MakeAliasModelDisplayLists_VBO). In R_NewMap, and on video mode changes, we call GLMesh_LoadVertexBuffers which loops over all precached mdl's and loads the data into a pair of VBO's (vertices and vertex indices).
Finally, in R_DrawAliasModel, assuming no rendering options are disabling the fast-path (r_drawflat 1, r_lightmap 1, or r_fullbright 1 would disable it), we call GL_DrawAliasFrame_GLSL, which sets up all of the bindings and draws the (possibly lerped) mdl in one glDrawElements call.
Special thanks to MH for some of the code from RMQEngine and the general concept.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1151 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-01-20 18:59:15 +00:00
// ericw --
2014-07-11 06:56:09 +00:00
//ericw -- NPOT texture support
extern qboolean gl_texture_NPOT ;
2020-04-11 00:40:55 +00:00
//spike -- precompressed texture support
typedef void ( APIENTRYP QS_PFNGLCOMPRESSEDTEXIMAGE2DPROC ) ( GLenum target , GLint level , GLenum internalformat , GLsizei width , GLsizei height , GLint border , GLsizei imageSize , const GLvoid * data ) ;
extern QS_PFNGLCOMPRESSEDTEXIMAGE2DPROC GL_CompressedTexImage2D ;
2010-02-15 23:26:55 +00:00
//johnfitz -- polygon offset
# define OFFSET_BMODEL 1
# define OFFSET_NONE 0
# define OFFSET_DECAL -1
# define OFFSET_FOG -2
# define OFFSET_SHOWTRIS -3
void GL_PolygonOffset ( int ) ;
//johnfitz -- GL_EXT_texture_env_combine
//the values for GL_ARB_ are identical
2014-07-12 07:50:57 +00:00
# define GL_COMBINE_EXT 0x8570
# define GL_COMBINE_RGB_EXT 0x8571
2010-02-15 23:26:55 +00:00
# define GL_COMBINE_ALPHA_EXT 0x8572
2014-07-12 07:50:57 +00:00
# define GL_RGB_SCALE_EXT 0x8573
# define GL_CONSTANT_EXT 0x8576
2010-02-15 23:26:55 +00:00
# define GL_PRIMARY_COLOR_EXT 0x8577
2014-07-12 07:50:57 +00:00
# define GL_PREVIOUS_EXT 0x8578
# define GL_SOURCE0_RGB_EXT 0x8580
# define GL_SOURCE1_RGB_EXT 0x8581
2010-02-15 23:26:55 +00:00
# define GL_SOURCE0_ALPHA_EXT 0x8588
# define GL_SOURCE1_ALPHA_EXT 0x8589
extern qboolean gl_texture_env_combine ;
2011-12-30 14:00:28 +00:00
extern qboolean gl_texture_env_add ; // for GL_EXT_texture_env_add
2010-02-15 23:26:55 +00:00
//johnfitz -- rendering statistics
extern int rs_brushpolys , rs_aliaspolys , rs_skypolys , rs_particles , rs_fogpolys ;
extern int rs_dynamiclightmaps , rs_brushpasses , rs_aliaspasses , rs_skypasses ;
extern float rs_megatexels ;
//johnfitz -- track developer statistics that vary every frame
extern cvar_t devstats ;
typedef struct {
int packetsize ;
int edicts ;
int visedicts ;
int efrags ;
int tempents ;
int beams ;
int dlights ;
} devstats_t ;
2010-04-22 19:02:29 +00:00
extern devstats_t dev_stats , dev_peakstats ;
2010-02-15 23:26:55 +00:00
//ohnfitz -- reduce overflow warning spam
typedef struct {
double packetsize ;
double beams ;
2017-04-25 20:07:34 +00:00
double varstring ;
2010-02-15 23:26:55 +00:00
} overflowtimes_t ;
2010-04-22 19:02:29 +00:00
extern overflowtimes_t dev_overflows ; //this stores the last time overflow messages were displayed, not the last time overflows occured
2010-02-15 23:26:55 +00:00
# define CONSOLE_RESPAM_TIME 3 // seconds between repeated warning messages
//johnfitz -- moved here from r_brush.c
2011-12-30 14:00:28 +00:00
extern int gl_lightmap_format , lightmap_bytes ;
2019-09-12 12:34:12 +00:00
# define LMBLOCK_WIDTH 256 //FIXME: make dynamic. if we have a decent card there's no real reason not to use 4k or 16k (assuming there's no lightstyles/dynamics that need uploading...)
# define LMBLOCK_HEIGHT 256 //Alternatively, use texture arrays, which would avoid the need to switch textures as often.
2019-09-12 06:49:35 +00:00
typedef struct glRect_s {
unsigned short l , t , w , h ;
} glRect_t ;
struct lightmap_s
{
gltexture_t * texture ;
glpoly_t * polys ;
qboolean modified ;
glRect_t rectchange ;
// the lightmap texture data needs to be kept in
// main memory so texsubimage can update properly
byte * data ; //[4*LMBLOCK_WIDTH*LMBLOCK_HEIGHT];
} ;
extern struct lightmap_s * lightmap ;
extern int lightmap_count ; //allocated lightmaps
2010-02-15 23:26:55 +00:00
2010-04-22 19:02:29 +00:00
extern int gl_warpimagesize ; //johnfitz -- for water warp
2010-02-15 23:26:55 +00:00
2010-04-22 19:02:29 +00:00
extern qboolean r_drawflat_cheatsafe , r_fullbright_cheatsafe , r_lightmap_cheatsafe , r_drawworld_cheatsafe ; //johnfitz
2010-02-15 23:26:55 +00:00
Alias model rendering fast-path using OpenGL 2.
In GL_MakeAliasModelDisplayLists, after saving the standerd triangle strips and fans onto the hunk, if the system is GL2 capable, we also save a second version of the mdl on the hunk designed to be loaded into a VBO (GL_MakeAliasModelDisplayLists_VBO). In R_NewMap, and on video mode changes, we call GLMesh_LoadVertexBuffers which loops over all precached mdl's and loads the data into a pair of VBO's (vertices and vertex indices).
Finally, in R_DrawAliasModel, assuming no rendering options are disabling the fast-path (r_drawflat 1, r_lightmap 1, or r_fullbright 1 would disable it), we call GL_DrawAliasFrame_GLSL, which sets up all of the bindings and draws the (possibly lerped) mdl in one glDrawElements call.
Special thanks to MH for some of the code from RMQEngine and the general concept.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1151 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-01-20 18:59:15 +00:00
typedef struct glsl_attrib_binding_s {
const char * name ;
GLuint attrib ;
} glsl_attrib_binding_t ;
new cvars: r_lavaalpha, r_slimealpha, r_telealpha for fine-tuning specific liquid opacities (from DirectQ, RMQEngine)
new worldspawn keys: _wateralpha, _lavaalpha, _slimealpha, _telealpha, _skyfog (unique to Quakespasm)
The lava/slime/telealpha cvars are non-archived, and default to 0, which means to use the value of r_wateralpha, so they have no effect by default.
The worldspawn keys allow custom maps to set these values in a way that only applies while the map is loaded, and doesn't change the cvar value. (similar to the behaviour of the "fog" worldspawn key.) They are accepted with or without the underscore, like "fog".
see also:
http://forums.insideqc.com/viewtopic.php?f=3&t=5532
http://celephais.net/board/view_thread.php?id=60452&start=937
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1238 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-07-26 21:51:25 +00:00
extern float map_wateralpha , map_lavaalpha , map_telealpha , map_slimealpha ; //ericw
2017-09-17 02:12:53 +00:00
extern float map_fallbackalpha ; //spike -- because we might want r_wateralpha to apply to teleporters while water itself wasn't watervised
new cvars: r_lavaalpha, r_slimealpha, r_telealpha for fine-tuning specific liquid opacities (from DirectQ, RMQEngine)
new worldspawn keys: _wateralpha, _lavaalpha, _slimealpha, _telealpha, _skyfog (unique to Quakespasm)
The lava/slime/telealpha cvars are non-archived, and default to 0, which means to use the value of r_wateralpha, so they have no effect by default.
The worldspawn keys allow custom maps to set these values in a way that only applies while the map is loaded, and doesn't change the cvar value. (similar to the behaviour of the "fog" worldspawn key.) They are accepted with or without the underscore, like "fog".
see also:
http://forums.insideqc.com/viewtopic.php?f=3&t=5532
http://celephais.net/board/view_thread.php?id=60452&start=937
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1238 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-07-26 21:51:25 +00:00
2010-02-15 23:26:55 +00:00
//johnfitz -- fog functions called from outside gl_fog.c
void Fog_ParseServerMessage ( void ) ;
float * Fog_GetColor ( void ) ;
float Fog_GetDensity ( void ) ;
void Fog_EnableGFog ( void ) ;
void Fog_DisableGFog ( void ) ;
void Fog_StartAdditive ( void ) ;
void Fog_StopAdditive ( void ) ;
void Fog_SetupFrame ( void ) ;
void Fog_NewMap ( void ) ;
void Fog_Init ( void ) ;
2015-11-26 09:06:42 +00:00
void Fog_SetupState ( void ) ;
2017-09-17 02:12:53 +00:00
const char * Fog_GetFogCommand ( void ) ; //for demo recording
chase.c, cl_input.c, cl_parse.c, client.h, common.c, common.h, console.h,
cvar.h, draw.h, gl_draw.c, gl_fog.c, gl_mesh.c, gl_model.c, gl_model.h,
gl_rmain.c, gl_rmisc.c, gl_screen.c, gl_sky.c, gl_texmgr.c, glquake.h,
host.c, keys.c, keys.h, main.c, menu.c, menu.h, pr_cmds.c, quakedef.h,
r_alias.c, r_brush.c, r_part.c, r_sprite.c, r_world.c, sbar.c, sbar.h,
screen.h, snd_dma.c, snd_mem.c, snd_mix.c, sv_main.c, sys_sdl.c, vid.h,
view.h, world.c, world.h: Loads of warning fixes about missing function
prototypes, missing parens around &, missing braces leading to ambiguous
else statements and unused and uninitialized variables. There are still a
couple of unitialised variables here and there, but not much. The warnings
about strict aliasing violations need taking care of.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@21 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-16 12:01:07 +00:00
void R_NewGame ( void ) ;
2019-09-10 14:41:11 +00:00
void CL_UpdateLightstyle ( unsigned int idx , const char * stylestring ) ;
chase.c, cl_input.c, cl_parse.c, client.h, common.c, common.h, console.h,
cvar.h, draw.h, gl_draw.c, gl_fog.c, gl_mesh.c, gl_model.c, gl_model.h,
gl_rmain.c, gl_rmisc.c, gl_screen.c, gl_sky.c, gl_texmgr.c, glquake.h,
host.c, keys.c, keys.h, main.c, menu.c, menu.h, pr_cmds.c, quakedef.h,
r_alias.c, r_brush.c, r_part.c, r_sprite.c, r_world.c, sbar.c, sbar.h,
screen.h, snd_dma.c, snd_mem.c, snd_mix.c, sv_main.c, sys_sdl.c, vid.h,
view.h, world.c, world.h: Loads of warning fixes about missing function
prototypes, missing parens around &, missing braces leading to ambiguous
else statements and unused and uninitialized variables. There are still a
couple of unitialised variables here and there, but not much. The warnings
about strict aliasing violations need taking care of.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@21 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-16 12:01:07 +00:00
void R_AnimateLight ( void ) ;
void R_MarkSurfaces ( void ) ;
void R_CullSurfaces ( void ) ;
qboolean R_CullBox ( vec3_t emins , vec3_t emaxs ) ;
void R_StoreEfrags ( efrag_t * * ppefrag ) ;
qboolean R_CullModelForEntity ( entity_t * e ) ;
2017-09-17 02:12:53 +00:00
void R_RotateForEntity ( vec3_t origin , vec3_t angles , unsigned char scale ) ;
2018-05-25 10:54:33 +00:00
void R_MarkLights ( dlight_t * light , vec3_t lightorg , int num , mnode_t * node ) ;
chase.c, cl_input.c, cl_parse.c, client.h, common.c, common.h, console.h,
cvar.h, draw.h, gl_draw.c, gl_fog.c, gl_mesh.c, gl_model.c, gl_model.h,
gl_rmain.c, gl_rmisc.c, gl_screen.c, gl_sky.c, gl_texmgr.c, glquake.h,
host.c, keys.c, keys.h, main.c, menu.c, menu.h, pr_cmds.c, quakedef.h,
r_alias.c, r_brush.c, r_part.c, r_sprite.c, r_world.c, sbar.c, sbar.h,
screen.h, snd_dma.c, snd_mem.c, snd_mix.c, sv_main.c, sys_sdl.c, vid.h,
view.h, world.c, world.h: Loads of warning fixes about missing function
prototypes, missing parens around &, missing braces leading to ambiguous
else statements and unused and uninitialized variables. There are still a
couple of unitialised variables here and there, but not much. The warnings
about strict aliasing violations need taking care of.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@21 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-16 12:01:07 +00:00
void R_InitParticles ( void ) ;
void R_DrawParticles ( void ) ;
void CL_RunParticles ( void ) ;
void R_ClearParticles ( void ) ;
void R_TranslatePlayerSkin ( int playernum ) ;
void R_TranslateNewPlayerSkin ( int playernum ) ; //johnfitz -- this handles cases when the actual texture changes
void R_UpdateWarpTextures ( void ) ;
void R_DrawWorld ( void ) ;
void R_DrawAliasModel ( entity_t * e ) ;
void R_DrawBrushModel ( entity_t * e ) ;
void R_DrawSpriteModel ( entity_t * e ) ;
2014-08-29 08:27:22 +00:00
void R_DrawTextureChains_Water ( qmodel_t * model , entity_t * ent , texchain_t chain ) ;
chase.c, cl_input.c, cl_parse.c, client.h, common.c, common.h, console.h,
cvar.h, draw.h, gl_draw.c, gl_fog.c, gl_mesh.c, gl_model.c, gl_model.h,
gl_rmain.c, gl_rmisc.c, gl_screen.c, gl_sky.c, gl_texmgr.c, glquake.h,
host.c, keys.c, keys.h, main.c, menu.c, menu.h, pr_cmds.c, quakedef.h,
r_alias.c, r_brush.c, r_part.c, r_sprite.c, r_world.c, sbar.c, sbar.h,
screen.h, snd_dma.c, snd_mem.c, snd_mix.c, sv_main.c, sys_sdl.c, vid.h,
view.h, world.c, world.h: Loads of warning fixes about missing function
prototypes, missing parens around &, missing braces leading to ambiguous
else statements and unused and uninitialized variables. There are still a
couple of unitialised variables here and there, but not much. The warnings
about strict aliasing violations need taking care of.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@21 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-16 12:01:07 +00:00
void R_RenderDlights ( void ) ;
2020-09-03 10:39:38 +00:00
void GL_BuildModel ( qmodel_t * m ) ;
chase.c, cl_input.c, cl_parse.c, client.h, common.c, common.h, console.h,
cvar.h, draw.h, gl_draw.c, gl_fog.c, gl_mesh.c, gl_model.c, gl_model.h,
gl_rmain.c, gl_rmisc.c, gl_screen.c, gl_sky.c, gl_texmgr.c, glquake.h,
host.c, keys.c, keys.h, main.c, menu.c, menu.h, pr_cmds.c, quakedef.h,
r_alias.c, r_brush.c, r_part.c, r_sprite.c, r_world.c, sbar.c, sbar.h,
screen.h, snd_dma.c, snd_mem.c, snd_mix.c, sv_main.c, sys_sdl.c, vid.h,
view.h, world.c, world.h: Loads of warning fixes about missing function
prototypes, missing parens around &, missing braces leading to ambiguous
else statements and unused and uninitialized variables. There are still a
couple of unitialised variables here and there, but not much. The warnings
about strict aliasing violations need taking care of.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@21 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-16 12:01:07 +00:00
void GL_BuildLightmaps ( void ) ;
2015-09-20 20:10:49 +00:00
void GL_DeleteBModelVertexBuffer ( void ) ;
void GL_BuildBModelVertexBuffer ( void ) ;
Alias model rendering fast-path using OpenGL 2.
In GL_MakeAliasModelDisplayLists, after saving the standerd triangle strips and fans onto the hunk, if the system is GL2 capable, we also save a second version of the mdl on the hunk designed to be loaded into a VBO (GL_MakeAliasModelDisplayLists_VBO). In R_NewMap, and on video mode changes, we call GLMesh_LoadVertexBuffers which loops over all precached mdl's and loads the data into a pair of VBO's (vertices and vertex indices).
Finally, in R_DrawAliasModel, assuming no rendering options are disabling the fast-path (r_drawflat 1, r_lightmap 1, or r_fullbright 1 would disable it), we call GL_DrawAliasFrame_GLSL, which sets up all of the bindings and draws the (possibly lerped) mdl in one glDrawElements call.
Special thanks to MH for some of the code from RMQEngine and the general concept.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1151 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-01-20 18:59:15 +00:00
void GLMesh_LoadVertexBuffers ( void ) ;
2015-09-20 20:10:49 +00:00
void GLMesh_DeleteVertexBuffers ( void ) ;
2017-09-17 02:12:53 +00:00
void GLMesh_LoadVertexBuffer ( qmodel_t * m , aliashdr_t * hdr ) ;
chase.c, cl_input.c, cl_parse.c, client.h, common.c, common.h, console.h,
cvar.h, draw.h, gl_draw.c, gl_fog.c, gl_mesh.c, gl_model.c, gl_model.h,
gl_rmain.c, gl_rmisc.c, gl_screen.c, gl_sky.c, gl_texmgr.c, glquake.h,
host.c, keys.c, keys.h, main.c, menu.c, menu.h, pr_cmds.c, quakedef.h,
r_alias.c, r_brush.c, r_part.c, r_sprite.c, r_world.c, sbar.c, sbar.h,
screen.h, snd_dma.c, snd_mem.c, snd_mix.c, sv_main.c, sys_sdl.c, vid.h,
view.h, world.c, world.h: Loads of warning fixes about missing function
prototypes, missing parens around &, missing braces leading to ambiguous
else statements and unused and uninitialized variables. There are still a
couple of unitialised variables here and there, but not much. The warnings
about strict aliasing violations need taking care of.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@21 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-16 12:01:07 +00:00
void R_RebuildAllLightmaps ( void ) ;
int R_LightPoint ( vec3_t p ) ;
void GL_SubdivideSurface ( msurface_t * fa ) ;
2017-09-17 02:12:53 +00:00
void R_BuildLightMap ( qmodel_t * model , msurface_t * surf , byte * dest , int stride ) ;
void R_RenderDynamicLightmaps ( qmodel_t * model , msurface_t * fa ) ;
2014-07-12 07:50:57 +00:00
void R_UploadLightmaps ( void ) ;
chase.c, cl_input.c, cl_parse.c, client.h, common.c, common.h, console.h,
cvar.h, draw.h, gl_draw.c, gl_fog.c, gl_mesh.c, gl_model.c, gl_model.h,
gl_rmain.c, gl_rmisc.c, gl_screen.c, gl_sky.c, gl_texmgr.c, glquake.h,
host.c, keys.c, keys.h, main.c, menu.c, menu.h, pr_cmds.c, quakedef.h,
r_alias.c, r_brush.c, r_part.c, r_sprite.c, r_world.c, sbar.c, sbar.h,
screen.h, snd_dma.c, snd_mem.c, snd_mix.c, sv_main.c, sys_sdl.c, vid.h,
view.h, world.c, world.h: Loads of warning fixes about missing function
prototypes, missing parens around &, missing braces leading to ambiguous
else statements and unused and uninitialized variables. There are still a
couple of unitialised variables here and there, but not much. The warnings
about strict aliasing violations need taking care of.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@21 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-16 12:01:07 +00:00
2014-08-29 08:27:22 +00:00
void R_DrawWorld_ShowTris ( void ) ;
chase.c, cl_input.c, cl_parse.c, client.h, common.c, common.h, console.h,
cvar.h, draw.h, gl_draw.c, gl_fog.c, gl_mesh.c, gl_model.c, gl_model.h,
gl_rmain.c, gl_rmisc.c, gl_screen.c, gl_sky.c, gl_texmgr.c, glquake.h,
host.c, keys.c, keys.h, main.c, menu.c, menu.h, pr_cmds.c, quakedef.h,
r_alias.c, r_brush.c, r_part.c, r_sprite.c, r_world.c, sbar.c, sbar.h,
screen.h, snd_dma.c, snd_mem.c, snd_mix.c, sv_main.c, sys_sdl.c, vid.h,
view.h, world.c, world.h: Loads of warning fixes about missing function
prototypes, missing parens around &, missing braces leading to ambiguous
else statements and unused and uninitialized variables. There are still a
couple of unitialised variables here and there, but not much. The warnings
about strict aliasing violations need taking care of.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@21 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-16 12:01:07 +00:00
void R_DrawBrushModel_ShowTris ( entity_t * e ) ;
void R_DrawAliasModel_ShowTris ( entity_t * e ) ;
void R_DrawParticles_ShowTris ( void ) ;
2015-01-25 20:29:30 +00:00
GLint GL_GetUniformLocation ( GLuint * programPtr , const char * name ) ;
Alias model rendering fast-path using OpenGL 2.
In GL_MakeAliasModelDisplayLists, after saving the standerd triangle strips and fans onto the hunk, if the system is GL2 capable, we also save a second version of the mdl on the hunk designed to be loaded into a VBO (GL_MakeAliasModelDisplayLists_VBO). In R_NewMap, and on video mode changes, we call GLMesh_LoadVertexBuffers which loops over all precached mdl's and loads the data into a pair of VBO's (vertices and vertex indices).
Finally, in R_DrawAliasModel, assuming no rendering options are disabling the fast-path (r_drawflat 1, r_lightmap 1, or r_fullbright 1 would disable it), we call GL_DrawAliasFrame_GLSL, which sets up all of the bindings and draws the (possibly lerped) mdl in one glDrawElements call.
Special thanks to MH for some of the code from RMQEngine and the general concept.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1151 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-01-20 18:59:15 +00:00
GLuint GL_CreateProgram ( const GLchar * vertSource , const GLchar * fragSource , int numbindings , const glsl_attrib_binding_t * bindings ) ;
void R_DeleteShaders ( void ) ;
2017-11-01 04:01:02 +00:00
void GLWorld_CreateShaders ( void ) ;
Alias model rendering fast-path using OpenGL 2.
In GL_MakeAliasModelDisplayLists, after saving the standerd triangle strips and fans onto the hunk, if the system is GL2 capable, we also save a second version of the mdl on the hunk designed to be loaded into a VBO (GL_MakeAliasModelDisplayLists_VBO). In R_NewMap, and on video mode changes, we call GLMesh_LoadVertexBuffers which loops over all precached mdl's and loads the data into a pair of VBO's (vertices and vertex indices).
Finally, in R_DrawAliasModel, assuming no rendering options are disabling the fast-path (r_drawflat 1, r_lightmap 1, or r_fullbright 1 would disable it), we call GL_DrawAliasFrame_GLSL, which sets up all of the bindings and draws the (possibly lerped) mdl in one glDrawElements call.
Special thanks to MH for some of the code from RMQEngine and the general concept.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1151 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-01-20 18:59:15 +00:00
void GLAlias_CreateShaders ( void ) ;
chase.c, cl_input.c, cl_parse.c, client.h, common.c, common.h, console.h,
cvar.h, draw.h, gl_draw.c, gl_fog.c, gl_mesh.c, gl_model.c, gl_model.h,
gl_rmain.c, gl_rmisc.c, gl_screen.c, gl_sky.c, gl_texmgr.c, glquake.h,
host.c, keys.c, keys.h, main.c, menu.c, menu.h, pr_cmds.c, quakedef.h,
r_alias.c, r_brush.c, r_part.c, r_sprite.c, r_world.c, sbar.c, sbar.h,
screen.h, snd_dma.c, snd_mem.c, snd_mix.c, sv_main.c, sys_sdl.c, vid.h,
view.h, world.c, world.h: Loads of warning fixes about missing function
prototypes, missing parens around &, missing braces leading to ambiguous
else statements and unused and uninitialized variables. There are still a
couple of unitialised variables here and there, but not much. The warnings
about strict aliasing violations need taking care of.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@21 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-16 12:01:07 +00:00
void GL_DrawAliasShadow ( entity_t * e ) ;
void DrawGLTriangleFan ( glpoly_t * p ) ;
void DrawGLPoly ( glpoly_t * p ) ;
void DrawWaterPoly ( glpoly_t * p ) ;
2012-05-30 08:56:06 +00:00
void GL_MakeAliasModelDisplayLists ( qmodel_t * m , aliashdr_t * hdr ) ;
chase.c, cl_input.c, cl_parse.c, client.h, common.c, common.h, console.h,
cvar.h, draw.h, gl_draw.c, gl_fog.c, gl_mesh.c, gl_model.c, gl_model.h,
gl_rmain.c, gl_rmisc.c, gl_screen.c, gl_sky.c, gl_texmgr.c, glquake.h,
host.c, keys.c, keys.h, main.c, menu.c, menu.h, pr_cmds.c, quakedef.h,
r_alias.c, r_brush.c, r_part.c, r_sprite.c, r_world.c, sbar.c, sbar.h,
screen.h, snd_dma.c, snd_mem.c, snd_mix.c, sv_main.c, sys_sdl.c, vid.h,
view.h, world.c, world.h: Loads of warning fixes about missing function
prototypes, missing parens around &, missing braces leading to ambiguous
else statements and unused and uninitialized variables. There are still a
couple of unitialised variables here and there, but not much. The warnings
about strict aliasing violations need taking care of.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@21 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-16 12:01:07 +00:00
void Sky_Init ( void ) ;
void Sky_DrawSky ( void ) ;
void Sky_NewMap ( void ) ;
2020-03-07 09:03:46 +00:00
void Sky_LoadTexture ( texture_t * mt , enum srcformat fmt , unsigned int width , unsigned int height ) ;
2010-08-29 02:22:55 +00:00
void Sky_LoadSkyBox ( const char * name ) ;
2021-06-25 18:15:10 +00:00
extern qboolean skyroom_drawn , skyroom_drawing ; //we draw a skyroom this frame
2019-09-10 17:58:03 +00:00
extern qboolean skyroom_enabled ; //we know where the skyroom is ...
2019-11-02 20:22:54 +00:00
extern vec4_t skyroom_origin ; //... and it is here. [3] is paralax scale
extern vec4_t skyroom_orientation ;
chase.c, cl_input.c, cl_parse.c, client.h, common.c, common.h, console.h,
cvar.h, draw.h, gl_draw.c, gl_fog.c, gl_mesh.c, gl_model.c, gl_model.h,
gl_rmain.c, gl_rmisc.c, gl_screen.c, gl_sky.c, gl_texmgr.c, glquake.h,
host.c, keys.c, keys.h, main.c, menu.c, menu.h, pr_cmds.c, quakedef.h,
r_alias.c, r_brush.c, r_part.c, r_sprite.c, r_world.c, sbar.c, sbar.h,
screen.h, snd_dma.c, snd_mem.c, snd_mix.c, sv_main.c, sys_sdl.c, vid.h,
view.h, world.c, world.h: Loads of warning fixes about missing function
prototypes, missing parens around &, missing braces leading to ambiguous
else statements and unused and uninitialized variables. There are still a
couple of unitialised variables here and there, but not much. The warnings
about strict aliasing violations need taking care of.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@21 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-16 12:01:07 +00:00
void TexMgr_RecalcWarpImageSize ( void ) ;
2014-08-29 08:27:22 +00:00
void R_ClearTextureChains ( qmodel_t * mod , texchain_t chain ) ;
void R_ChainSurface ( msurface_t * surf , texchain_t chain ) ;
void R_DrawTextureChains ( qmodel_t * model , entity_t * ent , texchain_t chain ) ;
void R_DrawWorld_Water ( void ) ;
Alias model rendering fast-path using OpenGL 2.
In GL_MakeAliasModelDisplayLists, after saving the standerd triangle strips and fans onto the hunk, if the system is GL2 capable, we also save a second version of the mdl on the hunk designed to be loaded into a VBO (GL_MakeAliasModelDisplayLists_VBO). In R_NewMap, and on video mode changes, we call GLMesh_LoadVertexBuffers which loops over all precached mdl's and loads the data into a pair of VBO's (vertices and vertex indices).
Finally, in R_DrawAliasModel, assuming no rendering options are disabling the fast-path (r_drawflat 1, r_lightmap 1, or r_fullbright 1 would disable it), we call GL_DrawAliasFrame_GLSL, which sets up all of the bindings and draws the (possibly lerped) mdl in one glDrawElements call.
Special thanks to MH for some of the code from RMQEngine and the general concept.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1151 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-01-20 18:59:15 +00:00
void GL_BindBuffer ( GLenum target , GLuint buffer ) ;
void GL_ClearBufferBindings ( ) ;
2015-01-26 20:18:45 +00:00
void GLSLGamma_DeleteTexture ( void ) ;
void GLSLGamma_GammaCorrect ( void ) ;
2017-05-26 20:37:48 +00:00
void R_ScaleView_DeleteTexture ( void ) ;
new cvars: r_lavaalpha, r_slimealpha, r_telealpha for fine-tuning specific liquid opacities (from DirectQ, RMQEngine)
new worldspawn keys: _wateralpha, _lavaalpha, _slimealpha, _telealpha, _skyfog (unique to Quakespasm)
The lava/slime/telealpha cvars are non-archived, and default to 0, which means to use the value of r_wateralpha, so they have no effect by default.
The worldspawn keys allow custom maps to set these values in a way that only applies while the map is loaded, and doesn't change the cvar value. (similar to the behaviour of the "fog" worldspawn key.) They are accepted with or without the underscore, like "fog".
see also:
http://forums.insideqc.com/viewtopic.php?f=3&t=5532
http://celephais.net/board/view_thread.php?id=60452&start=937
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1238 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-07-26 21:51:25 +00:00
float GL_WaterAlphaForSurface ( msurface_t * fa ) ;
bspfile.h, cdaudio.h, client.h, cmd.h, common.h, console.h, crc.h, cvar.h,
d_ifacea.h, draw.h, gl_texmgr.h, glquake.h, image.h, input.h, keys.h, mathlib.h,
menu.h, modelgen.h, net.h, net_dgrm.h, net_loop.h, net_sdlnet.h, net_udp.h,
net_wins.h, platform.h, pr_comp.h, progdefs.h, progs.h, protocol.h, quakedef.h,
render.h, resource.h, sbar.h, screen.h, server.h, sound.h, spritegn.h, sys.h,
vid.h, view.h, wad.h, world.h, zone.h: added include guards to the headers.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@84 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-21 00:01:08 +00:00
# endif /* __GLQUAKE_H */