Skip to content

Lighting

Eddie S edited this page Oct 2, 2020 · 3 revisions

Lighting

Lighting class is contained by Scene. It allows you to add, remove, update lights on scene that have an influence on object material's color.

  • Ambient Lighting

  • Dynamic Lighting

  • Static Lighting

  • Ambient

    This type of lighting influences all objects on a scene. (Skybox is influenced too)

    glm::vec4 ambient_color

    First three components is RGB color, A component is intensity.

  • Dynamic

    It is runtime lighting calculations are proccessed for each frame in fragment shader. It allows you to move lights around, change its color, radius and other properties.

    • PointLight

      Influences objects in a specified sphere.

      struct PointLight {
        glm::vec4 position;
        glm::vec4 color;
        float constant {1.0f};
        float linear {0.7f};
        float quadratic {1.8f};
        float radius;
      };
      
      `PointLight(const glm::vec3& position, const glm::vec4& color, float radius) noexcept;`
      
      
    • DirectionalLight

      struct DirectionalLight {
        glm::vec4 direction;
        glm::vec4 color;
      };
      
    • SpotLight

      Not implemented yet.

  • Static

    Baking maps is not in the nearest future : /

Clone this wiki locally