Skip to content

Commit

Permalink
Revert "Add render debug modes"
Browse files Browse the repository at this point in the history
This reverts commit 66ddfdf.
  • Loading branch information
kraifpatrik committed Dec 9, 2024
1 parent 320256f commit 339bf83
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 129 deletions.
17 changes: 0 additions & 17 deletions BBMOD_GML/objects/OMain/Step_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,3 @@ directionalBlur.Vector.Set(
var _length = directionalBlur.Vector.Length();
_length = (_length > 0.0) ? _length : 1.0;
directionalBlur.Step = 2.0 / min(_length, 32.0);

if (keyboard_check_pressed(vk_left))
{
--renderer.DebugMode;
if (renderer.DebugMode < 0)
{
renderer.DebugMode = BBMOD_ERenderDebug.SIZE - 1;
}
}
else if (keyboard_check_pressed(vk_right))
{
++renderer.DebugMode;
if (renderer.DebugMode >= BBMOD_ERenderDebug.SIZE)
{
renderer.DebugMode = 0;
}
}
113 changes: 1 addition & 112 deletions BBMOD_GML/scripts/BBMOD_DeferredRenderer/BBMOD_DeferredRenderer.gml
Original file line number Diff line number Diff line change
@@ -1,23 +1,5 @@
/// @module DeferredRenderer

/// @enum TODO: Add docs
enum BBMOD_ERenderDebug
{
None,
Depth,
BaseColor,
Metallic,
Normal,
Roughness,
Emissive,
BakedAO,
SSAO,
Lighting,
Reflections,
LightingComplexity,
SIZE,
};

/// @func BBMOD_DeferredRenderer()
///
/// @extends BBMOD_BaseRenderer
Expand Down Expand Up @@ -79,9 +61,6 @@ function BBMOD_DeferredRenderer(): BBMOD_BaseRenderer() constructor
/// value is `c_black`.
ClearColor = c_black;

/// @var {Real} TODO: Add docs
DebugMode = BBMOD_ERenderDebug.None;

/// @var {Bool}
/// @private
__enableHDR = true;
Expand Down Expand Up @@ -614,96 +593,7 @@ function BBMOD_DeferredRenderer(): BBMOD_BaseRenderer() constructor

var _world = matrix_get(matrix_world);
matrix_set(matrix_world, matrix_build_identity());

if (DebugMode != BBMOD_ERenderDebug.None)
{
var _debugName = "";

gpu_push_state();
gpu_set_blendenable(false);

switch (DebugMode)
{
case BBMOD_ERenderDebug.Depth:
_debugName = "Depth";
shader_set(BBMOD_ShGBufferExtractRGB);
draw_surface_stretched(__surGBuffer[2], X, Y, get_width(), get_height());
shader_reset();
break;

case BBMOD_ERenderDebug.BaseColor:
_debugName = "BaseColor";
shader_set(BBMOD_ShGBufferExtractRGB);
draw_surface_stretched(__surGBuffer[0], X, Y, get_width(), get_height());
shader_reset();
break;

case BBMOD_ERenderDebug.Metallic:
_debugName = "Metallic";
shader_set(BBMOD_ShGBufferExtractA);
draw_surface_stretched(__surGBuffer[2], X, Y, get_width(), get_height());
shader_reset();
break;

case BBMOD_ERenderDebug.Normal:
_debugName = "Normal";
shader_set(BBMOD_ShGBufferExtractRGB);
draw_surface_stretched(__surGBuffer[1], X, Y, get_width(), get_height());
shader_reset();
break;

case BBMOD_ERenderDebug.Roughness:
_debugName = "Roughness";
shader_set(BBMOD_ShGBufferExtractA);
draw_surface_stretched(__surGBuffer[1], X, Y, get_width(), get_height());
shader_reset();
break;

case BBMOD_ERenderDebug.Emissive:
_debugName = "Emissive";
// TODO: Implement emissive render debug
break;

case BBMOD_ERenderDebug.BakedAO:
_debugName = "BakedAO";
shader_set(BBMOD_ShGBufferExtractA);
draw_surface_stretched(__surGBuffer[0], X, Y, get_width(), get_height());
shader_reset();
break;

case BBMOD_ERenderDebug.SSAO:
_debugName = "SSAO";
draw_surface_stretched(__surSSAO, X, Y, get_width(), get_height());
break;

case BBMOD_ERenderDebug.Lighting:
_debugName = "Lighting";
// TODO: Implement lighting render debug
break;

case BBMOD_ERenderDebug.Reflections:
_debugName = "Reflections";
// TODO: Implement reflections render debug
break;

case BBMOD_ERenderDebug.LightingComplexity:
_debugName = "LightingComplexity";
// TODO: Implement lighting complexity render debug
break;

default:
break;
}

gpu_pop_state();

if (_debugName != "")
{
draw_text_color(X + 9, Y + 9, _debugName, 0, 0, 0, 0, 1.0);
draw_text(X + 8, Y + 8, _debugName);
}
}
else if (PostProcessor != undefined
if (PostProcessor != undefined
&& PostProcessor.Enabled)
{
PostProcessor.__renderScale = RenderScale;
Expand All @@ -716,7 +606,6 @@ function BBMOD_DeferredRenderer(): BBMOD_BaseRenderer() constructor
draw_surface_stretched(__surFinal, X, Y, get_width(), get_height());
gpu_pop_state();
}

matrix_set(matrix_world, _world);

return self;
Expand Down

0 comments on commit 339bf83

Please sign in to comment.