Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions docs/lighting/clustered/clustered_light_inspector.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
title: Clustered Light Inspector
weight: 30
features:
- USE_CLUSTERED
---
# Developer UI

In P2CE, you can enable the developer UI using the `devui_toggle_menu` console command. Currently, it consists of 8 menus: Windows, Graphics, Profiler, Map, Scripting, Entity, Settings and Debug.

Graphics menu is the one needed. Upon pressing, four more buttons appear: Fog Config, Clustered Light Inspector, CSM Config and Post Processing. You need to choose the **Clustered Light Inspector**.

![Developer UI](images/devui3.png)

## Clustered Light Inspector

Clustered Light Inspector is a menu where you can control `light_rt` entities in real time in-game. There are various options that give almost a full control over the entity. You can control all the default light options, such as `Constant`, `Linear`, `Quadratic`, `0% Intencity Falloff`, `50% Intencity Falloff`, `Minimum Brightness Threshold`, `Override Radius` and `Light Scale`, as well as `Color` using the color palette, `Shadow Scale`, `Near Z`, light's `Pattern` and entity's position in the map.

> [!TIP]
> Position bars are scrollable!

There are additional debugging and finding options. "Show Light Bounds" is relevant for `light_rt` and shows bounds of the light as a sphere. "Show Light Cone" is relevant for `light_rt_spot` and shows bounds of the light spot. "Show Only in Radius" will only display clustered lights in a specified radius.

* Top: Clustered Light Inspector
* Middle: Clustered Light Inspector with the selected light's properties tweaked
* Bottom: Clustered Light Inspector with the selected light's position edited using XYZ bars

![Clustered Light Inspector](images/clustered_ui1.png)

![Clustered Light Inspector](images/clustered_ui2.png)

![Clustered Light Inspector](images/clustered_ui3.png)

52 changes: 0 additions & 52 deletions docs/lighting/clustered/differences.md

This file was deleted.

Binary file removed docs/lighting/clustered/images/basic_light1.png
Binary file not shown.
Binary file removed docs/lighting/clustered/images/basic_light2.png
Binary file not shown.
Binary file added docs/lighting/clustered/images/clustered_ui1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/lighting/clustered/images/clustered_ui2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/lighting/clustered/images/clustered_ui3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/lighting/clustered/images/devui3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/lighting/clustered/images/fancy_light1.png
Binary file not shown.
Binary file removed docs/lighting/clustered/images/fancy_light2.png
Binary file not shown.
Binary file added docs/lighting/clustered/images/light_dynamic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/lighting/clustered/images/light_spec.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/lighting/clustered/images/light_static+.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/lighting/clustered/images/light_static.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/lighting/clustered/images/only_direct1.jpg
Binary file not shown.
Binary file removed docs/lighting/clustered/images/only_direct2.jpg
Binary file not shown.
Binary file removed docs/lighting/clustered/images/only_indirect.jpg
Binary file not shown.
Binary file removed docs/lighting/clustered/images/point_1024_25.jpg
Binary file not shown.
Binary file removed docs/lighting/clustered/images/point_1024_50.jpg
Binary file not shown.
Binary file removed docs/lighting/clustered/images/point_1024_75.jpg
Binary file not shown.
Binary file removed docs/lighting/clustered/images/point_256_25.jpg
Binary file not shown.
Binary file removed docs/lighting/clustered/images/point_256_50.jpg
Binary file not shown.
Binary file removed docs/lighting/clustered/images/point_256_75.jpg
Binary file not shown.
Binary file removed docs/lighting/clustered/images/point_512_25.jpg
Binary file not shown.
Binary file removed docs/lighting/clustered/images/point_512_50.jpg
Binary file not shown.
Binary file removed docs/lighting/clustered/images/point_512_75.jpg
Diff not rendered.
Binary file removed docs/lighting/clustered/images/shadow_size3.jpg
Diff not rendered.
Binary file removed docs/lighting/clustered/images/shadow_size5.jpg
Diff not rendered.
Binary file removed docs/lighting/clustered/images/shadow_size7.jpg
Diff not rendered.
Binary file removed docs/lighting/clustered/images/shadowed_dynamic.jpg
Diff not rendered.
Diff not rendered.
Binary file removed docs/lighting/clustered/images/shadowed_static.jpg
Diff not rendered.
Binary file removed docs/lighting/clustered/images/shadowed_staticb.jpg
Diff not rendered.
Binary file removed docs/lighting/clustered/images/shadows1.jpg
Diff not rendered.
Binary file added docs/lighting/clustered/images/shadows1.png
Binary file added docs/lighting/clustered/images/shadowsize3.png
Binary file added docs/lighting/clustered/images/shadowsize5.png
Binary file added docs/lighting/clustered/images/shadowsize7.png
Binary file removed docs/lighting/clustered/images/specular1.jpg
Diff not rendered.
Binary file removed docs/lighting/clustered/images/specular2.jpg
Diff not rendered.
Binary file removed docs/lighting/clustered/images/specular3.jpg
Diff not rendered.
Binary file removed docs/lighting/clustered/images/specular_metal1.jpg
Diff not rendered.
Binary file removed docs/lighting/clustered/images/specular_metal2.jpg
Diff not rendered.
Binary file added docs/lighting/clustered/images/specular_off.png
Binary file added docs/lighting/clustered/images/specular_on.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
81 changes: 0 additions & 81 deletions docs/lighting/clustered/light_type_reference.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/lighting/clustered/meta.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "title": "Clustered Shading" }
{ "title": "Clustered Lighting" }
64 changes: 50 additions & 14 deletions docs/lighting/clustered/quick_start.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,67 @@
---
title: Quick Start Guide
weight: 20
features:
- USE_CLUSTERED
---
# Quick Start Guide

