diff --git a/assets/shaders/world2d.frag.glsl b/assets/shaders/world2d.frag.glsl index f9de0354ba..143d3f0980 100644 --- a/assets/shaders/world2d.frag.glsl +++ b/assets/shaders/world2d.frag.glsl @@ -26,10 +26,18 @@ void main() { // do not save the ID return; - //@INSERT_COMMANDS@ + case 254: + col = vec4(1.0f, 0.0f, 0.0f, 1.0f); + break; + case 252: + col = vec4(0.0f, 1.0f, 0.0f, 1.0f); + break; + case 250: + col = vec4(0.0f, 0.0f, 1.0f, 1.0f); + break; default: col = tex_val; break; } id = u_id; -} +} \ No newline at end of file diff --git a/libopenage/renderer/stages/world/render_stage.cpp b/libopenage/renderer/stages/world/render_stage.cpp index 3962daa170..e5b0774788 100644 --- a/libopenage/renderer/stages/world/render_stage.cpp +++ b/libopenage/renderer/stages/world/render_stage.cpp @@ -127,18 +127,12 @@ void WorldRenderStage::initialize_render_pass(size_t width, vert_shader_file.read()); vert_shader_file.close(); - // Initialize shader command system before loading fragment shader - this->shader_commands = std::make_unique(); - this->init_shader_commands(); - auto frag_shader_file = (shaderdir / "world2d.frag.glsl").open(); - auto base_shader = frag_shader_file.read(); - frag_shader_file.close(); - auto frag_shader_src = renderer::resources::ShaderSource( resources::shader_lang_t::glsl, resources::shader_stage_t::fragment, - this->shader_commands->integrate_command(base_shader)); + frag_shader_file.read()); + frag_shader_file.close(); this->output_texture = renderer->add_texture(resources::Texture2dInfo(width, height, resources::pixel_format::rgba8)); this->depth_texture = renderer->add_texture(resources::Texture2dInfo(width, height, resources::pixel_format::depth24)); @@ -162,22 +156,4 @@ void WorldRenderStage::init_uniform_ids() { WorldObject::anchor_offset = this->display_shader->get_uniform_id("anchor_offset"); } -void WorldRenderStage::init_shader_commands() { - // Register default shader commands - this->shader_commands->add_command( - 254, - "col = vec4(1.0f, 0.0f, 0.0f, 1.0f);", - "Red tint command"); - this->shader_commands->add_command( - 252, - "col = vec4(0.0f, 1.0f, 0.0f, 1.0f);", - "Green tint command"); - this->shader_commands->add_command( - 250, - "col = vec4(0.0f, 0.0f, 1.0f, 1.0f);", - "Blue tint command"); - - // Additional commands can be added here -} - -} // namespace openage::renderer::world +} // namespace openage::renderer::world \ No newline at end of file diff --git a/libopenage/renderer/stages/world/render_stage.h b/libopenage/renderer/stages/world/render_stage.h index f048a1cbee..ec5bb8f03e 100644 --- a/libopenage/renderer/stages/world/render_stage.h +++ b/libopenage/renderer/stages/world/render_stage.h @@ -112,12 +112,6 @@ class WorldRenderStage { */ void init_uniform_ids(); - /** - * Initialize the shader command system and register default commands. - * This must be called before initializing the shader program. - */ - void init_shader_commands(); - /** * Reference to the openage renderer. */ @@ -181,13 +175,7 @@ class WorldRenderStage { * Mutex for protecting threaded access. */ std::shared_mutex mutex; - - /** - * Shader command system for the world fragment shader. - * Manages custom rendering behaviors through alpha channel commands. - */ - std::unique_ptr shader_commands; }; } // namespace world } // namespace renderer -} // namespace openage +} // namespace openage \ No newline at end of file