Browse Source

apply format

djeada 1 week ago
parent
commit
0e6c9c677a

+ 1 - 2
app/core/game_engine.cpp

@@ -92,8 +92,8 @@
 #include "game/systems/victory_service.h"
 #include "game/units/factory.h"
 #include "game/units/troop_config.h"
-#include "render/entity/healing_beam_renderer.h"
 #include "render/entity/healer_aura_renderer.h"
+#include "render/entity/healing_beam_renderer.h"
 #include "render/geom/arrow.h"
 #include "render/geom/patrol_flags.h"
 #include "render/geom/stone.h"
@@ -806,7 +806,6 @@ void GameEngine::render(int pixelWidth, int pixelHeight) {
     }
   }
 
-  // Render healer auras
   {
     Render::GL::render_healer_auras(m_renderer.get(), m_renderer->resources(),
                                     m_world.get());

+ 4 - 10
assets/shaders/healing_aura.frag

@@ -32,34 +32,28 @@ void main() {
   vec3 midColor = u_auraColor;
   vec3 edgeColor = u_auraColor * 0.7;
 
-  // Dome effect: stronger at edges (high radialDist), fading toward top
   float edgeFade = smoothstep(0.2, 0.9, v_radialDist);
   float heightFade = 1.0 - smoothstep(0.0, 1.0, v_height);
-  
-  // Combine for dome shell effect
+
   float shellFade = edgeFade * heightFade;
 
   vec3 color = mix(midColor, edgeColor, v_radialDist);
-  
-  // Animated swirl effect
+
   float angle = atan(v_worldPos.z, v_worldPos.x);
   float swirl = sin(angle * 4.0 + u_time * 2.0 + v_height * 5.0) * 0.5 + 0.5;
   color += coreColor * swirl * 0.2 * shellFade;
 
-  // Flowing rings
   float ring = sin(v_height * 15.0 - u_time * 3.0) * 0.5 + 0.5;
   ring = pow(ring, 2.0);
   color += midColor * ring * 0.3 * edgeFade;
 
-  // Particle effect
   vec2 particleUV = vec2(angle * 2.0, v_height * 3.0 - u_time * 1.5);
   float particles = noise(particleUV * 6.0);
   particles = pow(particles, 2.0) * 2.0;
   color += coreColor * particles * shellFade * 0.2;
 
-  // Alpha: visible shell around the dome
   float alpha = shellFade * u_intensity * 0.7;
-  alpha += edgeFade * 0.15 * u_intensity;  // Base visibility at edges
-  
+  alpha += edgeFade * 0.15 * u_intensity;
+
   FragColor = vec4(color, clamp(alpha, 0.0, 0.85));
 }

+ 0 - 2
assets/shaders/healing_beam.vert

@@ -49,7 +49,6 @@ void main() {
   vec3 beamCenter = bezierArc(visibleT, u_startPos, u_endPos, arcHeight);
   vec3 tangent = bezierTangent(visibleT, u_startPos, u_endPos, arcHeight);
 
-  // Create local coordinate frame with safe handling for vertical tangents
   vec3 up = vec3(0.0, 1.0, 0.0);
   if (abs(dot(tangent, up)) > 0.99) {
     up = vec3(1.0, 0.0, 0.0);
@@ -84,7 +83,6 @@ void main() {
     v_glowIntensity *= 0.0;
   }
 
-  // Normal doesn't need transformation since we're in world space already
   v_normal = a_normal;
   v_texCoord = vec2(t, a_position.x * 0.5 + 0.5);
 

+ 5 - 5
render/draw_queue.h

@@ -146,11 +146,11 @@ struct HealerAuraCmd {
   float time = 0.0F;
 };
 
-using DrawCmd =
-    std::variant<GridCmd, SelectionRingCmd, SelectionSmokeCmd, CylinderCmd,
-                 MeshCmd, FogBatchCmd, GrassBatchCmd, StoneBatchCmd,
-                 PlantBatchCmd, PineBatchCmd, OliveBatchCmd, FireCampBatchCmd,
-                 TerrainChunkCmd, PrimitiveBatchCmd, HealingBeamCmd, HealerAuraCmd>;
+using DrawCmd = std::variant<GridCmd, SelectionRingCmd, SelectionSmokeCmd,
+                             CylinderCmd, MeshCmd, FogBatchCmd, GrassBatchCmd,
+                             StoneBatchCmd, PlantBatchCmd, PineBatchCmd,
+                             OliveBatchCmd, FireCampBatchCmd, TerrainChunkCmd,
+                             PrimitiveBatchCmd, HealingBeamCmd, HealerAuraCmd>;
 
 enum class DrawCmdType : std::uint8_t {
   Grid = 0,

+ 0 - 4
render/entity/healer_aura_renderer.cpp

@@ -28,12 +28,10 @@ void render_healer_auras(Renderer *renderer, ResourceManager *,
       continue;
     }
 
-    // Skip dead healers
     if (unit_comp != nullptr && unit_comp->health <= 0) {
       continue;
     }
 
-    // Only show aura when actively healing
     if (!healer_comp->is_healing_active) {
       continue;
     }
@@ -42,10 +40,8 @@ void render_healer_auras(Renderer *renderer, ResourceManager *,
                        transform->position.z);
     float radius = healer_comp->healing_range;
 
-    // Full intensity when actively healing
     float intensity = 1.0F;
 
-    // Golden-green healing color
     QVector3D color(0.4F, 1.0F, 0.5F);
 
     renderer->healer_aura(position, color, radius, intensity, animation_time);

+ 1 - 7
render/entity/healer_aura_renderer.h

@@ -2,18 +2,12 @@
 
 namespace Engine::Core {
 class World;
-} // namespace Engine::Core
+}
 
 namespace Render::GL {
 class Renderer;
 class ResourceManager;
 
-/**
- * @brief Free function to render healer auras using the backend pipeline.
- *
- * This function integrates with the scene rendering pipeline by submitting
- * healer aura commands through the draw queue system.
- */
 void render_healer_auras(Renderer *renderer, ResourceManager *resources,
                          Engine::Core::World *world);
 

+ 0 - 1
render/entity/healing_beam_renderer.cpp

@@ -13,7 +13,6 @@ void render_healing_beams(Renderer *renderer, ResourceManager *,
 
   float animation_time = renderer->get_animation_time();
 
-  // Submit each beam through the renderer's submitter interface
   for (const auto &beam : beam_system.get_beams()) {
     if (beam && beam->is_active()) {
       float intensity = beam->get_intensity();

+ 1 - 6
render/entity/healing_beam_renderer.h

@@ -2,17 +2,12 @@
 
 namespace Game::Systems {
 class HealingBeamSystem;
-} // namespace Game::Systems
+}
 
 namespace Render::GL {
 class Renderer;
 class ResourceManager;
 
-/**
- * @brief Free function to render healing beams using the backend pipeline.
- *
- * This function integrates with the scene rendering pipeline.
- */
 void render_healing_beams(Renderer *renderer, ResourceManager *resources,
                           const Game::Systems::HealingBeamSystem &beam_system);
 

+ 7 - 9
render/gl/backend.cpp

@@ -160,9 +160,8 @@ void Backend::initialize() {
   qInfo() << "Backend: HealingBeamPipeline initialized";
 
   qInfo() << "Backend: Creating HealerAuraPipeline...";
-  m_healerAuraPipeline =
-      std::make_unique<BackendPipelines::HealerAuraPipeline>(
-          this, m_shaderCache.get());
+  m_healerAuraPipeline = std::make_unique<BackendPipelines::HealerAuraPipeline>(
+      this, m_shaderCache.get());
   m_healerAuraPipeline->initialize();
   qInfo() << "Backend: HealerAuraPipeline initialized";
 
@@ -1534,11 +1533,10 @@ void Backend::execute(const DrawQueue &queue, const Camera &cam) {
           !m_healingBeamPipeline->is_initialized()) {
         break;
       }
-      m_healingBeamPipeline->render_single_beam(beam.start_pos, beam.end_pos,
-                                                beam.color, beam.progress,
-                                                beam.beam_width, beam.intensity,
-                                                beam.time, view_proj);
-      m_lastBoundShader = nullptr;  // Pipeline manages its own shader
+      m_healingBeamPipeline->render_single_beam(
+          beam.start_pos, beam.end_pos, beam.color, beam.progress,
+          beam.beam_width, beam.intensity, beam.time, view_proj);
+      m_lastBoundShader = nullptr;
       break;
     }
     case HealerAuraCmdIndex: {
@@ -1550,7 +1548,7 @@ void Backend::execute(const DrawQueue &queue, const Camera &cam) {
       m_healerAuraPipeline->render_single_aura(aura.position, aura.color,
                                                aura.radius, aura.intensity,
                                                aura.time, view_proj);
-      m_lastBoundShader = nullptr;  // Pipeline manages its own shader
+      m_lastBoundShader = nullptr;
       break;
     }
     default:

+ 4 - 4
render/gl/backend.h

@@ -71,13 +71,13 @@ public:
 
   [[nodiscard]] auto banner_shader() const -> Shader *;
 
-  [[nodiscard]] auto healing_beam_pipeline()
-      -> BackendPipelines::HealingBeamPipeline * {
+  [[nodiscard]] auto
+  healing_beam_pipeline() -> BackendPipelines::HealingBeamPipeline * {
     return m_healingBeamPipeline.get();
   }
 
-  [[nodiscard]] auto healer_aura_pipeline()
-      -> BackendPipelines::HealerAuraPipeline * {
+  [[nodiscard]] auto
+  healer_aura_pipeline() -> BackendPipelines::HealerAuraPipeline * {
     return m_healerAuraPipeline.get();
   }
 

+ 26 - 40
render/gl/backend/healer_aura_pipeline.cpp

@@ -65,7 +65,7 @@ void HealerAuraPipeline::shutdown() {
 
 void HealerAuraPipeline::shutdown_geometry() {
   if (QOpenGLContext::currentContext() == nullptr) {
-    // Context already destroyed; just drop IDs to avoid GL calls.
+
     m_vao = 0;
     m_vertexBuffer = 0;
     m_indexBuffer = 0;
@@ -108,7 +108,6 @@ auto HealerAuraPipeline::is_initialized() const -> bool {
   return m_auraShader != nullptr && m_vao != 0 && m_indexCount > 0;
 }
 
-// Mesh vertex structure
 struct AuraVertex {
   float position[3];
   float normal[3];
@@ -123,21 +122,21 @@ auto HealerAuraPipeline::create_dome_geometry() -> bool {
   std::vector<AuraVertex> vertices;
   std::vector<unsigned int> indices;
 
-  // Create a hemisphere/dome mesh
-  constexpr int stacks = 8;   // Vertical divisions
-  constexpr int slices = 16;  // Horizontal divisions
+  constexpr int stacks = 8;
+  constexpr int slices = 16;
   constexpr float pi = std::numbers::pi_v<float>;
 
   vertices.reserve(static_cast<size_t>((stacks + 1) * (slices + 1)));
 
-  // Generate vertices
   for (int i = 0; i <= stacks; ++i) {
-    float phi = (static_cast<float>(i) / static_cast<float>(stacks)) * pi * 0.5F;
+    float phi =
+        (static_cast<float>(i) / static_cast<float>(stacks)) * pi * 0.5F;
     float y = std::sin(phi);
     float r = std::cos(phi);
 
     for (int j = 0; j <= slices; ++j) {
-      float theta = (static_cast<float>(j) / static_cast<float>(slices)) * pi * 2.0F;
+      float theta =
+          (static_cast<float>(j) / static_cast<float>(slices)) * pi * 2.0F;
       float x = r * std::cos(theta);
       float z = r * std::sin(theta);
 
@@ -154,7 +153,6 @@ auto HealerAuraPipeline::create_dome_geometry() -> bool {
     }
   }
 
-  // Generate indices
   indices.reserve(static_cast<size_t>(stacks * slices * 6));
   for (int i = 0; i < stacks; ++i) {
     for (int j = 0; j < slices; ++j) {
@@ -171,7 +169,6 @@ auto HealerAuraPipeline::create_dome_geometry() -> bool {
     }
   }
 
-  // Create VAO
   glGenVertexArrays(1, &m_vao);
   if (!check_gl_error("glGenVertexArrays") || m_vao == 0) {
     return false;
@@ -184,7 +181,6 @@ auto HealerAuraPipeline::create_dome_geometry() -> bool {
     return false;
   }
 
-  // Create vertex buffer
   glGenBuffers(1, &m_vertexBuffer);
   glBindBuffer(GL_ARRAY_BUFFER, m_vertexBuffer);
   glBufferData(GL_ARRAY_BUFFER,
@@ -195,7 +191,6 @@ auto HealerAuraPipeline::create_dome_geometry() -> bool {
     return false;
   }
 
-  // Create index buffer
   glGenBuffers(1, &m_indexBuffer);
   glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_indexBuffer);
   glBufferData(GL_ELEMENT_ARRAY_BUFFER,
@@ -208,11 +203,11 @@ auto HealerAuraPipeline::create_dome_geometry() -> bool {
 
   m_indexCount = static_cast<GLsizei>(indices.size());
 
-  // Set up vertex attributes
   glEnableVertexAttribArray(VertexAttrib::Position);
-  glVertexAttribPointer(VertexAttrib::Position, ComponentCount::Vec3, GL_FLOAT,
-                        GL_FALSE, sizeof(AuraVertex),
-                        reinterpret_cast<void *>(offsetof(AuraVertex, position)));
+  glVertexAttribPointer(
+      VertexAttrib::Position, ComponentCount::Vec3, GL_FLOAT, GL_FALSE,
+      sizeof(AuraVertex),
+      reinterpret_cast<void *>(offsetof(AuraVertex, position)));
 
   glEnableVertexAttribArray(VertexAttrib::Normal);
   glVertexAttribPointer(VertexAttrib::Normal, ComponentCount::Vec3, GL_FLOAT,
@@ -220,9 +215,10 @@ auto HealerAuraPipeline::create_dome_geometry() -> bool {
                         reinterpret_cast<void *>(offsetof(AuraVertex, normal)));
 
   glEnableVertexAttribArray(VertexAttrib::TexCoord);
-  glVertexAttribPointer(VertexAttrib::TexCoord, ComponentCount::Vec2, GL_FLOAT,
-                        GL_FALSE, sizeof(AuraVertex),
-                        reinterpret_cast<void *>(offsetof(AuraVertex, tex_coord)));
+  glVertexAttribPointer(
+      VertexAttrib::TexCoord, ComponentCount::Vec2, GL_FLOAT, GL_FALSE,
+      sizeof(AuraVertex),
+      reinterpret_cast<void *>(offsetof(AuraVertex, tex_coord)));
 
   glBindVertexArray(0);
 
@@ -256,7 +252,6 @@ void HealerAuraPipeline::collect_healers(Engine::Core::World *world) {
       continue;
     }
 
-    // Skip dead healers
     if (unit_comp != nullptr && unit_comp->health <= 0) {
       continue;
     }
@@ -266,12 +261,9 @@ void HealerAuraPipeline::collect_healers(Engine::Core::World *world) {
                               transform->position.z);
     data.radius = healer_comp->healing_range;
     data.is_active = healer_comp->is_healing_active;
-    
-    // Intensity based on whether actively healing
-    // Always show aura even when not healing (0.5 base, 1.0 when active)
+
     data.intensity = data.is_active ? 1.0F : 0.5F;
-    
-    // Golden-green healing color
+
     data.color = QVector3D(0.4F, 1.0F, 0.5F);
 
     m_healerData.push_back(data);
@@ -286,19 +278,17 @@ void HealerAuraPipeline::render(const Camera &cam, float animation_time) {
   initializeOpenGLFunctions();
   clear_gl_errors();
 
-  // Save GL state
   GLboolean cullEnabled = glIsEnabled(GL_CULL_FACE);
   GLboolean depthTestEnabled = glIsEnabled(GL_DEPTH_TEST);
   GLboolean blendEnabled = glIsEnabled(GL_BLEND);
   GLboolean depthMaskEnabled = GL_TRUE;
   glGetBooleanv(GL_DEPTH_WRITEMASK, &depthMaskEnabled);
 
-  // Set up state for aura rendering
-  glDisable(GL_CULL_FACE);  // Render both sides
+  glDisable(GL_CULL_FACE);
   glEnable(GL_DEPTH_TEST);
-  glDepthMask(GL_FALSE);    // Don't write to depth
+  glDepthMask(GL_FALSE);
   glEnable(GL_BLEND);
-  glBlendFunc(GL_SRC_ALPHA, GL_ONE);  // Additive blending
+  glBlendFunc(GL_SRC_ALPHA, GL_ONE);
 
   m_auraShader->use();
   glBindVertexArray(m_vao);
@@ -309,7 +299,6 @@ void HealerAuraPipeline::render(const Camera &cam, float animation_time) {
 
   glBindVertexArray(0);
 
-  // Restore GL state
   glDepthMask(depthMaskEnabled);
   glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
   if (!blendEnabled) {
@@ -327,11 +316,11 @@ void HealerAuraPipeline::render(const Camera &cam, float animation_time) {
 
 void HealerAuraPipeline::render_aura(const HealerAuraData &data,
                                      const Camera &cam, float animation_time) {
-  // Create model matrix that positions the aura at the healer
+
   QMatrix4x4 model;
   model.setToIdentity();
   model.translate(data.position);
-  // Scale by radius (shader expects unit sphere)
+
   model.scale(data.radius);
 
   QMatrix4x4 vp = cam.get_projection_matrix() * cam.get_view_matrix();
@@ -340,7 +329,7 @@ void HealerAuraPipeline::render_aura(const HealerAuraData &data,
   m_auraShader->set_uniform(m_uniforms.mvp, mvp);
   m_auraShader->set_uniform(m_uniforms.model, model);
   m_auraShader->set_uniform(m_uniforms.time, animation_time);
-  // Pass 1.0 since we scale in model matrix now
+
   m_auraShader->set_uniform(m_uniforms.auraRadius, 1.0F);
   m_auraShader->set_uniform(m_uniforms.intensity, data.intensity);
   m_auraShader->set_uniform(m_uniforms.auraColor, data.color);
@@ -360,24 +349,22 @@ void HealerAuraPipeline::render_single_aura(const QVector3D &position,
     return;
   }
 
-  initializeOpenGLFunctions();;
+  initializeOpenGLFunctions();
+  ;
 
-  // Save GL state
   GLboolean cullEnabled = glIsEnabled(GL_CULL_FACE);
   GLboolean depthMaskEnabled = GL_TRUE;
   glGetBooleanv(GL_DEPTH_WRITEMASK, &depthMaskEnabled);
 
-  // Set up state for aura rendering
   glDisable(GL_CULL_FACE);
   glEnable(GL_DEPTH_TEST);
   glDepthMask(GL_FALSE);
   glEnable(GL_BLEND);
-  glBlendFunc(GL_SRC_ALPHA, GL_ONE);  // Additive blending
+  glBlendFunc(GL_SRC_ALPHA, GL_ONE);
 
   m_auraShader->use();
   glBindVertexArray(m_vao);
 
-  // Create model matrix
   QMatrix4x4 model;
   model.setToIdentity();
   model.translate(position);
@@ -396,7 +383,6 @@ void HealerAuraPipeline::render_single_aura(const QVector3D &position,
 
   glBindVertexArray(0);
 
-  // Restore GL state
   glDepthMask(depthMaskEnabled);
   glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
   if (cullEnabled) {

+ 5 - 30
render/gl/backend/healer_aura_pipeline.h

@@ -18,23 +18,14 @@ class Camera;
 
 namespace BackendPipelines {
 
-/**
- * @brief Data for rendering a single healer aura effect.
- */
 struct HealerAuraData {
-  QVector3D position;    // World position of healer
-  float radius;          // Healing range / aura radius
-  float intensity;       // Glow intensity (0-1)
-  QVector3D color;       // Aura color
-  bool is_active;        // Whether actively healing
+  QVector3D position;
+  float radius;
+  float intensity;
+  QVector3D color;
+  bool is_active;
 };
 
-/**
- * @brief Pipeline for rendering magical aura effects around healers.
- *
- * Renders glowing, animated dome/ring effects around healer units.
- * Shows their healing range and current healing state.
- */
 class HealerAuraPipeline final : public IPipeline {
 public:
   explicit HealerAuraPipeline(GL::Backend *backend,
@@ -47,27 +38,14 @@ public:
   void cache_uniforms() override;
   [[nodiscard]] auto is_initialized() const -> bool override;
 
-  /**
-   * @brief Collect healer data from the world for rendering.
-   */
   void collect_healers(Engine::Core::World *world);
 
-  /**
-   * @brief Render all collected healer auras.
-   */
   void render(const Camera &cam, float animation_time);
 
-  /**
-   * @brief Render a single healer aura with given parameters.
-   * Called from backend execute() when processing HealerAuraCmd.
-   */
   void render_single_aura(const QVector3D &position, const QVector3D &color,
                           float radius, float intensity, float time,
                           const QMatrix4x4 &view_proj);
 
-  /**
-   * @brief Clear collected healer data.
-   */
   void clear_data() { m_healerData.clear(); }
 
 private:
@@ -80,16 +58,13 @@ private:
   GL::ShaderCache *m_shaderCache = nullptr;
   GL::Shader *m_auraShader = nullptr;
 
-  // Geometry for dome/hemisphere
   GLuint m_vao = 0;
   GLuint m_vertexBuffer = 0;
   GLuint m_indexBuffer = 0;
   GLsizei m_indexCount = 0;
 
-  // Collected healer data for this frame
   std::vector<HealerAuraData> m_healerData;
 
-  // Cached uniform handles
   struct AuraUniforms {
     GL::Shader::UniformHandle mvp{GL::Shader::InvalidUniform};
     GL::Shader::UniformHandle model{GL::Shader::InvalidUniform};

+ 24 - 41
render/gl/backend/healing_beam_pipeline.cpp

@@ -17,13 +17,12 @@ using namespace Render::GL::VertexAttrib;
 using namespace Render::GL::ComponentCount;
 
 namespace {
-// Helper to clear any pending OpenGL errors
+
 void clear_gl_errors() {
   while (glGetError() != GL_NO_ERROR) {
   }
 }
 
-// Check for OpenGL errors and log them
 auto check_gl_error(const char *operation) -> bool {
   GLenum err = glGetError();
   if (err != GL_NO_ERROR) {
@@ -89,7 +88,6 @@ void HealingBeamPipeline::cache_uniforms() {
     return;
   }
 
-  // Use uniform_handle for required uniforms
   m_uniforms.mvp = m_beamShader->uniform_handle("u_mvp");
   m_uniforms.time = m_beamShader->uniform_handle("u_time");
   m_uniforms.progress = m_beamShader->uniform_handle("u_progress");
@@ -112,57 +110,49 @@ auto HealingBeamPipeline::create_beam_geometry() -> bool {
   std::vector<Vertex> vertices;
   std::vector<unsigned int> indices;
 
-  // Create a tube mesh along Z axis (0 to 1)
-  // The vertex shader will deform this along the beam path
-  constexpr int segments_along = 24;  // Along beam length
-  constexpr int segments_around = 8;  // Around beam circumference
+  constexpr int segments_along = 24;
+  constexpr int segments_around = 8;
   constexpr float pi = std::numbers::pi_v<float>;
 
-  vertices.reserve(static_cast<size_t>((segments_along + 1) *
-                                       (segments_around + 1)));
+  vertices.reserve(
+      static_cast<size_t>((segments_along + 1) * (segments_around + 1)));
   indices.reserve(static_cast<size_t>(segments_along * segments_around * 6));
 
   for (int i = 0; i <= segments_along; ++i) {
     float t = static_cast<float>(i) / static_cast<float>(segments_along);
 
     for (int j = 0; j <= segments_around; ++j) {
-      float angle =
-          static_cast<float>(j) / static_cast<float>(segments_around) * 2.0F *
-          pi;
+      float angle = static_cast<float>(j) /
+                    static_cast<float>(segments_around) * 2.0F * pi;
 
       float x = std::cos(angle);
       float y = std::sin(angle);
 
-      // Position: x,y define cross-section, z is position along beam (t)
       Vertex v;
       v.position = {x, y, t};
       v.normal = {x, y, 0.0F};
-      v.tex_coord = {static_cast<float>(j) / static_cast<float>(segments_around),
-                     t};
+      v.tex_coord = {
+          static_cast<float>(j) / static_cast<float>(segments_around), t};
       vertices.push_back(v);
     }
   }
 
-  // Generate indices for triangles
   for (int i = 0; i < segments_along; ++i) {
     for (int j = 0; j < segments_around; ++j) {
       unsigned int curr =
           static_cast<unsigned int>(i * (segments_around + 1) + j);
       unsigned int next = curr + static_cast<unsigned int>(segments_around + 1);
 
-      // First triangle
       indices.push_back(curr);
       indices.push_back(next);
       indices.push_back(curr + 1);
 
-      // Second triangle
       indices.push_back(curr + 1);
       indices.push_back(next);
       indices.push_back(next + 1);
     }
   }
 
-  // Create VAO
   glGenVertexArrays(1, &m_vao);
   if (!check_gl_error("glGenVertexArrays") || m_vao == 0) {
     return false;
@@ -175,7 +165,6 @@ auto HealingBeamPipeline::create_beam_geometry() -> bool {
     return false;
   }
 
-  // Create vertex buffer
   glGenBuffers(1, &m_vertexBuffer);
   glBindBuffer(GL_ARRAY_BUFFER, m_vertexBuffer);
   glBufferData(GL_ARRAY_BUFFER,
@@ -186,13 +175,11 @@ auto HealingBeamPipeline::create_beam_geometry() -> bool {
     return false;
   }
 
-  // Create index buffer
   glGenBuffers(1, &m_indexBuffer);
   glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_indexBuffer);
-  glBufferData(
-      GL_ELEMENT_ARRAY_BUFFER,
-      static_cast<GLsizeiptr>(indices.size() * sizeof(unsigned int)),
-      indices.data(), GL_STATIC_DRAW);
+  glBufferData(GL_ELEMENT_ARRAY_BUFFER,
+               static_cast<GLsizeiptr>(indices.size() * sizeof(unsigned int)),
+               indices.data(), GL_STATIC_DRAW);
   if (!check_gl_error("index buffer")) {
     shutdown_geometry();
     return false;
@@ -200,7 +187,6 @@ auto HealingBeamPipeline::create_beam_geometry() -> bool {
 
   m_indexCount = static_cast<GLsizei>(indices.size());
 
-  // Set up vertex attributes (position, normal, texcoord)
   glEnableVertexAttribArray(VertexAttrib::Position);
   glVertexAttribPointer(VertexAttrib::Position, ComponentCount::Vec3, GL_FLOAT,
                         GL_FALSE, sizeof(Vertex),
@@ -239,7 +225,6 @@ void HealingBeamPipeline::render(
   initializeOpenGLFunctions();
   clear_gl_errors();
 
-  // Save current GL state
   GLboolean cullEnabled = glIsEnabled(GL_CULL_FACE);
   GLboolean depthTestEnabled = glIsEnabled(GL_DEPTH_TEST);
   GLboolean blendEnabled = glIsEnabled(GL_BLEND);
@@ -251,12 +236,11 @@ void HealingBeamPipeline::render(
   glGetIntegerv(GL_BLEND_SRC_ALPHA, &prevBlendSrc);
   glGetIntegerv(GL_BLEND_DST_ALPHA, &prevBlendDst);
 
-  // Set up state for glow rendering
   glDisable(GL_CULL_FACE);
   glEnable(GL_DEPTH_TEST);
-  glDepthMask(GL_FALSE); // Don't write to depth buffer
+  glDepthMask(GL_FALSE);
   glEnable(GL_BLEND);
-  glBlendFunc(GL_SRC_ALPHA, GL_ONE); // Additive blending for glow
+  glBlendFunc(GL_SRC_ALPHA, GL_ONE);
 
   m_beamShader->use();
   glBindVertexArray(m_vao);
@@ -269,7 +253,6 @@ void HealingBeamPipeline::render(
 
   glBindVertexArray(0);
 
-  // Restore GL state
   glDepthMask(depthMaskEnabled);
   glBlendFunc(static_cast<GLenum>(prevBlendSrc),
               static_cast<GLenum>(prevBlendDst));
@@ -293,7 +276,6 @@ void HealingBeamPipeline::render_beam(const Game::Systems::HealingBeam &beam,
   float progress = std::clamp(beam.get_progress(), 0.0F, 1.0F);
   float alpha = std::clamp(beam.get_intensity(), 0.0F, 1.0F);
 
-  // Skip nearly invisible beams
   if (alpha < 0.01F) {
     return;
   }
@@ -310,10 +292,12 @@ void HealingBeamPipeline::render_beam(const Game::Systems::HealingBeam &beam,
   glDrawElements(GL_TRIANGLES, m_indexCount, GL_UNSIGNED_INT, nullptr);
 }
 
-void HealingBeamPipeline::render_single_beam(
-    const QVector3D &start, const QVector3D &end, const QVector3D &color,
-    float progress, float beam_width, float intensity, float time,
-    const QMatrix4x4 &view_proj) {
+void HealingBeamPipeline::render_single_beam(const QVector3D &start,
+                                             const QVector3D &end,
+                                             const QVector3D &color,
+                                             float progress, float beam_width,
+                                             float intensity, float time,
+                                             const QMatrix4x4 &view_proj) {
   if (!is_initialized()) {
     return;
   }
@@ -323,12 +307,10 @@ void HealingBeamPipeline::render_single_beam(
 
   initializeOpenGLFunctions();
 
-  // Save GL state
   GLboolean cullEnabled = glIsEnabled(GL_CULL_FACE);
   GLboolean depthMaskEnabled = GL_TRUE;
   glGetBooleanv(GL_DEPTH_WRITEMASK, &depthMaskEnabled);
 
-  // Set up state for glow rendering
   glDisable(GL_CULL_FACE);
   glEnable(GL_DEPTH_TEST);
   glDepthMask(GL_FALSE);
@@ -340,18 +322,19 @@ void HealingBeamPipeline::render_single_beam(
 
   m_beamShader->set_uniform(m_uniforms.mvp, view_proj);
   m_beamShader->set_uniform(m_uniforms.time, time);
-  m_beamShader->set_uniform(m_uniforms.progress, std::clamp(progress, 0.0F, 1.0F));
+  m_beamShader->set_uniform(m_uniforms.progress,
+                            std::clamp(progress, 0.0F, 1.0F));
   m_beamShader->set_uniform(m_uniforms.startPos, start);
   m_beamShader->set_uniform(m_uniforms.endPos, end);
   m_beamShader->set_uniform(m_uniforms.beamWidth, beam_width);
   m_beamShader->set_uniform(m_uniforms.healColor, color);
-  m_beamShader->set_uniform(m_uniforms.alpha, std::clamp(intensity, 0.0F, 1.0F));
+  m_beamShader->set_uniform(m_uniforms.alpha,
+                            std::clamp(intensity, 0.0F, 1.0F));
 
   glDrawElements(GL_TRIANGLES, m_indexCount, GL_UNSIGNED_INT, nullptr);
 
   glBindVertexArray(0);
 
-  // Restore GL state
   glDepthMask(depthMaskEnabled);
   glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
   if (cullEnabled) {

+ 0 - 22
render/gl/backend/healing_beam_pipeline.h

@@ -19,16 +19,6 @@ class Camera;
 
 namespace BackendPipelines {
 
-/**
- * @brief Pipeline for rendering magical healing beam visual effects.
- *
- * Renders glowing, animated energy beams from healers to their targets.
- * Uses GPU shaders for impressive magical effects including:
- * - Curved arc path with bezier interpolation
- * - Spiral twisting animation
- * - Flowing energy particles
- * - Golden-green magical glow
- */
 class HealingBeamPipeline final : public IPipeline {
 public:
   explicit HealingBeamPipeline(GL::Backend *backend,
@@ -41,19 +31,9 @@ public:
   void cache_uniforms() override;
   [[nodiscard]] auto is_initialized() const -> bool override;
 
-  /**
-   * @brief Render all active healing beams.
-   * @param beam_system The system containing active beams.
-   * @param cam The camera for view/projection matrices.
-   * @param animation_time Current animation time for shader effects.
-   */
   void render(const Game::Systems::HealingBeamSystem *beam_system,
               const Camera &cam, float animation_time);
 
-  /**
-   * @brief Render a single healing beam with given parameters.
-   * Called from backend execute() when processing HealingBeamCmd.
-   */
   void render_single_beam(const QVector3D &start, const QVector3D &end,
                           const QVector3D &color, float progress,
                           float beam_width, float intensity, float time,
@@ -69,13 +49,11 @@ private:
   GL::ShaderCache *m_shaderCache = nullptr;
   GL::Shader *m_beamShader = nullptr;
 
-  // Raw OpenGL handles like other pipelines
   GLuint m_vao = 0;
   GLuint m_vertexBuffer = 0;
   GLuint m_indexBuffer = 0;
   GLsizei m_indexCount = 0;
 
-  // Cached uniform handles
   struct BeamUniforms {
     GL::Shader::UniformHandle mvp{GL::Shader::InvalidUniform};
     GL::Shader::UniformHandle time{GL::Shader::InvalidUniform};

+ 1 - 2
render/gl/buffer.cpp

@@ -71,8 +71,7 @@ void VertexArray::bind() {
       qWarning() << "VertexArray glGenVertexArrays error" << genErr;
     }
   }
-  
-  // Clear any pre-existing errors from previous operations
+
   while (glGetError() != GL_NO_ERROR) {
   }