From 7b1fa0e3cc8c106a08ab8d7e12a0c40d2e2a7791 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Fri, 12 Jun 2015 14:22:37 -0500 Subject: Move image load function prototypes to tr_common.h The functions themselves are in code/renderercommon/tr_image_*.c --- src/renderergl2/tr_local.h | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'src/renderergl2/tr_local.h') diff --git a/src/renderergl2/tr_local.h b/src/renderergl2/tr_local.h index 95d87165..76cbe9c7 100644 --- a/src/renderergl2/tr_local.h +++ b/src/renderergl2/tr_local.h @@ -2278,20 +2278,6 @@ int R_IQMLerpTag( orientation_t *tag, iqmData_t *data, int startFrame, int endFrame, float frac, const char *tagName ); -/* -============================================================= - -IMAGE LOADERS - -============================================================= -*/ - -void R_LoadBMP( const char *name, byte **pic, int *width, int *height ); -void R_LoadJPG( const char *name, byte **pic, int *width, int *height ); -void R_LoadPCX( const char *name, byte **pic, int *width, int *height ); -void R_LoadPNG( const char *name, byte **pic, int *width, int *height ); -void R_LoadTGA( const char *name, byte **pic, int *width, int *height ); - /* ============================================================= ============================================================= -- cgit From e8a31f6a628ca309d1c5119d6d52c391e225445d Mon Sep 17 00:00:00 2001 From: SmileTheory Date: Thu, 3 Dec 2015 02:44:33 -0800 Subject: OpenGL2: Remove some rendering options for simplicity. --- src/renderergl2/tr_local.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/renderergl2/tr_local.h') diff --git a/src/renderergl2/tr_local.h b/src/renderergl2/tr_local.h index 76cbe9c7..02d0887e 100644 --- a/src/renderergl2/tr_local.h +++ b/src/renderergl2/tr_local.h @@ -1786,7 +1786,6 @@ extern cvar_t *r_specularMapping; extern cvar_t *r_deluxeMapping; extern cvar_t *r_parallaxMapping; extern cvar_t *r_cubeMapping; -extern cvar_t *r_deluxeSpecular; extern cvar_t *r_specularIsMetallic; extern cvar_t *r_baseNormalX; extern cvar_t *r_baseNormalY; -- cgit From 3372e9eaf5c21e1e44f000e09a94584231ba9550 Mon Sep 17 00:00:00 2001 From: SmileTheory Date: Tue, 8 Dec 2015 05:17:05 -0800 Subject: OpenGL2: Add option in code for alternate overbright method. --- src/renderergl2/tr_local.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/renderergl2/tr_local.h') diff --git a/src/renderergl2/tr_local.h b/src/renderergl2/tr_local.h index 02d0887e..a38cf7fc 100644 --- a/src/renderergl2/tr_local.h +++ b/src/renderergl2/tr_local.h @@ -59,6 +59,7 @@ typedef unsigned int glIndex_t; #define CUBE_MAP_SIZE (1 << CUBE_MAP_MIPS) #define USE_VERT_TANGENT_SPACE +#define USE_OVERBRIGHT typedef struct dlight_s { vec3_t origin; -- cgit From e3ac1437c4e4df764cc3279324fab7e3ee032e2a Mon Sep 17 00:00:00 2001 From: SmileTheory Date: Tue, 8 Dec 2015 21:23:50 -0800 Subject: OpenGL2: Add r_glossIsRoughness. --- src/renderergl2/tr_local.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/renderergl2/tr_local.h') diff --git a/src/renderergl2/tr_local.h b/src/renderergl2/tr_local.h index a38cf7fc..f69aec19 100644 --- a/src/renderergl2/tr_local.h +++ b/src/renderergl2/tr_local.h @@ -1788,6 +1788,7 @@ extern cvar_t *r_deluxeMapping; extern cvar_t *r_parallaxMapping; extern cvar_t *r_cubeMapping; extern cvar_t *r_specularIsMetallic; +extern cvar_t *r_glossIsRoughness; extern cvar_t *r_baseNormalX; extern cvar_t *r_baseNormalY; extern cvar_t *r_baseParallax; -- cgit From 6f6ca6d529e1739565dbc64891fa7f1b478b8460 Mon Sep 17 00:00:00 2001 From: SmileTheory Date: Wed, 9 Dec 2015 02:00:40 -0800 Subject: OpenGL2: Parse radius entries from misc_cubemap entities. --- src/renderergl2/tr_local.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/renderergl2/tr_local.h') diff --git a/src/renderergl2/tr_local.h b/src/renderergl2/tr_local.h index f69aec19..73681f32 100644 --- a/src/renderergl2/tr_local.h +++ b/src/renderergl2/tr_local.h @@ -61,6 +61,12 @@ typedef unsigned int glIndex_t; #define USE_VERT_TANGENT_SPACE #define USE_OVERBRIGHT +typedef struct cubemap_s { + vec3_t origin; + float parallaxRadius; + image_t *image; +} cubemap_t; + typedef struct dlight_s { vec3_t origin; vec3_t color; // range from 0.0 to 1.0, should be color normalized @@ -1561,8 +1567,7 @@ typedef struct { int fatLightmapStep; int numCubemaps; - vec3_t *cubemapOrigins; - image_t **cubemaps; + cubemap_t *cubemaps; trRefEntity_t *currentEntity; trRefEntity_t worldEntity; // point currentEntity at this when rendering world -- cgit From f77b9694e3d2870f62b27589c70c2cf254248db3 Mon Sep 17 00:00:00 2001 From: SmileTheory Date: Tue, 15 Dec 2015 03:23:55 -0800 Subject: OpenGL2: Switch to RGTC from LATC for normal maps. Also added a RGTC compressor as a workaround on Intel graphics. --- src/renderergl2/tr_local.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/renderergl2/tr_local.h') diff --git a/src/renderergl2/tr_local.h b/src/renderergl2/tr_local.h index 73681f32..0a1dc5fe 100644 --- a/src/renderergl2/tr_local.h +++ b/src/renderergl2/tr_local.h @@ -1381,7 +1381,7 @@ typedef enum { typedef enum { TCR_NONE = 0x0000, - TCR_LATC = 0x0001, + TCR_RGTC = 0x0001, TCR_BPTC = 0x0002, } textureCompressionRef_t; @@ -1405,7 +1405,9 @@ typedef struct { qboolean textureFloat; qboolean halfFloatPixel; qboolean packedDepthStencil; + qboolean arbTextureCompression; textureCompressionRef_t textureCompression; + qboolean swizzleNormalmap; qboolean framebufferMultisample; qboolean framebufferBlit; -- cgit From 19c44d9c50d6a3057e79007c779552d0eb7fe4ef Mon Sep 17 00:00:00 2001 From: SmileTheory Date: Tue, 22 Dec 2015 05:04:07 -0800 Subject: OpenGL2: Add r_exportCubemaps for saving cubemaps on map load. --- src/renderergl2/tr_local.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/renderergl2/tr_local.h') diff --git a/src/renderergl2/tr_local.h b/src/renderergl2/tr_local.h index 0a1dc5fe..f716065e 100644 --- a/src/renderergl2/tr_local.h +++ b/src/renderergl2/tr_local.h @@ -1794,6 +1794,7 @@ extern cvar_t *r_specularMapping; extern cvar_t *r_deluxeMapping; extern cvar_t *r_parallaxMapping; extern cvar_t *r_cubeMapping; +extern cvar_t *r_exportCubemaps; extern cvar_t *r_specularIsMetallic; extern cvar_t *r_glossIsRoughness; extern cvar_t *r_baseNormalX; -- cgit From cedfa02c6b3b17cda26202abf5e4dd32f9720cb5 Mon Sep 17 00:00:00 2001 From: SmileTheory Date: Wed, 23 Dec 2015 09:58:11 -0800 Subject: OpenGL2: Replace r_exportCubemaps cvar with exportCubemaps command. --- src/renderergl2/tr_local.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/renderergl2/tr_local.h') diff --git a/src/renderergl2/tr_local.h b/src/renderergl2/tr_local.h index f716065e..a652a396 100644 --- a/src/renderergl2/tr_local.h +++ b/src/renderergl2/tr_local.h @@ -1794,7 +1794,6 @@ extern cvar_t *r_specularMapping; extern cvar_t *r_deluxeMapping; extern cvar_t *r_parallaxMapping; extern cvar_t *r_cubeMapping; -extern cvar_t *r_exportCubemaps; extern cvar_t *r_specularIsMetallic; extern cvar_t *r_glossIsRoughness; extern cvar_t *r_baseNormalX; @@ -2422,6 +2421,10 @@ typedef struct { viewParms_t viewParms; } postProcessCommand_t; +typedef struct { + int commandId; +} exportCubemapsCommand_t; + typedef enum { RC_END_OF_LIST, RC_SET_COLOR, @@ -2434,7 +2437,8 @@ typedef enum { RC_COLORMASK, RC_CLEARDEPTH, RC_CAPSHADOWMAP, - RC_POSTPROCESS + RC_POSTPROCESS, + RC_EXPORT_CUBEMAPS } renderCommand_t; -- cgit From fae2cb94e089fabe9a69d0909a5c25e1014cb25f Mon Sep 17 00:00:00 2001 From: SmileTheory Date: Thu, 24 Dec 2015 16:34:58 -0800 Subject: OpenGL2: Add r_cubemapSize. --- src/renderergl2/tr_local.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/renderergl2/tr_local.h') diff --git a/src/renderergl2/tr_local.h b/src/renderergl2/tr_local.h index a652a396..72f11989 100644 --- a/src/renderergl2/tr_local.h +++ b/src/renderergl2/tr_local.h @@ -55,8 +55,6 @@ typedef unsigned int glIndex_t; #define MAX_CALC_PSHADOWS 64 #define MAX_DRAWN_PSHADOWS 16 // do not increase past 32, because bit flags are used on surfaces #define PSHADOW_MAP_SIZE 512 -#define CUBE_MAP_MIPS 7 -#define CUBE_MAP_SIZE (1 << CUBE_MAP_MIPS) #define USE_VERT_TANGENT_SPACE #define USE_OVERBRIGHT @@ -1794,6 +1792,7 @@ extern cvar_t *r_specularMapping; extern cvar_t *r_deluxeMapping; extern cvar_t *r_parallaxMapping; extern cvar_t *r_cubeMapping; +extern cvar_t *r_cubemapSize; extern cvar_t *r_specularIsMetallic; extern cvar_t *r_glossIsRoughness; extern cvar_t *r_baseNormalX; -- cgit From 970b21fbcd3d42e641807ac0c5e9a29dc21095e9 Mon Sep 17 00:00:00 2001 From: SmileTheory Date: Mon, 18 Jan 2016 04:46:01 -0800 Subject: OpenGL2: Direct state access, part 1: Texture binds --- src/renderergl2/tr_local.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/renderergl2/tr_local.h') diff --git a/src/renderergl2/tr_local.h b/src/renderergl2/tr_local.h index 72f11989..0dd61674 100644 --- a/src/renderergl2/tr_local.h +++ b/src/renderergl2/tr_local.h @@ -1352,8 +1352,6 @@ typedef struct { // the renderer front end should never modify glstate_t typedef struct { - int currenttextures[NUM_TEXTURE_BUNDLES]; - int currenttmu; qboolean finishCalled; int texEnv[2]; int faceCulling; @@ -1421,6 +1419,7 @@ typedef struct { qboolean floatLightmap; qboolean vertexArrayObject; + qboolean directStateAccess; } glRefConfig_t; @@ -1720,6 +1719,7 @@ extern cvar_t *r_ext_framebuffer_multisample; extern cvar_t *r_arb_seamless_cube_map; extern cvar_t *r_arb_vertex_type_2_10_10_10_rev; extern cvar_t *r_arb_vertex_array_object; +extern cvar_t *r_ext_direct_state_access; extern cvar_t *r_nobind; // turns off binding to appropriate textures extern cvar_t *r_singleShader; // make most world faces use default shader @@ -1884,17 +1884,14 @@ void R_RotateForEntity( const trRefEntity_t *ent, const viewParms_t *viewParms, /* ** GL wrapper/helper functions */ -void GL_Bind( image_t *image ); void GL_BindToTMU( image_t *image, int tmu ); void GL_SetDefaultState (void); -void GL_SelectTexture( int unit ); void GL_TextureMode( const char *string ); void GL_CheckErrs( char *file, int line ); #define GL_CheckErrors(...) GL_CheckErrs(__FILE__, __LINE__) void GL_State( unsigned long stateVector ); void GL_SetProjectionMatrix(mat4_t matrix); void GL_SetModelviewMatrix(mat4_t matrix); -void GL_TexEnv( int env ); void GL_Cull( int cullType ); #define GLS_SRCBLEND_ZERO 0x00000001 -- cgit From 95633de9cb7414060e6d7c1102dd85385f203311 Mon Sep 17 00:00:00 2001 From: SmileTheory Date: Mon, 18 Jan 2016 23:30:36 -0800 Subject: OpenGL2: Direct state access, part 2: Uniforms. --- src/renderergl2/tr_local.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/renderergl2/tr_local.h') diff --git a/src/renderergl2/tr_local.h b/src/renderergl2/tr_local.h index 0dd61674..f56d5f51 100644 --- a/src/renderergl2/tr_local.h +++ b/src/renderergl2/tr_local.h @@ -1361,7 +1361,6 @@ typedef struct { float vertexAttribsInterpolation; qboolean vertexAnimation; uint32_t vertexAttribsEnabled; // global if no VAOs, tess only otherwise - shaderProgram_t *currentProgram; FBO_t *currentFBO; vao_t *currentVao; mat4_t modelview; @@ -2215,7 +2214,6 @@ void GLSL_InitGPUShaders(void); void GLSL_ShutdownGPUShaders(void); void GLSL_VertexAttribPointers(uint32_t attribBits); void GLSL_BindProgram(shaderProgram_t * program); -void GLSL_BindNullProgram(void); void GLSL_SetUniformInt(shaderProgram_t *program, int uniformNum, GLint value); void GLSL_SetUniformFloat(shaderProgram_t *program, int uniformNum, GLfloat value); -- cgit From d5ba7bb70ef327c8856165475b58e946c8fbd8ce Mon Sep 17 00:00:00 2001 From: SmileTheory Date: Mon, 1 Feb 2016 21:37:23 -0800 Subject: OpenGL2: Merge several cvars into r_pbr. r_glossIsRoughness, r_specularIsMetallic, r_framebufferGamma, r_tonemapGamma, r_materialGamma, r_lightGamma --- src/renderergl2/tr_local.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/renderergl2/tr_local.h') diff --git a/src/renderergl2/tr_local.h b/src/renderergl2/tr_local.h index f56d5f51..9da87e6e 100644 --- a/src/renderergl2/tr_local.h +++ b/src/renderergl2/tr_local.h @@ -1778,11 +1778,6 @@ extern cvar_t *r_forceAutoExposureMax; extern cvar_t *r_cameraExposure; -extern cvar_t *r_materialGamma; -extern cvar_t *r_lightGamma; -extern cvar_t *r_framebufferGamma; -extern cvar_t *r_tonemapGamma; - extern cvar_t *r_depthPrepass; extern cvar_t *r_ssao; @@ -1792,8 +1787,7 @@ extern cvar_t *r_deluxeMapping; extern cvar_t *r_parallaxMapping; extern cvar_t *r_cubeMapping; extern cvar_t *r_cubemapSize; -extern cvar_t *r_specularIsMetallic; -extern cvar_t *r_glossIsRoughness; +extern cvar_t *r_pbr; extern cvar_t *r_baseNormalX; extern cvar_t *r_baseNormalY; extern cvar_t *r_baseParallax; -- cgit From e4a4b0b57899bde1f35565e18bcb9bb1b06f6320 Mon Sep 17 00:00:00 2001 From: SmileTheory Date: Wed, 10 Feb 2016 16:25:32 -0800 Subject: OpenGL2: Add named cubemaps and per-map env.json parsing. --- src/renderergl2/tr_local.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/renderergl2/tr_local.h') diff --git a/src/renderergl2/tr_local.h b/src/renderergl2/tr_local.h index 9da87e6e..62bf1e03 100644 --- a/src/renderergl2/tr_local.h +++ b/src/renderergl2/tr_local.h @@ -60,6 +60,7 @@ typedef unsigned int glIndex_t; #define USE_OVERBRIGHT typedef struct cubemap_s { + char name[MAX_QPATH]; vec3_t origin; float parallaxRadius; image_t *image; -- cgit From 5d1223366351d7ed9ee537d8f4245ab29b550d2c Mon Sep 17 00:00:00 2001 From: SmileTheory Date: Mon, 7 Mar 2016 02:27:03 -0800 Subject: OpenGL2: Add r_shadowBlur. --- src/renderergl2/tr_local.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/renderergl2/tr_local.h') diff --git a/src/renderergl2/tr_local.h b/src/renderergl2/tr_local.h index 62bf1e03..e2a3fe17 100644 --- a/src/renderergl2/tr_local.h +++ b/src/renderergl2/tr_local.h @@ -1521,6 +1521,7 @@ typedef struct { image_t *sunRaysImage; image_t *renderDepthImage; image_t *pshadowMaps[MAX_DRAWN_PSHADOWS]; + image_t *screenScratchImage; image_t *textureScratchImage[2]; image_t *quarterImage[2]; image_t *calcLevelsImage; @@ -1539,6 +1540,7 @@ typedef struct { FBO_t *sunRaysFbo; FBO_t *depthFbo; FBO_t *pshadowFbos[MAX_DRAWN_PSHADOWS]; + FBO_t *screenScratchFbo; FBO_t *textureScratchFbo[2]; FBO_t *quarterFbo[2]; FBO_t *calcLevelsFbo; @@ -1809,6 +1811,7 @@ extern cvar_t *r_sunlightMode; extern cvar_t *r_drawSunRays; extern cvar_t *r_sunShadows; extern cvar_t *r_shadowFilter; +extern cvar_t *r_shadowBlur; extern cvar_t *r_shadowMapSize; extern cvar_t *r_shadowCascadeZNear; extern cvar_t *r_shadowCascadeZFar; -- cgit From 7c858dafb7941be2ea6522a2a267252abf2d4fe7 Mon Sep 17 00:00:00 2001 From: SmileTheory Date: Mon, 7 Mar 2016 03:30:16 -0800 Subject: OpenGL2: Add r_glossType. --- src/renderergl2/tr_local.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/renderergl2/tr_local.h') diff --git a/src/renderergl2/tr_local.h b/src/renderergl2/tr_local.h index e2a3fe17..d11c4870 100644 --- a/src/renderergl2/tr_local.h +++ b/src/renderergl2/tr_local.h @@ -1796,6 +1796,7 @@ extern cvar_t *r_baseNormalY; extern cvar_t *r_baseParallax; extern cvar_t *r_baseSpecular; extern cvar_t *r_baseGloss; +extern cvar_t *r_glossType; extern cvar_t *r_dlightMode; extern cvar_t *r_pshadowDist; extern cvar_t *r_mergeLightmaps; -- cgit From e1c7b8c9bd19f0e4d9b763d1f30c175e49c5397d Mon Sep 17 00:00:00 2001 From: SmileTheory Date: Tue, 5 Apr 2016 02:37:05 -0700 Subject: OpenGL2: Some FBO cleanup, and add non-depth blur to blur shader. --- src/renderergl2/tr_local.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/renderergl2/tr_local.h') diff --git a/src/renderergl2/tr_local.h b/src/renderergl2/tr_local.h index d11c4870..5af67a13 100644 --- a/src/renderergl2/tr_local.h +++ b/src/renderergl2/tr_local.h @@ -1592,7 +1592,7 @@ typedef struct { shaderProgram_t calclevels4xShader[2]; shaderProgram_t shadowmaskShader; shaderProgram_t ssaoShader; - shaderProgram_t depthBlurShader[2]; + shaderProgram_t depthBlurShader[4]; shaderProgram_t testcubeShader; -- cgit