Skip to content

Commit

Permalink
feat: remove glow render pass
Browse files Browse the repository at this point in the history
Emissions are now handled via scene shaders.
  • Loading branch information
Silverlan committed Jan 12, 2025
1 parent 0016824 commit cf8e4db
Show file tree
Hide file tree
Showing 35 changed files with 34 additions and 1,170 deletions.
7 changes: 0 additions & 7 deletions assets/shaders/programs/post_processing/hdr.frag
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ layout(location = 0) in vec2 vs_vert_uv;

layout(LAYOUT_ID(TEXTURES, SCENE)) uniform sampler2D u_texture;
layout(LAYOUT_ID(TEXTURES, BLOOM)) uniform sampler2D u_bloom;
layout(LAYOUT_ID(TEXTURES, GLOW)) uniform sampler2D u_glow;

layout(LAYOUT_PUSH_CONSTANTS()) uniform RenderSettings
{
float exposure;
float bloomScale;
float glowScale; // Obsolete
uint toneMapping;
uint flipVertically;
}
Expand All @@ -25,7 +23,6 @@ layout(location = 0) out vec4 fs_color;

layout(constant_id = 0) const uint CSPEC_BLOOM_ENABLED = 1;
layout(constant_id = 1) const uint CSPEC_FXAA_ENABLED = 1;
layout(constant_id = 2) const uint CSPEC_GLOW_ENABLED = 0;

void main()
{
Expand All @@ -37,10 +34,6 @@ void main()
vec3 colBloom = texture(u_bloom, uv).rgb;
col.rgb += colBloom * u_renderSettings.bloomScale;
}
if(CSPEC_GLOW_ENABLED == 1) {
vec3 colGlow = texture(u_glow, uv).rgb;
col.rgb += colGlow;
}

fs_color = vec4(apply_tone_mapping(col.rgb, u_renderSettings.toneMapping, u_renderSettings.exposure), col.a);
if(CSPEC_FXAA_ENABLED == 1)
Expand Down
16 changes: 0 additions & 16 deletions assets/shaders/programs/scene/glow/glow.frag

This file was deleted.

16 changes: 0 additions & 16 deletions assets/shaders/programs/scene/glow/glow.glsl

This file was deleted.

28 changes: 0 additions & 28 deletions assets/shaders/programs/scene/glow/glow.vert

This file was deleted.

