Skip to content

Commit

Permalink
Updated c_screen_postprocess
Browse files Browse the repository at this point in the history
  • Loading branch information
twist84 committed Jan 21, 2025
1 parent 1427e4c commit 0e76019
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 69 deletions.
96 changes: 48 additions & 48 deletions game/source/render/screen_postprocess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,11 @@ REFERENCE_DECLARE(0x01917D50, long, g_ssao_enable);
decltype(c_screen_postprocess::postprocess_player_view)* screen_postprocess_postprocess_player_view = c_screen_postprocess::postprocess_player_view;
HOOK_DECLARE_CALL(0x00A39F4E, screen_postprocess_postprocess_player_view);
HOOK_DECLARE_CALL(0x00A3A171, sub_A62D70);
HOOK_DECLARE_CALL(0x00A61BBD, sub_A62720);

HOOK_DECLARE_CLASS(0x00A60460, c_screen_postprocess, copy);
HOOK_DECLARE_CLASS(0x00A601E0, c_screen_postprocess, blit);
HOOK_DECLARE_CLASS(0x00A60D60, c_screen_postprocess, gaussian_blur);

void __cdecl sub_A62720(s_lightshafts* lightshafts, render_projection* projection, render_camera* camera, c_rasterizer::e_surface surface_a, c_rasterizer::e_surface surface_b)
{
c_rasterizer_profile_scope _lightshafts(_rasterizer_profile_element_total, L"lightshafts");

INVOKE(0x00A62720, sub_A62720, lightshafts, projection, camera, surface_a, surface_b);
}
HOOK_DECLARE_CLASS(0x00A61BBD, c_screen_postprocess, render_lightshafts);

void __cdecl sub_A62D70(c_camera_fx_settings* fx_settings, render_projection* projection, render_camera* camera)
{
Expand All @@ -49,22 +42,22 @@ void __cdecl c_screen_postprocess::accept_edited_settings()

void __cdecl c_screen_postprocess::blit(
long explicit_shader_index,
c_rasterizer::e_surface surface_a,
c_rasterizer::e_surface surface_b,
c_rasterizer::e_sampler_filter_mode sampler_filter_mode,
c_rasterizer::e_sampler_address_mode sampler_address_mode,
real a6,
real a7,
real a8,
real a9,
real_rectangle2d* a10,
real_rectangle2d* a11)
c_rasterizer::e_surface source_surface,
c_rasterizer::e_surface dest_surface,
c_rasterizer::e_sampler_filter_mode filter_mode,
c_rasterizer::e_sampler_address_mode address_mode,
real scale_r,
real scale_g,
real scale_b,
real scale_a,
real_rectangle2d* source_texture_rect,
real_rectangle2d* dest_texture_rect)
{
//INVOKE(0x00A601E0, c_screen_postprocess::blit, explicit_shader_index, surface_a, surface_b, sampler_filter_mode, sampler_address_mode, a6, a7, a8, a9, a10, a11);
//INVOKE(0x00A601E0, c_screen_postprocess::blit, explicit_shader_index, source_surface, dest_surface, filter_mode, address_mode, scale_r, scale_g, scale_b, scale_a, source_texture_rect, dest_texture_rect);

c_rasterizer_profile_scope _blit(_rasterizer_profile_element_total, L"blit");

HOOK_INVOKE_CLASS(, c_screen_postprocess, blit, decltype(&c_screen_postprocess::blit), explicit_shader_index, surface_a, surface_b, sampler_filter_mode, sampler_address_mode, a6, a7, a8, a9, a10, a11);
HOOK_INVOKE_CLASS(, c_screen_postprocess, blit, decltype(&c_screen_postprocess::blit), explicit_shader_index, source_surface, dest_surface, filter_mode, address_mode, scale_r, scale_g, scale_b, scale_a, source_texture_rect, dest_texture_rect);
}

c_rasterizer::e_surface __cdecl c_screen_postprocess::blur_display()
Expand All @@ -74,29 +67,29 @@ c_rasterizer::e_surface __cdecl c_screen_postprocess::blur_display()

