Eden

Eden is my current long term project: a graphics engine built from scratch using DirectX and the D3D11 API. I'm a graphics engineer in the game industry, but there's always so much more to learn and explore, so that's what this blog is for! I'll share what I've found, the things I do right, wrong, and everything in between.



Particle Systems for the Professional Environment


Particle systems are a great way to add life and motion to your engine. In this post I cover the complete creation of a particle management system that is capable of great visuals and high performance.
Click here to see the full post.


Area Lighting


Area lighting can add a lot to game scenes, and with a physically based lighting model, they look even better! In this post, I'll be detailing the implementation of sphere, tube, and one-directional rectangular area lights.
Click here to see the full post.



Physically Based Rendering - Changes in Pipeline


Now that we have physically based rendering in place, as discussed in my previous post, we need to make some changes in our material pipeline.
Click here to see the full post.



Screen Space Ambient Occlusion - SSAO


SSAO stands for Screen Space Ambient Occlusion, the screen space technique for rendering a kind of shadowing that occurs when objects in close proximity block ambient lighting near each other. This tutorial covers SSAO implementation.
Click here to see the full post.



Physically Based Rendering


Before moving much further into adding lighting technology in my engine, I wanted to lay the foundation of physically based lighting. There are some great papers on the math behind it, but I've yet to see an implementation example online, so I'm sharing mine! This is my first pass at getting it to look right, and I draw much of my inspiration for the final look from what I've seen UDK and Unity3D do with theirs.
Click here to see the full post.



Uber Shaders and Shader Permutations


A brief look at how Uber Shaders work, and how you can quickly minimize shader explosion in your engine.
Click here to see the full post.



Sample Distribution Shadow Maps


A little while ago, my lead mentioned his friend at another studio was using SDSM for their shadows. I'd never heard of it before, and it seems that most other companies haven't either since it is used in very few games right now. I imagine it will become more popular, because these are the best looking shadows I've ever seen - far exceeding the standard PSSM implementation in pretty much every aspect. Since the code is heavily dependent on your renderer implementation, I haven't included my own code here. However, I've attached a powerpoint that gives a quick overview of how the technique works before you dive into the paper. You'll also find the original code sample there. Admittedly, this technique is a bit tricky to implement, especially compared to other shadowing techniques, but if I can do it I'm sure you can too!
Download the powerpoint



Cascaded Shadow Maps with Soft Shadows


Shadow mapping is one of those things that is difficult to be satisfied with. At this point, I've read dozens of articles, papers, blogs, etc. about different shadow mapping implementations, and it quickly became clear that there's currently no perfect (or even near-perfect) way to do them. It is possible to get something that looks pretty good though, and you can use little tricks to minimize the drawbacks. My hope is that by the end of reading this, you'll be able to implement and understand the complete flow of cascaded soft shadow maps, and the advantages/disadvantages to the techniques I use.
Click here to see the full post.



Engine Structure

Once I got DirectX set up, I built my basic engine structure to load up and manage all my assets and logic. Here is a high-level perspective:


This obviously isn’t the only way to set up your rendering engine, and this structure that I currently have is the result of a bunch of refactoring until I found something that worked for me. It’s also likely to change again, but hopefully it helps you start thinking about the pieces that are going to need to come together.

On the right side, you’ll notice I’ve decided to separate out my graphics pieces. The Graphics Manager manages the Direct3D Manager, as well as all of our graphics assets: meshes, materials, and entities. The Material Manager hangs onto the textures and shaders, because the materials themselves are really just a combination of shaders, textures, and other properties. I’ll have a post dedicated to the material system because it can get a little involved in order to be totally data-driven, which is the end goal so that we can build tools to create them.

You’ll also notice that I’ve completely separated my forward renderer from that graphics structure. That’s because I plan on adding, at the very least, a deferred renderer in the future. Since the assets and Direct3D logic don’t (and shouldn’t) care what kind of renderer you have, it’s ideal to have this piece separated out. Though not shown in the diagram, the renderer keeps a reference to the graphics manager for access to the device to do things like create render textures and make state changes.

The last piece is the scene class, which contains all the lights, cameras, and scene objects that make up the scene. The scene objects are created from combinations of our assets.



Resources and Setting up DirectX

Setting up DirectX can be a bit of a pain if you don’t know where to start. For me, the go-to was this website.

Rastertek does a number of great DirectX 11 tutorials, but I found his set up tutorials particularly useful, as he covers each piece of the setup thoroughly. I won’t go into the particulars of it (or how to set up basic shaders and drawing objects) because he’s already done a fabulous job of that. His other tutorials have some great information, but if you’re like me and are gearing up to create an engine, leave the code where you found it. In order to create a sustainable engine, you need to build a solid architecture, and you’re not going to find it there. Get the high-level overviews and run with them on your own!

Another great resource that I highly recommend is Tomas Akenine-Moller’s Real-Time Rendering, Third Edition.

Contact

  • edenspuzzle@gmail.com
  • 603-377-6737
  • LinkedIn