SpotLightComponent struct in Thread
A cone (spot) light. Position and direction come from the entity's TransformComponent — translate/rotate the entity to aim it. Intensity falls off inside the cone between the inner and outer angles.
Properties
| Color | Vec3 | Light colour (linear RGB). |
| Intensity | float | Brightness multiplier. |
| Range | float | Maximum reach in world units. |
| InnerAngle | float | Degrees — full intensity inside this cone. |
| OuterAngle | float | Degrees — falls to zero by this edge (soft cone rim). |
| Enabled | bool | Master switch. |
Shadows
The scene shadows the first shadow-casting spot light using a single perspective depth map from the spot's point of view.
| CastShadows | bool | Enable the perspective shadow map (default off). |
| ShadowBias | float | Depth bias to fight shadow acne. |
| ShadowSoftness | float | Penumbra radius in shadow-map texels (0 = hard). |
Example
auto e = scene.CreateEntity("Flashlight");
auto& t = e.GetComponent<Thread::TransformComponent>();
t.Translation = { 0, 3, 0 };
t.Rotation = { -1.2f, 0, 0 }; // aim downward (radians)
auto& s = e.AddComponent<Thread::SpotLightComponent>();
s.Range = 20.0f;
s.InnerAngle = 15.0f;
s.OuterAngle = 28.0f;
s.CastShadows = true;
See also DirectionalLightComponent, PointLightComponent, and the Render Pipeline shadows section.
SpotLightComponent struct w Thread
Światło stożkowe (reflektor). Pozycja i kierunek pochodzą z TransformComponent encji — przesuń/obróć encję, żeby je wycelować. Jasność opada wewnątrz stożka między kątem wewnętrznym a zewnętrznym.
Właściwości
| Color | Vec3 | Kolor światła (liniowe RGB). |
| Intensity | float | Mnożnik jasności. |
| Range | float | Maksymalny zasięg w jednostkach świata. |
| InnerAngle | float | Stopnie — pełna jasność wewnątrz tego stożka. |
| OuterAngle | float | Stopnie — spada do zera na tej krawędzi (miękki brzeg stożka). |
| Enabled | bool | Główny przełącznik. |
Cienie
Scena cieniuje pierwsze rzucające cień światło stożkowe jedną perspektywiczną mapą głębi widzianą z jego punktu.
| CastShadows | bool | Włącza perspektywiczną mapę cieni (domyślnie wyłączona). |
| ShadowBias | float | Przesunięcie głębi przeciw „shadow acne”. |
| ShadowSoftness | float | Promień półcienia w tekselach mapy cieni (0 = ostry). |
Przykład
auto e = scene.CreateEntity("Flashlight");
auto& t = e.GetComponent<Thread::TransformComponent>();
t.Translation = { 0, 3, 0 };
t.Rotation = { -1.2f, 0, 0 }; // skierowane w dół (radiany)
auto& s = e.AddComponent<Thread::SpotLightComponent>();
s.Range = 20.0f;
s.InnerAngle = 15.0f;
s.OuterAngle = 28.0f;
s.CastShadows = true;
Zobacz też DirectionalLightComponent, PointLightComponent oraz sekcję cieni w Potoku renderowania.