remove broken precise midtexture trace, fix sky tracing for actors

This commit is contained in:
Ricardo Luís Vaz Silva 2025-05-15 19:36:20 -03:00 committed by Magnus Norddahl
commit e0897ae8b2
8 changed files with 19 additions and 97 deletions

View file

@ -183,4 +183,3 @@ int get_gl_spritelight()
CVARD(Bool, gl_fakemodellight, true, CVAR_GLOBALCONFIG | CVAR_ARCHIVE, "adds a fake sunlight on models to improve contrast")
CVARD(Float, gl_fakemodellightintensity, 0.05, CVAR_GLOBALCONFIG | CVAR_ARCHIVE, "fake sunlight intensity (brightness)")
CVARD(Bool, gl_precise_midtextures_trace, false, CVAR_GLOBALCONFIG | CVAR_ARCHIVE, "trace midtextures facing towards camera, only needed for maps that don't use midtextures 'evenly', roughly doubles the cost of ray-traced lights")

View file

@ -67,4 +67,5 @@ int get_gl_spritelight();
EXTERN_CVAR(Bool, gl_fakemodellight)
EXTERN_CVAR(Float, gl_fakemodellightintensity)
EXTERN_CVAR(Bool, gl_precise_midtextures_trace)

View file

@ -441,7 +441,6 @@ void VkShaderManager::BuildDefinesBlock(FString &definesBlock, const char *defin
definesBlock << "#define USE_RAYTRACE ((uShaderKey1 & SK1_USE_RAYTRACE) != 0)\n";
definesBlock << "#define USE_RAYTRACE_PRECISE ((uShaderKey1 & SK1_USE_RAYTRACE_PRECISE) != 0)\n";
definesBlock << "#define PRECISE_MIDTEXTURES ((uShaderKey1 & SK1_PRECISE_MIDTEXTURES) != 0)\n";
definesBlock << "#define SHADOWMAP_FILTER (SK_GET_SHADOWMAP_FILTER())\n";

View file

@ -95,7 +95,7 @@ public:
uint64_t UseShadowmap : 1; // USE_SHADOWMAP
uint64_t UseRaytrace : 1; // USE_RAYTRACE
uint64_t UseRaytracePrecise : 1; // USE_RAYTRACE_PRECISE
uint64_t PreciseMidtextureTrace : 1; // PRECISE_MIDTEXTURES
uint64_t Unused4 : 1; // formerly PRECISE_MIDTEXTURES
uint64_t ShadowmapFilter : 4; // SHADOWMAP_FILTER
uint64_t FogBeforeLights : 1; // FOG_BEFORE_LIGHTS
uint64_t FogAfterLights : 1; // FOG_AFTER_LIGHTS
@ -105,12 +105,12 @@ public:
uint64_t LightMode : 2; // LIGHTMODE_DEFAULT, LIGHTMODE_SOFTWARE, LIGHTMODE_VANILLA, LIGHTMODE_BUILD
uint64_t LightBlendMode : 2; // LIGHT_BLEND_CLAMPED , LIGHT_BLEND_COLORED_CLAMP , LIGHT_BLEND_UNCLAMPED
uint64_t LightAttenuationMode : 1; // LIGHT_ATTENUATION_LINEAR , LIGHT_ATTENUATION_INVERSE_SQUARE
uint64_t Unused4: 1;
uint64_t Unused5: 1;
uint64_t FogBalls : 1; // FOGBALLS
uint64_t NoFragmentShader : 1;
uint64_t DepthFadeThreshold : 1;
uint64_t AlphaTestOnly : 1; // ALPHATEST_ONLY
uint64_t Unused5 : 1;
uint64_t Unused6 : 1;
uint64_t LightNoNormals : 1; // LIGHT_NONORMALS
uint64_t UseSpriteCenter : 1; // USE_SPRITE_CENTER
uint64_t Unused : 26;

View file

@ -336,7 +336,6 @@ void VkRenderState::ApplyRenderPass(int dt)
pipelineKey.ShaderKey.UseShadowmap = gl_light_shadows == 1;
pipelineKey.ShaderKey.UseRaytrace = gl_light_shadows >= 2;
pipelineKey.ShaderKey.UseRaytracePrecise = gl_light_shadows >= 3;
pipelineKey.ShaderKey.PreciseMidtextureTrace = gl_precise_midtextures_trace;
pipelineKey.ShaderKey.ShadowmapFilter = std::clamp(int(gl_light_shadow_filter), 0, 15);
pipelineKey.ShaderKey.Layout.GBufferPass = mRenderTarget.DrawBuffers > 1;
@ -1110,7 +1109,6 @@ void VkRenderState::ApplyLevelMeshPipeline(VulkanCommandBuffer* cmdbuffer, VkPip
pipelineKey.ShaderKey.UseShadowmap = gl_light_shadows == 1;
pipelineKey.ShaderKey.UseRaytrace = gl_light_shadows >= 2;
pipelineKey.ShaderKey.UseRaytracePrecise = gl_light_shadows >= 3;
pipelineKey.ShaderKey.PreciseMidtextureTrace = gl_precise_midtextures_trace;
pipelineKey.ShaderKey.ShadowmapFilter = std::clamp(int(gl_light_shadow_filter), 0, 15);
pipelineKey.ShaderKey.Layout.GBufferPass = mRenderTarget.DrawBuffers > 1;