"I want an unmoving normal Source engine light, but better, and not slow"
### "I want an expensive light that has fancy shadows and isn't supposed to move"

1. Add a light_rt or light_rt_spot entity
2. Set "Light mode" to "Specular"
3. Make sure the "Shadowed" spawnflag is UNCHECKED
4. Set "Radius" and "50 percent scale" KeyValues to adjust the look and feel
5. For best results, use PBR textures with appropriate MRAOs and normal maps
2. Set "Specular Light Mode" to "Dynamic Only"
3. Set "Direct Light Mode" to "Dynamic Only"
4. Set "Indirect Light Mode" to "Static Only
5. Set "Initial Shadow Size" to 6 or 7
6. Make sure the "Shadowed" flag is **checked**
7. Set "50 percent falloff distance" and "0 percent falloff distance" KeyValues to adjust the look and feel
8. For best results, use PBR textures with appropriate MRAOs and normal maps

![Keyvalues](images/basic_light1.png)
![Keyvalues](images/properties_dynamic.png)

![Spawnflags](images/basic_light2.png)
### "I want a fully dynamic light that is supposed to move and interact with other dynamic lights"

"I want an expensive light that has fancy shadows or moves around"
1. Add a light_rt or light_rt_spot entity
2. Set "Specular Light Mode" to "Dynamic Only"
3. Set "Direct Light Mode" to "Dynamic Only"
4. Set "Indirect Light Mode" to "None"
5. Set "Initial Shadow Size" to something around 5
6. Make sure the "Shadowed" flag is **checked**
7. Set "50 percent falloff distance" and "0 percent falloff distance" KeyValues to adjust the look and feel
8. For best results, use PBR textures with appropriate MRAOs and normal maps

![Keyvalues](images/properties_dynamic2.png)

### "I want a regular, cheap static light"

1. Add a light_rt or light_rt_spot entity
2. Set "Light mode" to "Static Bounce" (for mostly stationary) or "Fully Dynamic" (frequently moves)
3. Set "Initial Shadow Size" to somewhere around 5 to 7
4. Make sure the "Shadowed" spawnflag is CHECKED
5. Set "Radius" and "50 percent scale" KeyValues to adjust the look and feel
2. Set "Specular Light Mode" to "None"
3. Set "Direct Light Mode" to "Static Only"
4. Set "Indirect Light Mode" to "Static Only"
5. Set "50 percent falloff distance" and "0 percent falloff distance" KeyValues to adjust the look and feel
6. For best results, use PBR textures with appropriate MRAOs and normal maps

![Keyvalues](images/fancy_light2.png)
![Keyvalues](images/properties_static.png)

### "I only want indirect lighting"

1. Add a light_rt or light_rt_spot entity
2. Set "Specular Light Mode" to "None"
3. Set "Direct Light Mode" to "None"
4. Set "Indirect Light Mode" to "Static Only"
5. Set "50 percent falloff distance" and "0 percent falloff distance" KeyValues to adjust the look and feel
6. For best results, use PBR textures with appropriate MRAOs and normal maps

![Keyvalues](images/properties_indirect.png)

### "I only want a specular reflection"

1. Add a light_rt or light_rt_spot entity
2. Set "Specular Light Mode" to "None"
3. Set "Direct Light Mode" to "None"
4. Set "Indirect Light Mode" to "Static Only"
5. Make sure the "Shadowed" flag is **checked**
6. Set "50 percent falloff distance" and "0 percent falloff distance" KeyValues to adjust the look and feel
7. For best results, use PBR textures with appropriate MRAOs and normal maps