void __cdecl c_screen_postprocess::copy(
long explicit_shader_index,
c_rasterizer::e_surface surface_a,
c_rasterizer::e_surface surface_b,
c_rasterizer::e_sampler_filter_mode sampler_filter_mode,
c_rasterizer::e_sampler_address_mode sampler_address_mode,
real a6,
real a7,
real a8,
real a9,
real_rectangle2d* bounds)
c_rasterizer::e_surface source_surface,
c_rasterizer::e_surface dest_surface,
c_rasterizer::e_sampler_filter_mode filter_mode,
c_rasterizer::e_sampler_address_mode address_mode,
real scale_r,
real scale_g,
real scale_b,
real scale_a,
real_rectangle2d* dest_texture_rect)
{
//INVOKE(0x00A60460, c_screen_postprocess::copy, explicit_shader_index, surface_a, surface_b, sampler_filter_mode, sampler_address_mode, a6, a7, a8, a9, bounds);
//INVOKE(0x00A60460, c_screen_postprocess::copy, explicit_shader_index, source_surface, dest_surface, filter_mode, address_mode, scale_r, scale_g, scale_b, scale_a, );

c_rasterizer_profile_scope _copy(_rasterizer_profile_element_total, L"copy");

HOOK_INVOKE_CLASS(, c_screen_postprocess, copy, decltype(&c_screen_postprocess::copy), explicit_shader_index, surface_a, surface_b, sampler_filter_mode, sampler_address_mode, a6, a7, a8, a9, bounds);
HOOK_INVOKE_CLASS(, c_screen_postprocess, copy, decltype(&c_screen_postprocess::copy), explicit_shader_index, source_surface, dest_surface, filter_mode, address_mode, scale_r, scale_g, scale_b, scale_a, dest_texture_rect);
}

//.text:00A605B0 ;

// nullsub
void __cdecl c_screen_postprocess::render_ssao(render_projection const* projection, render_camera const* camera, c_rasterizer::e_surface surface_a, c_rasterizer::e_surface surface_b, c_rasterizer::e_surface surface_c)
void __cdecl c_screen_postprocess::render_ssao_old(render_projection const* projection, render_camera const* camera, c_rasterizer::e_surface surface_a, c_rasterizer::e_surface surface_b, c_rasterizer::e_surface surface_c)
{
//INVOKE(0x00A60AF0, c_screen_postprocess::render_ssao, projection, camera, surface_a, surface_b, surface_c);
//INVOKE(0x00A60AF0, c_screen_postprocess::render_ssao_old, projection, camera, surface_a, surface_b, surface_c);
}

void __cdecl c_screen_postprocess::gaussian_blur(c_rasterizer::e_surface surface_a, c_rasterizer::e_surface surface_b)
Expand All @@ -120,20 +113,7 @@ void __cdecl c_screen_postprocess::postprocess_player_view(
INVOKE(0x00A61770, c_screen_postprocess::postprocess_player_view, fx_values, projection, camera, screen_effect_settings, splitscreen_res, observer_dof, user_index);
}

// nullsub
void __cdecl c_screen_postprocess::sub_A62710(
render_projection const* projection,
render_camera const* camera,
real_matrix4x3 const* matrix,
real const(*projection_matrix)[4],
c_rasterizer::e_surface surface_a,
c_rasterizer::e_surface surface_b,
c_rasterizer::e_surface surface_c)
{
//INVOKE(0x00A62710, c_screen_postprocess::sub_A62710, projection, camera, matrix, bounding_box, surface_a, surface_b, surface_c);
}

