Skip to content

XinCastle/Project6-Vulkan-Grass-Rendering

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vulkan Grass Rendering

University of Pennsylvania, CIS 565: GPU Programming and Architecture, Project 6

  • Xincheng Zhang
  • Tested on: *Windows 10, i7-4702HQ @ 2.20GHz 8GB, GTX 870M 3072MB (Personal Laptop)

Description&Features


In this project, I use Vulkan to implement a grass simulator and renderer. I also use compute shaders to perform physics calculations on Bezier curves that represent individual grass blades in my application. Since rendering every grass blade on every frame will is fairly inefficient, I also use compute shaders to cull grass blades that don't contribute to a given frame. The remaining blades are passed to a graphics pipeline, in which I write several shaders. I write a vertex shader to transform Bezier control points, tessellation shaders to dynamically create the grass geometry from the Bezier curves, and a fragment shader to shade the grass blades.

Task Done:

  • Simulate gravity force
  • Simulate wind force (sinusoidal function)
  • Simulate recovery force
  • Culling test (orientation, frustum, distance)
  • Tessellating Bezier curves into grass blades

.

Result in Progress


Result GIF

  • Overall Result overview (2^20 grass blades.)

  • Distance Culling Result (2^15 blades in the scene.) (far plane set to be 5 to make it obvious)

  • Frustum Culling Result

. Implementation

.

Performance Analysis


  • When the number of blades are smaller than 2^13, the difference between w/ culling and without culling is not obvious. Then culling significantly decreses render time when the number of blades is over 2^16. Here is the chart:

  • Render time Comparison between three culling tests. Compared to orientation and frustum, distance cullling seems better at high number of blades (or it's just because I filtered out too many blades as a result of distance setting):

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C++ 90.6%
  • CMake 5.2%
  • GLSL 3.9%
  • C 0.3%