Skip to content

DavidLyhedDanielsson/gfx_demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GFX DEMO

No nonsense, no framework, no bloat, just examples of rendering techniques (currently only in Direct3D 12).

Goals

  • Small, self-contained implementations of various rendering techniques
  • Each demo is contained within its own file, i.e. one .hpp and .cpp per demo
  • Each demo demonstrates one technique or feature
  • The code is focused on the demo; use well-known libraries like stbi and assimp if the demo requires it

Not really a goal, but if files can be diffed to find out the difference between, for instance, using the input assembler and vertex pulling, that is encouraged.

Some code can be shared between demos like window size, backbuffer count, or anything else that is common for all demos.

Non-goals

  • Production ready code. The demos do not aim to be as efficient as possible

Basic demos

Most of these demos build on top of the previous demo. See description. That means that most of these can be diffed with the previous demo to quickly find out exactly how the technique is implemented.

Demo name Screenshot Description
ndc_triangle Most basic triangle in DirectX12. The triangle is defined in ndc-coordinates in the shader so no vertex buffer is required
vertex_triangle_ia
vertex_triangle_pull
Builds on top of ndc_triangle by rendering with a vertex buffer. Uses either the input assembler or vertex pulling. The following demos do not use vertex pulling since multiple vertex buffers hasn't been showcased yet
spinning_triangle Builds on top of vertex_triangle demo by adding a transform constant buffer which updates every frame
spinning_quad Builds on top of spinning_triangle by rendering with a index buffer
spinning_cat Builds on top of spinning_quad by adding uv coordinates in a separate vertex buffer and texturing the quad
perspective_cat Builds on top of spinning_cat by adding a perspective projection
cubed_cat Builds on top of perspective_cat by making the quad a cube
placed_cat Builds on top of cubed_cat by using placed resources instead of committed resources
phong_lighting Builds on top of cubed_cat by adding Phong lighting with an ambient occlusion map. A rock texture is used to more easily see the lighting effects, and because Dall-E didn't generate any ambient occlusion maps for the cats :(
normal_mapping Builds on top of cubed_cat by adding adding multiple things: normal mapping, assimp for asset loading, a counter to dynamically calculate buffer offsets, and Phong lighting. Comes in two variants: world space and tangent space which showcase the difference between lighting calculations in each space
timing Builds on top of normal_mapping_tangent_space by adding GPU timestamp queries. Also adds simple CPU timing for completeness. The time is displayed in the window title
depth_buffering Builds on top of normal_mapping_tangent_space by adding another cube and a depth buffer so the cubes aren't drawn on top of each other
bundles Builds on top of depth_buffering by rendering one object through a bundle. Contrived example but at least shows the basics of bundle usage
multisampling Builds on top of depth_buffering by enabling multisampling
resizing Builds on top of multisampling by making the window resizable

Attribution

Thank you OpenAI DALL-E for the cats
Thank you Brian from FreePBR for the actual textures

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published