vk: fix bright artifacts coming from unpatched chrome materials
Fixes a typo that rewrote roughness value with garbage. Also adds a few more debug channel displays for lighting phases. And prints out available debug displays. Fixes #641
This commit is contained in:
parent
4509e2075d
commit
a25bf841ac
|
@ -2,6 +2,7 @@
|
||||||
- [x] fix material asserts and inherit
|
- [x] fix material asserts and inherit
|
||||||
- [x] fixup -vkverboselogs
|
- [x] fixup -vkverboselogs
|
||||||
- [x] changing textures on buttons, etc
|
- [x] changing textures on buttons, etc
|
||||||
|
- [x] fix unpatched chrome surfaces brightness glitches
|
||||||
|
|
||||||
# 2023-11-03 E324
|
# 2023-11-03 E324
|
||||||
- [x] add cvar for displaying only specified channel
|
- [x] add cvar for displaying only specified channel
|
||||||
|
|
|
@ -149,6 +149,7 @@ void computeBounce(ivec2 pix, vec3 direction, out vec3 diffuse, out vec3 specula
|
||||||
RayPayloadPrimary payload;
|
RayPayloadPrimary payload;
|
||||||
payload.base_color_a = vec4(0.);
|
payload.base_color_a = vec4(0.);
|
||||||
payload.emissive = vec4(0.);
|
payload.emissive = vec4(0.);
|
||||||
|
payload.material_rmxx = vec4(0.);
|
||||||
const vec3 pos = imageLoad(position_t, pix).xyz + geometry_normal * ray_normal_fudge;
|
const vec3 pos = imageLoad(position_t, pix).xyz + geometry_normal * ray_normal_fudge;
|
||||||
if (!getHit(pos, bounce_direction, payload))
|
if (!getHit(pos, bounce_direction, payload))
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -213,6 +213,21 @@ void main() {
|
||||||
|
|
||||||
const Components c = blurSamples(res, pix);
|
const Components c = blurSamples(res, pix);
|
||||||
|
|
||||||
|
if (ubo.ubo.debug_display_only == DEBUG_DISPLAY_DISABLED) {
|
||||||
|
} else if (ubo.ubo.debug_display_only == DEBUG_DISPLAY_DIRECT) {
|
||||||
|
imageStore(out_dest, pix, vec4(LINEARtoSRGB(c.direct_diffuse + c.direct_specular), 0.)); return;
|
||||||
|
return;
|
||||||
|
} else if (ubo.ubo.debug_display_only == DEBUG_DISPLAY_INDIRECT) {
|
||||||
|
imageStore(out_dest, pix, vec4(LINEARtoSRGB(c.indirect_diffuse + c.indirect_specular), 0.)); return;
|
||||||
|
return;
|
||||||
|
} else if (ubo.ubo.debug_display_only == DEBUG_DISPLAY_INDIRECT_SPEC) {
|
||||||
|
imageStore(out_dest, pix, vec4(LINEARtoSRGB(c.indirect_specular), 0.)); return;
|
||||||
|
return;
|
||||||
|
} else if (ubo.ubo.debug_display_only == DEBUG_DISPLAY_INDIRECT_DIFF) {
|
||||||
|
imageStore(out_dest, pix, vec4(LINEARtoSRGB(c.indirect_diffuse), 0.)); return;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
vec3 colour = vec3(0.);
|
vec3 colour = vec3(0.);
|
||||||
{
|
{
|
||||||
// TODO: need to extract reprojecting from this shader because reprojected stuff need svgf denoising pass after it
|
// TODO: need to extract reprojecting from this shader because reprojected stuff need svgf denoising pass after it
|
||||||
|
|
|
@ -176,6 +176,10 @@ struct PushConstants {
|
||||||
#define DEBUG_DISPLAY_NGEOM 5
|
#define DEBUG_DISPLAY_NGEOM 5
|
||||||
#define DEBUG_DISPLAY_LIGHTING 6
|
#define DEBUG_DISPLAY_LIGHTING 6
|
||||||
#define DEBUG_DISPLAY_SURFHASH 7
|
#define DEBUG_DISPLAY_SURFHASH 7
|
||||||
|
#define DEBUG_DISPLAY_DIRECT 8
|
||||||
|
#define DEBUG_DISPLAY_INDIRECT 9
|
||||||
|
#define DEBUG_DISPLAY_INDIRECT_SPEC 10
|
||||||
|
#define DEBUG_DISPLAY_INDIRECT_DIFF 11
|
||||||
// add more when needed
|
// add more when needed
|
||||||
|
|
||||||
struct UniformBuffer {
|
struct UniformBuffer {
|
||||||
|
|
|
@ -566,7 +566,7 @@ r_vk_material_t R_VkMaterialGetForTextureWithFlags( int tex_index, uint32_t flag
|
||||||
ret.tex_base_color = tex_index;
|
ret.tex_base_color = tex_index;
|
||||||
|
|
||||||
if ( flags & kVkMaterialFlagChrome )
|
if ( flags & kVkMaterialFlagChrome )
|
||||||
ret.roughness = tglob.grayTexture;
|
ret.tex_roughness = tglob.grayTexture;
|
||||||
|
|
||||||
//DEBUG("Returning default material with tex_base_color=%d", tex_index);
|
//DEBUG("Returning default material with tex_base_color=%d", tex_index);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -164,6 +164,10 @@ static void parseDebugDisplayValue( void ) {
|
||||||
X(NSHADE) \
|
X(NSHADE) \
|
||||||
X(NGEOM) \
|
X(NGEOM) \
|
||||||
X(SURFHASH) \
|
X(SURFHASH) \
|
||||||
|
X(DIRECT) \
|
||||||
|
X(INDIRECT) \
|
||||||
|
X(INDIRECT_SPEC) \
|
||||||
|
X(INDIRECT_DIFF) \
|
||||||
|
|
||||||
#define X(suffix) \
|
#define X(suffix) \
|
||||||
if (0 == Q_stricmp(cvalue, #suffix)) { \
|
if (0 == Q_stricmp(cvalue, #suffix)) { \
|
||||||
|
@ -174,6 +178,13 @@ static void parseDebugDisplayValue( void ) {
|
||||||
LIST_DISPLAYS(X)
|
LIST_DISPLAYS(X)
|
||||||
#undef X
|
#undef X
|
||||||
|
|
||||||
|
if (Q_strlen(cvalue) > 0) {
|
||||||
|
gEngine.Con_Printf("Invalid rt_debug_display_only mode %s. Valid modes are:\n", cvalue);
|
||||||
|
#define X(suffix) gEngine.Con_Printf("\t%s\n", #suffix);
|
||||||
|
LIST_DISPLAYS(X)
|
||||||
|
#undef X
|
||||||
|
}
|
||||||
|
|
||||||
g_rtx.debug.rt_debug_display_only_value = DEBUG_DISPLAY_DISABLED;
|
g_rtx.debug.rt_debug_display_only_value = DEBUG_DISPLAY_DISABLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue