Skip to content

Commit 6279641

Browse files
committed
finished readme
1 parent 0cd46de commit 6279641

6 files changed

Lines changed: 12 additions & 2 deletions

File tree

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,20 @@ Clustered Deferred Shading effectively decouples lighting cost from scene comple
5050

5151
## Performance Analysis
5252

53+
Before we compare the implementations, we should deteremine what parameters they perform best with. The primary factor into performance for this project is the max number of lights per tile. Shown below is a graph which compares how the max number of lights per tile affect performance
54+
![max](img/lightspertile.png)
55+
Each method was tested on a scene with 5000 lights to adequately stress test the number of maxx lights per tile. Naive does not use light tiling so it has no affect on it. We see that both clustered forward+ and clustered deferred perform best with lower max lights per tile. However, at 512 lights per tile, there are noticable visual bugs. This is because not all lights are being accounted for as reaching the max begins to cut off lights from contributing to the scenes color.
56+
![bug](img/visualbug.png)
57+
Thus, this becomes more of a quality test rather than performance. For testing purposes, 2058 will be the max number of lights per tile as this minimizes the risk of lights not being included while not killing performance.
5358

59+
Now we are able to compare each of the implementations. Below is a graph showing the frame rate of each implementation with increasing number of lights.
60+
![fps](img/lightcount.png)
61+
We can see that clustered deferred performs best in all cases. This makes sense as it is the most optimized method of the three for rendering. It capitalizes on the optimizations of forward plus and deferred, making it the best performer of the three. Additionally, we see that as the number of lights increases, the rate at which fps drops decreases for clustered forward+ and clustered deferred. This is because these algorithms are meant for handling large numbers of lights. Tiling lights means that increasing the number of lights won't be as difficult to compute as a naive implementation. If naive were to run better, we would likely see that rate at which naive falls off would be much faster compared to these two implementations.
5462

5563
### Credits
5664

65+
- UPenn GPU Programming and Architecture Forward and Deferred Shading Slides (by Patrick Cozzi and Mohammed Sheznan)
66+
- Upenn CIS4600 an CIS4610 Slides (by Adam Mally)
5767
- [Vite](https://vitejs.dev/)
5868
- [loaders.gl](https://loaders.gl/)
5969
- [dat.GUI](https://github.com/dataarts/dat.gui)

img/lightcount.png

62.3 KB
Loading

img/lightspertile.png

61.6 KB
Loading

img/visualbug.png

6.75 MB
Loading

src/shaders/clustered_deferred_fullscreen.fs.wgsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
@group(1) @binding(2) var gBufferAlbedo: texture_2d<f32>;
3232

3333
// Debug toggles
34-
const SHOW_ALBEDO : bool = true;
34+
const SHOW_ALBEDO : bool = false;
3535
const SHOW_NORMAL : bool = false;
3636
const SHOW_POSITION : bool = false;
3737

src/shaders/shaders.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const constants = {
3232

3333
lightRadius: 2,
3434
clusterSize: 16,
35-
maxLights: 1024
35+
maxLights: 2048
3636
};
3737

3838
// =================================

0 commit comments

Comments
 (0)