Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
f36c03f
Add GTAO ambient occlusion
ehardesty Aug 11, 2026
071e586
Add liquid-aware GTAO suppression
ehardesty Aug 11, 2026
82837f8
Avoid redundant GTAO stencil sampling
ehardesty Aug 11, 2026
cac3aab
Reuse half-resolution GTAO base sample
ehardesty Aug 11, 2026
43f39d1
Use gathered samples in GTAO denoiser
ehardesty Aug 11, 2026
1e9b5f4
Use single-channel GTAO liquid mask when supported
ehardesty Aug 11, 2026
b959b9d
Trim GTAO descriptor and barrier overhead
ehardesty Aug 11, 2026
75b6879
Restore baseline renderer path when GTAO is disabled
ehardesty Aug 12, 2026
25701ac
Reuse resolved depth for GTAO sampling
ehardesty Aug 12, 2026
3bacfca
Add GTAO presets to graphics menu
ehardesty Aug 12, 2026
e3eb556
Remove temporal GTAO accumulation
ehardesty Aug 12, 2026
7944fad
Simplify GTAO tuning paths
ehardesty Aug 12, 2026
f876ddb
Reuse GTAO horizon depth samples
ehardesty Aug 12, 2026
4cad680
Compact half-resolution GTAO resources
ehardesty Aug 12, 2026
20f0baa
Skip GTAO denoising in liquid-mask debug mode
ehardesty Aug 12, 2026
ca8e906
Tie GTAO MSAA classification to resolved depth
ehardesty Aug 12, 2026
f286c2a
Add depth-aware half-resolution GTAO reconstruction
ehardesty Aug 12, 2026
e4656fd
Add experimental GTAO quality tier
ehardesty Aug 12, 2026
50e6d88
Make depth-aware GTAO reconstruction standard
ehardesty Aug 12, 2026
2624c5b
Use half-resolution GTAO for menu presets
ehardesty Aug 12, 2026
aafc4d2
Shorten GTAO menu label
ehardesty Aug 12, 2026
11eebba
Add XeGTAO attribution and license
ehardesty Aug 12, 2026
a03a8a0
Default GTAO to disabled
ehardesty Aug 12, 2026
854bdac
Apply clang-format to GTAO changes
ehardesty Aug 12, 2026
2ad240a
Add GTAO shaders to GNU builds
ehardesty Aug 12, 2026
91746aa
Fix enabling GTAO from the graphics menu
ehardesty Aug 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Quake/common.make
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,13 @@ SHADER_OBJS = \
screen_effects_10bit_comp.o \
screen_effects_10bit_scale_comp.o \
screen_effects_10bit_scale_sops_comp.o \
gtao_comp.o \
gtao_depth_comp.o \
gtao_depth_msaa_comp.o \
gtao_depth_r8_comp.o \
gtao_depth_msaa_r8_comp.o \
gtao_depth_downsample_comp.o \
gtao_denoise_comp.o \
cs_tex_warp_comp.o \
indirect_comp.o \
indirect_clear_comp.o \
Expand Down Expand Up @@ -352,6 +359,10 @@ $(eval $(call SHADER_VARIANT,screen_effects_8bit_scale_sops_comp,screen_effects.
$(eval $(call SHADER_VARIANT,screen_effects_10bit_comp,screen_effects.comp,-DUSE_10BIT=1))
$(eval $(call SHADER_VARIANT,screen_effects_10bit_scale_comp,screen_effects.comp,-DUSE_10BIT=1 -DSCALING=1))
$(eval $(call SHADER_VARIANT,screen_effects_10bit_scale_sops_comp,screen_effects.comp,--target-env vulkan1.1 -DUSE_10BIT=1 -DSCALING=1 -DUSE_SUBGROUP_OPS=1))
$(eval $(call SHADER_VARIANT,gtao_depth_msaa_comp,gtao_depth.comp,-DGTAO_DEPTH_MSAA=1))
$(eval $(call SHADER_VARIANT,gtao_depth_r8_comp,gtao_depth.comp,-DGTAO_LIQUID_MASK_R8=1))
$(eval $(call SHADER_VARIANT,gtao_depth_msaa_r8_comp,gtao_depth.comp,-DGTAO_DEPTH_MSAA=1 -DGTAO_LIQUID_MASK_R8=1))
$(eval $(call SHADER_VARIANT,gtao_depth_downsample_comp,gtao_depth.comp,-DGTAO_DEPTH_DOWNSAMPLE=1))
$(eval $(call SHADER_VARIANT,update_lightmap_8bit_comp,update_lightmap.comp,))
$(eval $(call SHADER_VARIANT,update_lightmap_8bit_rt_comp,update_lightmap.comp,-DRAY_QUERIES=1))
$(eval $(call SHADER_VARIANT,update_lightmap_10bit_comp,update_lightmap.comp,-DUSE_10BIT=1))
Expand Down
32 changes: 32 additions & 0 deletions Quake/gl_rmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,21 @@ float map_fallbackalpha;
qboolean r_drawworld_cheatsafe, r_fullbright_cheatsafe, r_lightmap_cheatsafe; // johnfitz

cvar_t r_scale = {"r_scale", "1", CVAR_ARCHIVE};
cvar_t r_gtao = {"r_gtao", "0", CVAR_ARCHIVE};
cvar_t r_gtao_radius = {"r_gtao_radius", "32", CVAR_ARCHIVE};
cvar_t r_gtao_falloff = {"r_gtao_falloff", "0.615", CVAR_ARCHIVE};
cvar_t r_gtao_thin_occluder_compensation = {"r_gtao_thin_occluder_compensation", "0", CVAR_ARCHIVE};
cvar_t r_gtao_strength = {"r_gtao_strength", "0.6", CVAR_ARCHIVE};
cvar_t r_gtao_debug = {"r_gtao_debug", "0", CVAR_NONE};
cvar_t r_gtao_quality = {"r_gtao_quality", "2", CVAR_ARCHIVE};
cvar_t r_gtao_denoise = {"r_gtao_denoise", "2", CVAR_ARCHIVE};
cvar_t r_gtao_bias = {"r_gtao_bias", "0", CVAR_ARCHIVE};
cvar_t r_gtao_multibounce = {"r_gtao_multibounce", "1", CVAR_ARCHIVE};
cvar_t r_gtao_halfres = {"r_gtao_halfres", "1", CVAR_ARCHIVE};
cvar_t r_gtao_liquid_water = {"r_gtao_liquid_water", "1", CVAR_ARCHIVE};
cvar_t r_gtao_liquid_slime = {"r_gtao_liquid_slime", "1", CVAR_ARCHIVE};
cvar_t r_gtao_liquid_lava = {"r_gtao_liquid_lava", "1", CVAR_ARCHIVE};
cvar_t r_gtao_liquid_tele = {"r_gtao_liquid_tele", "1", CVAR_ARCHIVE};

cvar_t r_gpulightmapupdate = {"r_gpulightmapupdate", "1", CVAR_NONE};
cvar_t r_rtshadows = {"r_rtshadows", "2", CVAR_ARCHIVE};
Expand Down Expand Up @@ -417,6 +432,17 @@ static void R_SetupViewBeforeMark (void *unused)

R_SetFrustum (r_fovx, r_fovy); // johnfitz -- use r_fov* vars
R_SetupMatrices ();
if (R_GTAOEnabled ())
{
vulkan_globals.gtao_viewport_x = r_refdef.vrect.x;
vulkan_globals.gtao_viewport_y = r_refdef.vrect.y;
vulkan_globals.gtao_viewport_width = r_refdef.vrect.width;
vulkan_globals.gtao_viewport_height = r_refdef.vrect.height;
vulkan_globals.gtao_projection[0] = 1.0f / vulkan_globals.projection_matrix[0];
vulkan_globals.gtao_projection[1] = 1.0f / (-vulkan_globals.projection_matrix[5]);
vulkan_globals.gtao_projection[2] = vulkan_globals.projection_matrix[10];
vulkan_globals.gtao_projection[3] = vulkan_globals.projection_matrix[14];
}

// johnfitz -- cheat-protect some draw modes
r_fullbright_cheatsafe = false;
Expand Down Expand Up @@ -1153,6 +1179,12 @@ void R_RenderView (qboolean use_tasks, task_handle_t begin_rendering_task, task_
{
task_handle_t before_mark = Task_AllocateAndAssignFunc (R_SetupViewBeforeMark, NULL, 0);
Task_AddDependency (setup_frame_task, before_mark);
if (R_GTAOEnabled ())
{
// Keep frame-local projection/viewport state from being overwritten while
// the previous frame's asynchronous end-render task is consuming it.
Task_AddDependency (begin_rendering_task, before_mark);
}

task_handle_t store_efrags = INVALID_TASK_HANDLE;
task_handle_t cull_surfaces = INVALID_TASK_HANDLE;
Expand Down
499 changes: 431 additions & 68 deletions Quake/gl_rmisc.c

Large diffs are not rendered by default.

14 changes: 12 additions & 2 deletions Quake/gl_texmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -806,8 +806,18 @@ void TexMgr_Init (void)

TEMP_ALLOC (byte, bluenoise_rgba, sizeof (bluenoise_data) * 4);
for (i = 0; i < sizeof (bluenoise_data); ++i)
for (int j = 0; j < 3; ++j)
bluenoise_rgba[i * 4 + j] = bluenoise_data[i];
{
const int x = i & 63;
const int y = i >> 6;
const int second_x = (y + 17) & 63;
const int second_y = (63 - x + 31) & 63;
bluenoise_rgba[i * 4 + 0] = bluenoise_data[i];
// Preserve the blue-noise spectrum while providing a decorrelated
// second dimension for spatial-only GTAO sampling.
bluenoise_rgba[i * 4 + 1] = bluenoise_data[second_y * 64 + second_x];
bluenoise_rgba[i * 4 + 2] = bluenoise_data[i];
bluenoise_rgba[i * 4 + 3] = 255;
}
bluenoisetexture = TexMgr_LoadImage (
NULL, "bluenoise", 64, 64, SRC_RGBA, bluenoise_rgba, "", (src_offset_t)greytexture_data, TEXPREF_NEAREST | TEXPREF_PERSIST | TEXPREF_NOPICMIP);
TEMP_FREE (bluenoise_rgba);
Expand Down
Loading
Loading