Project Description:
Hybrid Scanline-Raytracing Engine and an all new rendering aproach :) VisitorPattern based Scenegraph written in C++. Direct3D 9 or 10 rendering is used for PrimaryRays and CUDA used for BSP-Raytracing (DX11, OpenGL, ComputeShader easily upgradeable). CLR-Wrapper available for support in managed environments. The engine can work inside of a ClrWrapperDll library. You can then simply add this dll to a Windows Forms application, making it simple to extend a present GUI with raytracing. Multiple Viewports in Windows Forms are supported. A WPF (Windows Presentation Foundation) host is also available in the solution. With the help of WPF allowing transparent windows and usage of wpf's "D3DImage" it is possible to see raytraced objects appear directly on your desktop =)

Compile and Run:
Use the Visual Studio 2008 solution (TheWhiteAmbit_VS9.sln)
To compile the solution, install the latest Windows-SDK, DirectX-SDK and Cuda-Toolkit (links at download section).
Set the following paths to environment variables:
WindowsSDKPath ("C:\Program Files\Microsoft SDKs\Windows\v7.1")
DSHOW_DIR ("C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples\multimedia\directshow")
Compile the DirectShow basefiles if you have not yet done so.

Before running a project, copy the files from the Assets-Folder to the corresponding Project-Folders root,
or in case of the WPFApp-Project, copy the Assets to these subdirectorys:

Don't forget to set the desired project as Startup-Project:
Win32App: A plain old Win32-App with dedicated Window-Loop-Thread (Direct3D9 and 10, CUDA-capable)
WindowFormApp: Embedding the ClrWrapperDll in a Forms-App with simple WindowHandle (Direct3D9 and 10, CUDA-capable)
WPFApp: Embedding the ClrWrapperDll in a WindowsPresentationFoundation-App with D3DImage (Direct3D9 only, CUDA-capable)

New realtime Ambient-Occlusion rendering aproach presented! While a Motion-Shader reprojects movements to previous frames, a Bent-Normal aproximation is raytraced. The generated images are Anti-Aliased and have Motion-Blur as renderig artifacts :)

Raytracing of 1 million triangle models at interactive framerates on current GPUs is possible. About 100mio. shadow-rays per second for low poly models on Fermi GPUs. The raytracer can also do refraction or calculate bent-normals for ambient-occlusion preprocessing. Lots of "branching free" ray->primitive intersections tests can be found or other nice tricks like generating a camera-matrix without z-Far. Latest trick is a Reprojection-Shader to track back pixels in previous frames. The shading can be applied in a scanline process making colored raytracing easy. A kD-Tree raytracer might gain even more speed over the current BSP-Tree raytracer.

You can also find sweet Win32 basics: Java style threadding with a IRunnable interface, or creating object oriented Win32-Windows having the message loop (typically a static C function called "wndProc") mapped to an objects method. This way each window has its own thread, exclusively taking care of the windowmessages. This always keeps the windows responsive in case of resizing or closing, even if other threads are stalled on heavy workload.

Some video de-/encoding capabilitys were added: Cuda, DirectShow and MediaFoundation.

Last edited Feb 6, 2012 at 5:50 PM by meee, version 28