Serenity Operating System
1/*
2 * Copyright (c) 2022, Jesse Buhagiar <jooster669@gmail.com>
3 *
4 * SPDX-License-Identifier: BSD-2-Clause
5 */
6
7#pragma once
8
9#include <LibGfx/Vector3.h>
10#include <LibGfx/Vector4.h>
11
12namespace GPU {
13
14struct Light {
15 bool is_enabled { false };
16
17 // According to the OpenGL 1.5 specification, page 56, all of the parameters
18 // for the following data members (positions, colors, and reals) are all
19 // floating point.
20 Vector4<float> ambient_intensity { 0.0f, 0.0f, 0.0f, 1.0f };
21 Vector4<float> diffuse_intensity { 0.0f, 0.0f, 0.0f, 1.0f };
22 Vector4<float> specular_intensity { 0.0f, 0.0f, 0.0f, 1.0f };
23 Vector4<float> position { 0.0f, 0.0f, 1.0f, 0.0f };
24 Vector3<float> spotlight_direction { 0.0f, 0.0f, -1.0f };
25
26 float spotlight_exponent { 0.0f };
27 float spotlight_cutoff_angle { 180.0f };
28 float constant_attenuation { 1.0f }; // This is referred to `k0i` in the OpenGL spec
29 float linear_attenuation { 0.0f }; // This is referred to `k1i` in the OpenGL spec
30 float quadratic_attenuation { 0.0f }; // This is referred to `k2i` in the OpenGL spec
31};
32
33}