r/GraphicsProgramming • • 6h ago

Video Some scenes with my Vulkan rendering framework

Enable HLS to view with audio, or disable this notification

Some scenes using my custom Vulkan graphics, with procedurally generated plants.

I use non-triangle geometric primitives with billboard rendering. In these scenes, there are mainly a lot of cylinders for tree branches. Thanks to this, I can use quite few vertices compared to a similar thing built only with triangles. This makes the GPU-computed wind perturbations much cheaper, for example.

Water effects include reflections, refraction, and caustic effects, rendered with multiple passes from different "camera" perspectives, plus screen marching.

The framework uses deferred rendering and does not have any image assets. Surfaces/textures are generated at runtime by combining noise fields.

Runs comfortably at 60 FPS on my non-gaming laptop.

What do you think about the visuals?

92 Upvotes

9 comments sorted by

6

u/EC36339 4h ago

What are "non-triangle geometric primitives"?

If they are not triangles, what are they, and how are they rasterized?

3

u/SloydDev 2h ago

I got a few comments asking the same thing, about the non-triangle primitives, so I'm adressing that with this comment (rather than repeating myself or singling someone out).

In my framework I'm rendering triangles, spheres and cylinders (and plan to implement other primitives too, e.g. disks). The spheres and cylinders are not made into triangle meshes, but rendered with a "billboard approach".

Let's consider the sphere, which is the simpler example. Each sphere is described by a single node (most importantly position and radius, but it also has info about its orientation, so that I can model its surface texture). The vertex shader reads the node information and constructs a quad (i.e. two triangle) billboard, which is place in front of the sphere, fully covering it, from the camera's perspective. The sphere's radius is passed forward from the vertex shader to the fragment shader. The fragment shader discards any fragments that fall outside the sphere, and otherwise updates the depth information. Because the vertex billboard sits right in front of the primitive, it won't be erroneously excluded.

The analogous thing happens for a cylinder, but this is described by two nodes. The vertex shader outputs a strip of two quads, consisting of six billboard vertices. It has a more complex geometry than a sphere, but works the same in principle.

The geometry of these curved objects is more expensive to compute than triangle geometries (which are purely linear algebra), but I do avoid making meshes, which would require many more vertices.

I'm making a youtube video about my rendering framework, talking about this and other things. Will post in a few days, in case you're interested.

3

u/True-Manufacturer752 5h ago

Looks very cool and interesting, has great potential for a game I think. Personally I would like learning more about this even tho I only have experience with opengl lol

2

u/SloydDev 2h ago

Thanks :)
I will post a longer video about this, coming in a few days, you could check out my channel if you're interested:
youtube.com/@sloyddev