PointLightComponent struct in Thread
Omnidirectional light at the entity's position. Standard
1 / (1 + L·d + Q·d²) attenuation.
Properties
| Color | Thread::Vec3 | Linear RGB. Default {1, 1, 1}. |
| Intensity | float | Output multiplier. Default 1.0. |
| Radius | float | Cut-off distance in metres. Default 10.0. |
| CastShadows | bool | Shadow from this light: six 90° depth maps packed into one atlas. The scene shadows the first point light that asks. Default false. |
| ShadowBias | float | Depth offset against shadow acne. Default 0.005. |
| ShadowSoftness | float | Penumbra radius in shadow-map texels; 0 = hard. Default 4.0. |
| Enabled | bool | Toggle the light without removing it. |
Example
Entity torch = scene->CreateEntity("Torch");
torch.GetComponent<Thread::TransformComponent>().Translation = { 2.0f, 1.5f, 0.0f };
auto& pl = torch.AddComponent<Thread::PointLightComponent>();
pl.Color = { 1.0f, 0.55f, 0.2f };
pl.Intensity = 3.0f;
pl.Radius = 8.0f;
PointLightComponent struct w Thread
Światło świecące we wszystkich kierunkach z pozycji encji. Standardowe tłumienie
1 / (1 + L·d + Q·d²).
Właściwości
| Color | Thread::Vec3 | Liniowe RGB. Domyślnie {1, 1, 1}. |
| Intensity | float | Mnożnik jasności. Domyślnie 1.0. |
| Radius | float | Odległość odcięcia w metrach. Domyślnie 10.0. |
| CastShadows | bool | Cień od tego światła: sześć map głębi 90° w jednym atlasie. Scena cieniuje pierwsze światło punktowe, które o to prosi. Domyślnie false. |
| ShadowBias | float | Przesunięcie głębi przeciw „shadow acne”. Domyślnie 0.005. |
| ShadowSoftness | float | Promień półcienia w tekselach mapy cieni; 0 = ostry. Domyślnie 4.0. |
| Enabled | bool | Włącza/wyłącza światło bez usuwania komponentu. |
Przykład
Entity torch = scene->CreateEntity("Torch");
torch.GetComponent<Thread::TransformComponent>().Translation = { 2.0f, 1.5f, 0.0f };
auto& pl = torch.AddComponent<Thread::PointLightComponent>();
pl.Color = { 1.0f, 0.55f, 0.2f };
pl.Intensity = 3.0f;
pl.Radius = 8.0f;