Skip to content

Commit

Permalink
Merge pull request #64 from damoldavskiy/shader_param
Browse files Browse the repository at this point in the history
Support for upcoming updates of Shader 3D Scopes
  • Loading branch information
themrdemonized authored Sep 3, 2024
2 parents 1430a30 + 95b052c commit a0f78cc
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
44 changes: 44 additions & 0 deletions src/Layers/xrRender/Blender_Recorder_StandartBinding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,44 @@ static class markswitch_color : public R_constant_setup
}
} markswitch_color;

// Shader 3D Scopes
extern Fvector4 ps_s3ds_param_1;
extern Fvector4 ps_s3ds_param_2;
extern Fvector4 ps_s3ds_param_3;
extern Fvector4 ps_s3ds_param_4;

static class s3ds_param_1 : public R_constant_setup
{
virtual void setup(R_constant* C)
{
RCache.set_c(C, ps_s3ds_param_1.x, ps_s3ds_param_1.y, ps_s3ds_param_1.z, ps_s3ds_param_1.w);
}
} s3ds_param_1;

static class s3ds_param_2 : public R_constant_setup
{
virtual void setup(R_constant* C)
{
RCache.set_c(C, ps_s3ds_param_2.x, ps_s3ds_param_2.y, ps_s3ds_param_2.z, ps_s3ds_param_2.w);
}
} s3ds_param_2;

static class s3ds_param_3 : public R_constant_setup
{
virtual void setup(R_constant* C)
{
RCache.set_c(C, ps_s3ds_param_3.x, ps_s3ds_param_3.y, ps_s3ds_param_3.z, ps_s3ds_param_3.w);
}
} s3ds_param_3;

static class s3ds_param_4 : public R_constant_setup
{
virtual void setup(R_constant* C)
{
RCache.set_c(C, ps_s3ds_param_4.x, ps_s3ds_param_4.y, ps_s3ds_param_4.z, ps_s3ds_param_4.w);
}
} s3ds_param_4;

//--DSR-- SilencerOverheat_start
static class cl_silencer_glowing : public R_constant_setup
{
Expand Down Expand Up @@ -1205,6 +1243,12 @@ void CBlender_Compile::SetMapping()
r_Constant("markswitch_count", &markswitch_count);
r_Constant("markswitch_color", &markswitch_color);

// Shader 3D Scopes
r_Constant("s3ds_param_1", &s3ds_param_1);
r_Constant("s3ds_param_2", &s3ds_param_2);
r_Constant("s3ds_param_3", &s3ds_param_3);
r_Constant("s3ds_param_4", &s3ds_param_4);

// crookr
r_Constant("fakescope_params1", &binder_fakescope_params);
r_Constant("fakescope_params2", &binder_fakescope_ca);
Expand Down
12 changes: 12 additions & 0 deletions src/Layers/xrRender/xrRender_console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,12 @@ int ps_markswitch_current = 0;
int ps_markswitch_count = 0;
Fvector4 ps_markswitch_color = { 0, 0, 0, 0 };

// Shader 3D Scopes
Fvector4 ps_s3ds_param_1 = { 0, 0, 0, 0 };
Fvector4 ps_s3ds_param_2 = { 0, 0, 0, 0 };
Fvector4 ps_s3ds_param_3 = { 0, 0, 0, 0 };
Fvector4 ps_s3ds_param_4 = { 0, 0, 0, 0 };

// Screen Space Shaders Stuff
float ps_ssfx_hud_hemi = 0.15f; // HUD Hemi Offset

Expand Down Expand Up @@ -1215,6 +1221,12 @@ void xrRender_initconsole()
CMD4(CCC_Integer, "markswitch_current", &ps_markswitch_current, 0, 32);
CMD4(CCC_Integer, "markswitch_count", &ps_markswitch_count, 0, 32);
CMD4(CCC_Vector4, "markswitch_color", &ps_markswitch_color, Fvector4().set(0.0, 0.0, 0.0, 0.0), Fvector4().set(1.0, 1.0, 1.0, 1.0));

// Shader 3D Scopes
CMD4(CCC_Vector4, "s3ds_param_1", &ps_s3ds_param_1, tw2_min, tw2_max);
CMD4(CCC_Vector4, "s3ds_param_2", &ps_s3ds_param_2, tw2_min, tw2_max);
CMD4(CCC_Vector4, "s3ds_param_3", &ps_s3ds_param_3, tw2_min, tw2_max);
CMD4(CCC_Vector4, "s3ds_param_4", &ps_s3ds_param_4, tw2_min, tw2_max);

// Screen Space Shaders
CMD4(CCC_Float, "ssfx_hud_hemi", &ps_ssfx_hud_hemi, 0.0f, 1.0f);
Expand Down

0 comments on commit a0f78cc

Please sign in to comment.