Code Monkey home page Code Monkey logo

dxrexperiments's Introduction

DXRExperiments

A lightweight prototyping framework for DirectX Raytracing build upon Microsoft DXR Fallback Layer.

Screenshot

Overview

The main purpose of this project is to setup a prototyping environment for learning DirectX Raytracing, and hybrid raytracing rendering in general. The project absorbed a lot of code from Microsoft's early DXR samples and Nvidia's DXR tutorials, and includes a DXR API wrapper designed by borrowing many concepts from the Nvidia Falcor framework.

Features

  • Windows 10 RS5 DXR API compliance
  • Accumulation based progressive raytracing pipeline
  • Supports multiple mesh file formats including OBJ, FBX and Collada
  • Currently uses a basic phong BRDF
  • WIP Realtime raytracing pipeline with denoise filter

Dependencies

I try to minimize dependencies by not introducing a third-party D3D12 renderer / abstraction layer, thus the DXR API wrapper works directly with D3D12 and is rather inefficient in doing anything other than raytracing. I use DirectXTK for texture loading, Assimp for mesh loading, imgui for UI, and a subset of Microsoft MiniEngine for math and user input.

The DXR Fallback Layer submodule points to my fork which only differs from the Microsoft version in configuration.

Compatibility

This project uses Microsoft DXR Fallback Layer for DXR API calls, thus works for non-RTX GPUs via compute emulation path. On RTX GPUs, the fallback layer simply forwards calls to native DXR API, and can achieve the same performance as directly using native API.

The support for non-Nvidia GPUs are limited as per DXR Fallback Layer.

Setup Guide

Enable developer mode for Windows 10. This is only required by the compute based fallback layer.

Clone the Github repo, then initialize the submodules with

$ git submodule update --init

Download Microsoft DXR Fallback Compiler binaries with the link in the following section. Copy all the contents to externals/D3D12RaytracingFallback/Bin/x64.

Open DXRExperiments.sln and build DXRExperiments project.

Requirements

DXRExperiments is maintained to run on the following environment:

  • Windows 10 1809 (18252.1000) or higher.
  • Visual Studio 2017 version 15.8.6 or higher.
  • Windows 10 10.0.17763.0 SDK or higher.
  • DXR Fallback Compiler - DirectXRaytracingBinariesV1.5.zip.
  • Nvidia Maxwell or Turing GPU.

Reference

https://github.com/Microsoft/DirectX-Graphics-Samples/tree/master/Libraries/D3D12RaytracingFallback https://github.com/Microsoft/DirectX-Graphics-Samples/tree/master/Samples/Desktop/D3D12Raytracing https://developer.nvidia.com/rtx/raytracing/dxr/DX12-Raytracing-tutorial-Part-1 https://github.com/NVIDIAGameWorks/Falcor http://intro-to-dxr.cwyman.org/

dxrexperiments's People

Contributors

philcn 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

Watchers

 avatar  avatar  avatar

dxrexperiments's Issues

Build successful but run fail when check enable FallbackLayer

On OnInit():

    m_deviceResources->RegisterDeviceNotify(this);
    m_deviceResources->SetWindow(Win32Application::GetHwnd(), GetWidth(), GetHeight());
    m_deviceResources->InitializeDXGIAdapter();
    mNativeDxrSupported = IsDirectXRaytracingSupported(m_deviceResources->GetAdapter());
    ThrowIfFalse(EnableComputeRaytracingFallback(m_deviceResources->GetAdapter()));

When run to EnableComputeRaytracingFallback() and it return false, the program is throw a error.
Is my fault to config a error fallbacklayer? How to config the correct FallbackLayer?
My graphic card is NVIDIA GTX 1060 6G.

DenoiseCommon.hlsli:51 - Error X3701 vs_2_0 does not support indexing resources

How to get rid of this error?

[numthreads(GROUP_SIZE_X, GROUP_SIZE_Y, 1)]
void main(uint3 dispatchID : SV_DispatchThreadID, uint3 threadID : SV_GroupThreadID, uint3 groupID : SV_GroupID)
{
    float3 color;
    if (gDebugVisualize == 2) {
        color = gInput[dispatchID.xy].rgb; // error
    } else {
        color = filterKernel(gMaxKernelSize, float(gMaxKernelSize), dispatchID.xy, gInput, gDirectLighting, threadID.xy, dispatchID.xy).rgb;
    }

I'm using VS2017 + Windows SDK 10.0.17763.0

How to add a rasterization pass to build a hybrid framework?

          // Insert rasterizeration code here

	// Run denoiser with mock input textures
	if (mBypassRaytracing && mDenoiser->mActive) 
	{
		mDenoiser->dispatch(commandList, DenoiseCompositor::InputComponents{ 0 }, currentFrame, GetWidth(), GetHeight());
		BlitToBackbuffer(mDenoiser->getOutputResource());
	}

Is it right that I have to write a separate Rasterization Pipeline and new Model/Scene class if I want a rasterizeration result for the first hit?

altbase.h missing

Haven't dug through this to figure out what this is and what is referencing it, but getting C1083 errors saying that this file is missing in the fallbacklayer project.

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.