Giter VIP home page Giter VIP logo

dx12-game-programming's Introduction

What is this sorcery?

A collection of DirectX 12 C# samples from Frank D. Luna's book Introduction to 3D Game Programming with Direct3D 12.0. All the samples have been ported to .NET using SharpDX.

Building

The samples will compile with Visual Studio 2022+ and run on Windows 10+ with DirectX 12 capable graphics hardware.

Samples

The number prefix for sample name indicates its corresponding chapter from the book.

Note that there might be issues: some which are inherited from the original C++ samples and some which have been introduced during the porting process. All known issues are listed in the issues section.

Sets up a window using WinForms. Initializes Direct3D 12 and builds a base app with game loop upon which next samples are built.

Manually defines vertices to render a colored box. Scene can be rotated and zoomed using mouse buttons.

Generates geometric primitives. Renders multiple objects using a single vertex and index buffer.

Constructs a heightmap based terrain and water geometry using a dynamic vertex buffer.

Adds ambient, diffuse and specular lighting to the land and waves scene.

Introduces parsing and loading a skull mesh from a custom model format. Applies lighting to the shapes scene.

Textures a box with uv-coordinates added to its vertices.

Animates a water texture in the land and waves scene.

Textures objects in the shapes scene.

Renders the land and waves scene with transparent water and a wire fence textures. Introduces the blending formula and creates a fog effect.

Constructs a mirror using the stencil buffer and projects a shadow for the skull mesh.

Renders trees as billboards. Introduces texture arrays and alpha to coverage in relation to MSAA.

Sums a bunch of vectors on GPU instead of CPU for high parallelism using a compute shader. Outputs a results.txt file instead of rendering to screen.

Uses a compute shader to update the land and waves scene waves simulation on GPU instead of CPU.

Applies a Gaussian blur post-processing effect using a compute shader to the land and waves scene.

Applies a Sobel filter post-processing effect using a compute shader to the land and waves scene to render outlines for geometry.

Tessellates a quad using 4 control points.

Tessellates a quad using 16 control points cubic Bézier surface.

Creates a controllable first person camera. Introduces dynamic indexing of texture arrays. Camera is moved using WASD keys and rotated using a mouse.

Renders multiple copies of the skull mesh using a hardware instanced draw call. Culls skulls outside of camera frustum.

Enables picking individual triangles of a car mesh. Right mouse button picks a triangle which is highlighted using a yellow color.

Renders a sky texture cube. Uses the cube to render reflections on scene objects.

Renders scene objects into a texture cube every frame. Uses the rendered cube for reflections.

Makes use of normal maps in addition to diffuse maps to generate more realistic lighting of surfaces.

Projects shadows into a shadow map which is blended with the diffuse target.

Computes real-time screen space ambient occlusion and applies it as a post-processing effect.

Animates skull rotation using quaternions.

Plays a walking animation for an animated skinned soldier mesh loaded from .m3d format.

dx12-game-programming's People

Contributors

discosultan avatar hyrtwol avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dx12-game-programming's Issues

SDK component that is missing or mismatched.

SharpDX.SharpDXException: 'HRESULT: [0x887A002D], Module: [SharpDX.DXGI], ApiCode: [DXGI_ERROR_SDK_COMPONENT_MISSING/SdkComponentMissing], Message: The application requested an operation that depends on an SDK component that is missing or mismatched.

Fallback to DirectX WARP component fails

When a suitable graphics hardware is missing, the samples try to fallback to a CPU emulation component called WARP. Currently it fails with the following error:

Adapter warpAdapter = _factory.CreateSoftwareAdapter(_appInst);

SharpDX.SharpDXException: 'HRESULT: [0x80004005], Module: [General], ApiCode: [E_FAIL/Unspecified error], Message: Unspecified error.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.