void __cdecl c_screen_postprocess::render_ssr(
void __cdecl c_screen_postprocess::postprocess_ssr(
render_projection const* projection,
render_camera const* camera,
c_rasterizer::e_surface surface_a,
Expand All @@ -149,7 +129,7 @@ void __cdecl c_screen_postprocess::render_ssr(
c_rasterizer::e_surface surface_k,
c_rasterizer::e_surface surface_l)
{
INVOKE(0x00A61CD0, c_screen_postprocess::render_ssr,
INVOKE(0x00A61CD0, c_screen_postprocess::postprocess_ssr,
projection,
camera,
surface_a,
Expand All @@ -166,6 +146,26 @@ void __cdecl c_screen_postprocess::render_ssr(
surface_l);
}

// nullsub
void __cdecl c_screen_postprocess::sub_A62710(
render_projection const* projection,
render_camera const* camera,
real_matrix4x3 const* matrix,
real const(*projection_matrix)[4],
c_rasterizer::e_surface surface_a,
c_rasterizer::e_surface surface_b,
c_rasterizer::e_surface surface_c)
{
//INVOKE(0x00A62710, c_screen_postprocess::sub_A62710, projection, camera, matrix, bounding_box, surface_a, surface_b, surface_c);
}

void __cdecl c_screen_postprocess::render_lightshafts(s_lightshafts* lightshafts, render_projection* projection, render_camera* camera, c_rasterizer::e_surface surface_a, c_rasterizer::e_surface surface_b)
{
c_rasterizer_profile_scope _lightshafts(_rasterizer_profile_element_total, L"lightshafts");

INVOKE(0x00A62720, c_screen_postprocess::render_lightshafts, lightshafts, projection, camera, surface_a, surface_b);
}

void __cdecl c_screen_postprocess::setup_rasterizer_for_postprocess(bool a1)
{
INVOKE(0x00A63510, c_screen_postprocess::setup_rasterizer_for_postprocess, a1);
Expand Down
39 changes: 20 additions & 19 deletions game/source/render/screen_postprocess.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,24 @@ struct render_camera;
struct s_screen_effect_settings;
struct s_observer_depth_of_field;
struct s_oriented_bounding_box;
struct s_lightshafts;

struct c_screen_postprocess
{
static void __cdecl accept_edited_settings();

static void __cdecl blit(
long explicit_shader_index,
c_rasterizer::e_surface surface_a,
c_rasterizer::e_surface surface_b,
c_rasterizer::e_sampler_filter_mode sampler_filter_mode,
c_rasterizer::e_sampler_address_mode sampler_address_mode,
real a6,
real a7,
real a8,
real a9,
real_rectangle2d* a10,
real_rectangle2d* a11);
c_rasterizer::e_surface source_surface,
c_rasterizer::e_surface dest_surface,
c_rasterizer::e_sampler_filter_mode filter_mode,
c_rasterizer::e_sampler_address_mode address_mode,
real scale_r,
real scale_g,
real scale_b,
real scale_a,
real_rectangle2d* source_texture_rect,
real_rectangle2d* dest_texture_rect);

static c_rasterizer::e_surface __cdecl blur_display();

Expand All @@ -43,7 +44,7 @@ struct c_screen_postprocess
real a9,
real_rectangle2d* bounds);

static void __cdecl render_ssao(
static void __cdecl render_ssao_old(
render_projection const* projection,
render_camera const* camera,
c_rasterizer::e_surface surface_a,
Expand Down Expand Up @@ -72,7 +73,14 @@ struct c_screen_postprocess
c_rasterizer::e_surface surface_b,
c_rasterizer::e_surface surface_c);

static void __cdecl render_ssr(
static void __cdecl render_lightshafts(
s_lightshafts* lightshafts,
render_projection* projection,
render_camera* camera,
c_rasterizer::e_surface surface_a,
c_rasterizer::e_surface surface_b);

static void __cdecl postprocess_ssr(
render_projection const* projection,
render_camera const* camera,
c_rasterizer::e_surface surface_a,
Expand Down Expand Up @@ -101,13 +109,6 @@ struct c_screen_postprocess

};

struct s_lightshafts;

extern void __cdecl sub_A62720(s_lightshafts* lightshafts,
render_projection* projection, render_camera* camera,
c_rasterizer::e_surface surface_a,
c_rasterizer::e_surface surface_b);

extern void __cdecl sub_A62D70(c_camera_fx_settings* fx_settings,
render_projection* projection,
render_camera* camera);
Expand Down
4 changes: 2 additions & 2 deletions game/source/render/views/render_player_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,15 +298,15 @@ void __thiscall c_player_view::render_1st_pass()
if (c_rasterizer::get_is_tiling_enabled())
c_tron_effect::resolve_and_process_z_camera(m_camera_user_data.player_window_index, &rasterizer_camera->window_pixel_bounds, false);

c_screen_postprocess::render_ssao(
c_screen_postprocess::render_ssao_old(
&m_rasterizer_projection,
&m_rasterizer_camera,
c_rasterizer::_surface_accum_LDR,
c_rasterizer::_surface_accum_HDR,
c_rasterizer::_surface_color_half_fp16_0);

if (screenshot_allow_postprocess())
c_screen_postprocess::render_ssr(
c_screen_postprocess::postprocess_ssr(
&m_rasterizer_projection,
&m_rasterizer_camera,
c_rasterizer::_surface_accum_LDR,
Expand Down

0 comments on commit 0e76019

Please sign in to comment.