1 change: 0 additions & 1 deletion core/client/include/pragma/console/c_cvar_global.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ REGISTER_CONCOMMAND_CL(shader_reload, CMD_shader_reload, ConVarFlags::None, "Rel
REGISTER_CONCOMMAND_CL(shader_list, CMD_shader_list, ConVarFlags::None, "Prints a list of all currently loaded shaders");
REGISTER_CONCOMMAND_CL(shader_optimize, CMD_shader_optimize, ConVarFlags::None, "Uses LunarGLASS to optimize the specified shader.");
REGISTER_CONCOMMAND_CL(debug_light_shadowmap, CMD_debug_light_shadowmap, ConVarFlags::None, "Displays the depth map for the given light on screen. Call without arguments to turn the display off. Usage: debug_light_shadowmap <lightEntityIndex>");
REGISTER_CONCOMMAND_CL(debug_glow_bloom, CMD_debug_glow_bloom, ConVarFlags::None, "Displays the scene glow texture on screen. Usage: debug_glow_bloom <1/0>");
REGISTER_CONCOMMAND_CL(debug_hdr_bloom, CMD_debug_hdr_bloom, ConVarFlags::None, "Displays the scene bloom texture on screen. Usage: debug_hdr_bloom <1/0>");
REGISTER_CONCOMMAND_CL(debug_render_octree_dynamic_print, CMD_debug_render_octree_dynamic_print, ConVarFlags::None, "Prints the octree for dynamic objects to the console, or a file if a file name is specified.");
REGISTER_CONCOMMAND_CL(debug_render_octree_dynamic_find, CMD_debug_render_octree_dynamic_find, ConVarFlags::None, "Finds the specified entity in the octree for dynamic objects.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ DLLCLIENT void CMD_shader_reload(NetworkState *state, pragma::BasePlayerComponen
DLLCLIENT void CMD_shader_list(NetworkState *state, pragma::BasePlayerComponent *pl, std::vector<std::string> &argv);
DLLCLIENT void CMD_shader_optimize(NetworkState *state, pragma::BasePlayerComponent *pl, std::vector<std::string> &argv);
DLLCLIENT void CMD_debug_light_shadowmap(NetworkState *state, pragma::BasePlayerComponent *pl, std::vector<std::string> &argv);
DLLCLIENT void CMD_debug_glow_bloom(NetworkState *state, pragma::BasePlayerComponent *pl, std::vector<std::string> &argv);
DLLCLIENT void CMD_debug_hdr_bloom(NetworkState *state, pragma::BasePlayerComponent *pl, std::vector<std::string> &argv);
DLLCLIENT void CMD_debug_render_octree_dynamic_print(NetworkState *state, pragma::BasePlayerComponent *pl, std::vector<std::string> &argv);
DLLCLIENT void CMD_debug_render_octree_dynamic_find(NetworkState *state, pragma::BasePlayerComponent *pl, std::vector<std::string> &argv);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace pragma {

UseNormalMap = RenderModeSkybox << 1u
};
static_assert(umath::to_integral(pragma::rendering::SceneRenderPass::Count) == 5);
static_assert(umath::to_integral(pragma::rendering::SceneRenderPass::Count) == 4);
// Bounds for the sub-mesh. w-component is unused.
Vector4 aabbMin = {};
Vector4 aabbMax = {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
#include <pragma/entities/components/base_entity_component.hpp>
#include "pragma/entities/c_baseentity.h"
#include "pragma/rendering/renderers/base_renderer.hpp"
#include "pragma/entities/components/renderers/rasterization/glow_data.hpp"
#include "pragma/entities/components/renderers/rasterization/hdr_data.hpp"
#include "pragma/entities/components/renderers/rasterization/glow_data.hpp"
#include "pragma/entities/components/renderers/rasterization/hdr_data.hpp"
#include "pragma/rendering/c_rendermode.h"
#include <unordered_set>
Expand Down

This file was deleted.

This file was deleted.

25 changes: 0 additions & 25 deletions core/client/include/pragma/gui/debug/widebugglowbloom.hpp

This file was deleted.

3 changes: 1 addition & 2 deletions core/client/include/pragma/rendering/c_renderflags.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ enum class RenderFlags : uint32_t {
Skybox = View << 1,
Shadows = Skybox << 1,
Particles = Shadows << 1,
Glow = Particles << 1,
Debug = Glow << 1,
Debug = Particles << 1,
Water = Debug << 1,
Static = Water << 1,
Dynamic = Static << 1,
Expand Down
2 changes: 1 addition & 1 deletion core/client/include/pragma/rendering/c_rendermode.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <stdexcept>

namespace pragma::rendering {
enum class SceneRenderPass : uint8_t { None = 0, World, View, Sky, Glow, Count };
enum class SceneRenderPass : uint8_t { None = 0, World, View, Sky, Count };

enum class RenderMask : uint64_t { None = 0u };
using RenderGroup = RenderMask;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,19 @@ namespace pragma {
enum class TextureBinding : uint32_t {
Texture = 0u,
Bloom,
Glow
};

#pragma pack(push, 1)
struct PushConstants {
float exposure;
float bloomScale;
float glowScale;
rendering::ToneMapping toneMapping;
uint32_t flipVertically;
};
#pragma pack(pop)

ShaderPPHDR(prosper::IPrContext &context, const std::string &identifier);
bool RecordDraw(
prosper::ShaderBindState &bindState, prosper::IDescriptorSet &descSetTexture,
pragma::rendering::ToneMapping toneMapping, float exposure, float bloomScale, float glowScale,
bool flipVertically = false
) const;
bool RecordDraw(prosper::ShaderBindState &bindState, prosper::IDescriptorSet &descSetTexture, pragma::rendering::ToneMapping toneMapping, float exposure, float bloomScale, bool flipVertically = false) const;
protected:
virtual void InitializeGfxPipeline(prosper::GraphicsPipelineCreateInfo &pipelineInfo, uint32_t pipelineIdx) override;
virtual void InitializeShaderResources() override;
Expand Down
Loading

0 comments on commit cf8e4db

Please sign in to comment.