![Spawnflags](images/fancy_light1.png)
![Keyvalues](images/properties_specular.png)
35 changes: 18 additions & 17 deletions docs/lighting/clustered/troubleshooting.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,40 @@
---
title: "Troubleshooting and Known Issues"
title: "Known Issues"
weight: 40
features:
- USE_CLUSTERED
---
# Troubleshooting and Known Issues

This is a list of currently known issues and some troubleshooting tips for any issues with clustered lighting.

**"Everything is completely broken/corrupted"**
### "My lights don't have shadows" / "My lights are shining through walls"

* Certain GPU models may have trouble running the clustered renderer. **If you experience this, let us know what GPU brand/model, operating system and other hardware specs you're using.** Usually this issue has been observed when running the game on Linux under DXVK on AMD platforms. However, the circumstances in which this has been observed should not be possible in production.
* For cheap static shadows, make sure "Direct light mode" is set to "Static Only" for your light entity. With this option, specular lighting will still travel through walls. If that's an issue for your map, you may need to use dynamic shadows or turn off specular.
* For dynamic shadows, make sure the "Shadowed" spawn flag is enabled on the light that should be casting shadows.

**"My lights don't have shadows" / "My lights are shining through walls"**
### "I set the Shadowed spawn flag, but there are still no shadows/light leaks through walls"

* For cheap static shadows, make sure you are using baked direct lighting for static shadows, (Light mode "specular" or "static.") With this option, specular lighting will still travel through walls. If that's an issue for your map, you may need to use dynamic shadows or turn off specular.
* For dynamic shadows, make sure the "Shadowed" spawn flag is set on the light that should be casting shadows.
* You have too many dynamic shadows updating at once. Remember that **each shadow size level increases the shadow atlas size by a factor of 4**, and **the shadow atlas cannot have exceed a value of 7**, so if there are for example 2 `light_rt`s with shadow size of 6 close to each other, they will overlap and therefore will not produce any shadows. However, there is an unstable workaround, where by enabling `light_rt`s one by one they have a chance to keep their shadows.

**"I set the Shadowed spawn flag, but there are still no shadows/light leaks through walls"**
### "My dynamic shadows are blurry"

* You may have too many dynamic shadows updating at once. This is a known issue without a current workaround. Let us know if you find one!
* Set the "Initial Shadow Size" keyvalue of your light to something around 6.

**"My dynamic shadows are blurry"**
### "My dynamic shadows are 'frozen' or don't update" / "Some entities like rockets don't cast shadows"

* Set the "Initial Shadow Size" key on your light to something around 7, or higher if you really need it.
* Shadows are updated when entities move near the light source. Some entities aren't hooked up properly, this is a known issue. Most entities should be fixed (prop_dynamic, prop_physics), but if you find any entity that does not update shadows, make sure to let us know on the Strata issue tracker.

**"My dynamic shadows are 'frozen' or don't update" / "Some entities like rockets don't cast shadows"**
### "My dynamic shadows update in low fps"

* Shadows are updated when entities move near the light source. Some entities aren't hooked up properly, this is a known issue. Most entities should be fixed (prop_dynamic, prop_physics), but if you find any entity that does not update shadows, make sure to let us know on the [Strata issue tracker](https://github.com/StrataSource/Engine/issues).
* There is a cap on how many faces can get their shadows updated, and this cap is called the **shadow frame budget**. This is an optimisation technique that prevents the game from lagging on low-end devices. You can increase the budget by using the `r_clustered_shadowframebudget` console command. Note that this will significantly lower your fps when used carelessly.

**"Shadows glitch or flicker when a light is moving"**
### "Shadows glitch or flicker when a light is moving"

* This is a known issue without a current workaround. Let us know if you find one!
* Clustered shadows update less frequently than the game itself, so if a moving clustered light entity cannot keep up updating the shadowmap, the shadows from that entity will flicker. This often happens in heavy maps with a lot of clustered lights, and rarely if the light peaks from a corner, especially when lighting up a huge area. There is no workaround other than not moving clustered lights too fast and using dynamic shadows only where nesessary.

**"I see light coming from light sources that aren't in the current PVS"**
### "Everything is completely broken/corrupted and I can't fix it"

* This is a known issue without a current workaround. Let us know if you find one!
* Certain GPU models may have trouble running the clustered renderer. **If you experience this, let us know what GPU brand/model, operating system and other hardware specs you're using.** Clustered lights may act weird when running the game on Linux under DXVK on AMD platforms. However, the circumstances in which they break should not be possible in production.

If you have any issues that are not addressed in this article, make sure to report it to us on the [Strata issue tracker](https://github.com/StrataSource/Engine/issues).
## If you have any issues that are not addressed in this article, make sure to report it to us on the [Strata issue tracker](https://github.com/StrataSource/Engine/issues).
Loading