You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+52-1Lines changed: 52 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,15 +36,66 @@ Here are the features implemented:
36
36
* 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.
37
37
38
38
### 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).
39
40
41
+

42
+
43
+
Here is the chart for FPS (base camera position) comparision upon different settings:
44
+
45
+
||<divstyle="width:150px">Based on distance</div>|<divstyle="width:150px">TessLevel = 3</div>|<divstyle="width:150px">TessLevel = 5</div>|<divstyle="width:150px">TessLevel = 9</div>|
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.
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.
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:
Larger n and larger distance threshold will all increase the culled blades count.
44
87
45
88
## 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
+

47
94
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.
48
96
49
97
### Improvement from culling
98
+
Here is a chart of frame rate versus different culling methods in 1<<16 blade case:
99
+

50
100
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.
0 commit comments