Latest changes

Latest changes

diff --git a/src/engine/GPURenderer/r_bsp_tech3.cpp b/src/engine/GPURenderer/r_bsp_tech3.cpp
index d528b9d..b919e6f 100644
--- a/src/engine/GPURenderer/r_bsp_tech3.cpp
+++ b/src/engine/GPURenderer/r_bsp_tech3.cpp
@@ -3007,11 +3007,10 @@ void idRenderSystemLocal::LoadWorld( pointer name )
     
     i = LittleLong( header->version );
     
-    if( i != BSP_VERSION )
-    {
-        Com_Error( ERR_DROP, "idRenderSystemLocal::LoadWorldMap: %s has wrong version number (%i should be %i)",
-                   name, i, BSP_VERSION );
-    }
+    //if( i != BSP_VERSION )
+    //{
+    //    Com_Error( ERR_DROP, "idRenderSystemLocal::LoadWorldMap: %s has wrong version number (%i should be %i)", name, i, BSP_VERSION );
+    //}
     
     // swap all the lumps
     for( i = 0 ; i < sizeof( dheader_t ) / 4 ; i++ )
@@ -3226,6 +3225,7 @@ void idRenderSystemLocal::LoadWorld( pointer name )
     if( r_cubeMapping->integer )
     {
         R_LoadCubemapEntities( "misc_cubemap" );
+        
         if( !tr.numCubemaps )
         {
             // use deathmatch spawn points as cubemaps
@@ -3246,6 +3246,11 @@ void idRenderSystemLocal::LoadWorld( pointer name )
     // only set tr.world now that we know the entire level has loaded properly
     tr.world = &s_worldData;
     
+    if( tr.sunShaderName )
+    {
+        tr.sunShader = R_FindShader( tr.sunShaderName, LIGHTMAP_NONE, true );
+    }
+    
     // make sure the VAO glState entry is safe
     R_BindNullVao();
     
diff --git a/src/engine/GPURenderer/r_cmds.cpp b/src/engine/GPURenderer/r_cmds.cpp
index d4f5cdc..4d961d1 100644
--- a/src/engine/GPURenderer/r_cmds.cpp
+++ b/src/engine/GPURenderer/r_cmds.cpp
@@ -158,12 +158,13 @@ void R_IssuePendingRenderCommands( void )
     
     R_IssueRenderCommands( false );
     
-    if( !glConfig.smpActive )
+    if( glConfig.smpActive )
     {
+        GLimp_FrontEndSleep();
         return;
     }
     
-    GLimp_SyncRenderThread();
+    //GLimp_SyncRenderThread();
 }
 
 /*
diff --git a/src/engine/GPURenderer/r_glsl.cpp b/src/engine/GPURenderer/r_glsl.cpp
index 41ec560..c124118 100644
--- a/src/engine/GPURenderer/r_glsl.cpp
+++ b/src/engine/GPURenderer/r_glsl.cpp
@@ -2291,6 +2291,10 @@ shaderProgram_t* GLSL_GetGenericShaderProgram( sint stage )
     {
         shaderAttribs |= GENERICDEF_USE_VERTEX_ANIMATION;
     }
+    else if( glState.boneAnimation )
+    {
+        shaderAttribs |= GENERICDEF_USE_BONE_ANIMATION;
+    }
     
     if( pStage->bundle[0].numTexMods )
     {
diff --git a/src/engine/GPURenderer/r_init.cpp b/src/engine/GPURenderer/r_init.cpp
index c9f63fd..4b9ae55 100644
--- a/src/engine/GPURenderer/r_init.cpp
+++ b/src/engine/GPURenderer/r_init.cpp
@@ -1270,8 +1270,8 @@ void R_Register( void )
     r_greyscale = cvarSystem->Get( "r_greyscale", "0", CVAR_ARCHIVE | CVAR_LATCH, "Enables greyscaling of everything" );
     cvarSystem->CheckRange( r_greyscale, 0, 1, false );
     
-    r_hdr = cvarSystem->Get( "r_hdr", "1", CVAR_ARCHIVE | CVAR_LATCH, "Do scene rendering in a framebuffer with high dynamic range. (Less banding, and exposure changes look much better)" );
-    r_truehdr = cvarSystem->Get( "r_truehdr", "0", CVAR_ARCHIVE, "Do scene rendering in a framebuffer with high dynamic range with GLSL shaders" );
+    r_hdr = cvarSystem->Get( "r_hdr", "0", CVAR_CHEAT, "Do scene rendering in a framebuffer with high dynamic range. (Less banding, and exposure changes look much better)" );
+    r_truehdr = cvarSystem->Get( "r_truehdr", "1", CVAR_ARCHIVE, "Do scene rendering in a framebuffer with high dynamic range with GLSL shaders" );
     r_postProcess = cvarSystem->Get( "r_postProcess", "1", CVAR_ARCHIVE, "Enable post-processing" );
     
     r_toneMap = cvarSystem->Get( "r_toneMap", "1", CVAR_ARCHIVE, "Enable tone mapping. Requires r_hdr and r_postProcess." );
@@ -1285,7 +1285,7 @@ void R_Register( void )
     r_forceAutoExposureMin = cvarSystem->Get( "r_forceAutoExposureMin", "-2.0", CVAR_CHEAT, "Set minimum exposure to this value, in powers of two. Requires r_forceAutoExpsure. -3.0 - Dimmer. -2.0 - Normal. (default) -1.0 - Brighter." );
     r_forceAutoExposureMax = cvarSystem->Get( "r_forceAutoExposureMax", "2.0", CVAR_CHEAT, "Set maximum exposure to this value, in powers of two. Requires r_forceAutoExpsure. 1.0 - Dimmer. 2.0 - Normal. (default) 3.0 - Brighter" );
     
-    r_cameraExposure = cvarSystem->Get( "r_cameraExposurre", "4", CVAR_CHEAT, "Alter brightness, in powers of two. -2 - 4x as dark. 0 - Normal. (default) 0.5 - Sqrt(2)x as bright. 2 - 4x as bright." );
+    r_cameraExposure = cvarSystem->Get( "r_cameraExposure", "0", CVAR_CHEAT, "Alter brightness, in powers of two. -2 - 4x as dark. 0 - Normal. (default) 0.5 - Sqrt(2)x as bright. 2 - 4x as bright." );
     
     r_depthPrepass = cvarSystem->Get( "r_depthPrepass", "1", CVAR_ARCHIVE, "Do a depth-only pass before rendering. Speeds up rendering in cases where advanced features are used. Required for r_sunShadows. 0 - No. 1 - Yes. (default)" );
     r_ssao = cvarSystem->Get( "r_ssao", "0", CVAR_LATCH | CVAR_ARCHIVE, "Enable screen-space ambient occlusion. Currently eats framerate and has some visible artifacts. 0 - No. (default) 1 - Yes." );
@@ -1352,7 +1352,7 @@ void R_Register( void )
     r_trueAnaglyphRed = cvarSystem->Get( "r_trueAnaglyphRed", "0.0", CVAR_ARCHIVE, "Setting Anaglyph red color" );
     r_trueAnaglyphGreen = cvarSystem->Get( "r_trueAnaglyphGreen", "0.0", CVAR_ARCHIVE, "Setting Anaglyph green color" );
     r_trueAnaglyphBlue = cvarSystem->Get( "r_trueAnaglyphBlue", "0.0", CVAR_ARCHIVE, "Setting Anaglyph blue color" );
-    r_vibrancy = cvarSystem->Get( "r_vibrancy", "0.4", CVAR_ARCHIVE, "Enabled vibrancy effects" );
+    r_vibrancy = cvarSystem->Get( "r_vibrancy", "1.4", CVAR_ARCHIVE, "Enabled vibrancy effects" );
     r_bloom = cvarSystem->Get( "r_bloom", "0", CVAR_ARCHIVE, "Enabled Bloom effects" );
     r_bloomPasses = cvarSystem->Get( "r_bloomPasses", "1", CVAR_ARCHIVE, "Bloom Passes" );
     r_bloomDarkenPower = cvarSystem->Get( "r_bloomDarkenPower", "5.0", CVAR_ARCHIVE, "Darken power for bloom" );
diff --git a/src/engine/GPURenderer/r_local.hpp b/src/engine/GPURenderer/r_local.hpp
index 4d5eb8f..aa47db1 100644
--- a/src/engine/GPURenderer/r_local.hpp
+++ b/src/engine/GPURenderer/r_local.hpp
@@ -952,9 +952,9 @@ typedef enum
 
 typedef struct drawSurf_s
 {
-    uint		sort;			// bit combination for fast compares
-    sint                 cubemapIndex;
-    surfaceType_t*		surface;		// any of surface*_t
+    uint64 sort;			// bit combination for fast compares
+    sint cubemapIndex;
+    surfaceType_t* surface;		// any of surface*_t
 } drawSurf_t;
 
 #define	MAX_FACE_POINTS		64
diff --git a/src/engine/GPURenderer/r_main.cpp b/src/engine/GPURenderer/r_main.cpp
index b882705..5e0b68c 100644
--- a/src/engine/GPURenderer/r_main.cpp
+++ b/src/engine/GPURenderer/r_main.cpp
@@ -58,6 +58,7 @@ bool R_CompareVert( srfVert_t* v1, srfVert_t* v2, bool checkST )
 {
     sint             i;
     
+    #pragma omp critical
     for( i = 0; i < 3; i++ )
     {
         if( floor( v1->xyz[i] + 0.1 ) != floor( v2->xyz[i] + 0.1 ) )
@@ -143,6 +144,7 @@ bool R_CalcTangentVectors( srfVert_t* dv[3] )
         return false;
         
     /* do each vertex */
+    #pragma omp critical
     for( i = 0; i < 3; i++ )
     {
         vec4_t tangent;
@@ -279,6 +281,7 @@ sint R_CullLocalBox( vec3_t localBounds[2] )
     // transform into world space
     ClearBounds( worldBounds[0], worldBounds[1] );
     
+    #pragma omp critical
     for( j = 0; j < 8; j++ )
     {
         v[0] = localBounds[j & 1][0];
@@ -312,6 +315,8 @@ sint R_CullBox( vec3_t worldBounds[2] )
     
     // check against frustum planes
     anyClip = false;
+    
+    #pragma omp critical
     for( i = 0; i < numPlanes; i++ )
     {
         frust = &tr.viewParms.frustum[i];
@@ -367,6 +372,7 @@ sint R_CullPointAndRadiusEx( const vec3_t pt, float32 radius, const cplane_t* fr
     }
     
     // check against frustum planes

[... diff too long, it was truncated ...]

GitHub
sha: 7e555dc9