Skip to content

Commit 345583c

Browse files
committed
Readme
1 parent 7f57ea4 commit 345583c

27 files changed

Lines changed: 69 additions & 6 deletions

README.md

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,66 @@ Here are the features implemented:
3636
* Vulkan setups: add descriptor set layout for the compute shader and the grass vertex shader, update the descriptor sets and record command buffers. Bascially learning the complicated APIs.
3737

3838
### Tessellation level based on distance
39+
The tesselation level is interpolated along `minTessLevel` and `maxTessLevel` based on the distance between camera and current `gl_position`. We draw the blades in `Quad` execution mode and we would like to add more tessellation along direction of height of blade, we assign calculated tessellation level to gl_TessLevelInner[1], gl_TessLevelOuter[0] and gl_TessLevelOuter[2] from the reference of this image(Domain parameterization for tessellation primitive modes).
3940

41+
![](img/quad.png)
42+
43+
Here is the chart for FPS (base camera position) comparision upon different settings:
44+
45+
||<div style="width:150px">Based on distance</div>|<div style="width:150px">TessLevel = 3</div>|<div style="width:150px">TessLevel = 5</div>|<div style="width:150px">TessLevel = 9</div>|
46+
|----|----|----|----|----|
47+
|Image|![](img/tessLevel/basedondist.png)|![](img/tessLevel/3.png)|![](img/tessLevel/5.png)|![](img/tessLevel/9.png)|
48+
|FPS|658|759|699|580|
49+
50+
Tesslevel changed based on distance keep a visually pleasant outlook while improve the frame rate other than the fixed level method.
4051

4152
### Force Simulation
53+
|<div style="width:150px">Gravity</div>|<div style="width:150px">Recovery</div>|<div style="width:150px">Wind</div>|<div style="width:150px">Overall</div>|
54+
|----|----|----|----|
55+
|![](img/force/gravity.gif)|![](img/force/gravity_recover.gif)|![](img/force/wind.gif)|![](img/force/all.gif)|
56+
57+
Here are the GIFs for seperate force take place upon v2 in compute shader. Note, only recovery force will not make visual change, so I add up recovery force and gravity force together for recovery force case.
4258

4359
### Culling tests
60+
#### Orientation test
61+
|<div style="width:150px">No test</div>|<div style="width:150px">threshold = 0.6</div>|<div style="width:150px">threshold = 0.7</div>|<div style="width:150px">threshold = 0.8</div>|
62+
|----|----|----|----|
63+
|![](img/orientation/no.png)|![](img/orientation/0.6.png)|![](img/orientation/0.7.png)|![](img/orientation/0.8.png)|
64+
65+
I conducted orientation test based on the abs dot product between view direction and vector along the width of the blade. The higher threshold will cull more blades in the scene due to a stricter condition.
66+
67+
#### View frustum test
68+
|<div style="width:150px">No test</div>|<div style="width:150px">tolerance = 0.05</div>|<div style="width:150px">tolerance = 0.5</div>|
69+
|----|----|----|
70+
|![](img/view_frustum/no.png)|![](img/view_frustum/0.05.png)|![](img/view_frustum/0.5.png)|
71+
72+
The view frustum test remove all blades doesn't enter the view frustum away to reduce computation. Higher tolerance will has a closer result to the result without this test, by keeping more grass by the edge.
73+
74+
#### Distance test
75+
76+
Here's the comparison for no test versus test with different paramters:
77+
78+
No distance test:
79+
![](img/distance/no.png)
80+
81+
||dmax = 4|dmax = 16|
82+
|----|----|----|
83+
|n = 4|![](img/distance/4_4.png)|![](img/distance/4_16.png)|
84+
|n = 16|![](img/distance/16_4.png)|![](img/distance/16_16.png)|
85+
86+
Larger n and larger distance threshold will all increase the culled blades count.
4487

4588
## Performance Analysis
46-
### Different numbers of grass blades
89+
For all the performance test, I enabled `VK_LAYER_LUNARG_monitor` layer to display FPS on the application window title. The setting can be changed in `instance.cpp`.
90+
91+
### Different number of grass blades
92+
Here is a chart of frame rate versus number of grass blades:
93+
![](img/num_of_blade.png)
4794

95+
As we may suppose, the higher blade related to a lower FPS. When the blades is of reasonable count(less than 1<<16 here), the decrease of FPS is proportional to the log of #blades. Otherwise, the performance decreases in a great scale and produce a bad visual output for user.
4896

4997
### Improvement from culling
98+
Here is a chart of frame rate versus different culling methods in 1<<16 blade case:
99+
![](img/cull_test.png)
50100

101+
Since the effect of culling largely rely on the paramters in culling method and the camera's view direction and position, the FPS may change largely for each methods. We may conclude from this chart that the three culling methods are effective in controlling the frame rate. Especially, the orientation test and view frustum test will optmize the scene largely without hurting the visual performance for grass-dense scene.
32.5 KB
Binary file not shown.

img/cull_test.png

27.9 KB
Loading

img/distance/16_16.png

461 KB
Loading

img/distance/16_4.png

327 KB
Loading

img/distance/4_16.png

425 KB
Loading

img/distance/4_4.png

318 KB
Loading

img/distance/no.png

292 KB
Loading

img/force/all.gif

4.89 MB
Loading

img/force/gravity.gif

2.92 MB
Loading

0 commit comments

Comments
 (0)