Showing posts with label fog. Show all posts
Showing posts with label fog. Show all posts

Monday, August 5, 2013

Alpha-Blending Demo



Last time, we covered some of the theory that underlies blending and distance fog.  This time, we’ll go over the implementation of our demo that uses these effects, the BlendDemo.  This will be based off of our previous demo, the Textured Hills Demo, with an added box mesh and a wire fence texture applied to demonstrate pixel clipping using an alpha map.  We’ll need to update our Basic.fx shader code to add support for blending and clipping, as well as the fog effect, and we’ll need to define some new render states to define our blending operations.  You can find the full code for this example at https://github.com/ericrrichards/dx11.git under the BlendDemo project.

blendDemo2

Friday, August 2, 2013

Blending Theory



This time around, we are going to dig into Chapter 9 of Frank Luna’s Introduction to 3D Game Programming with Direct3D 11.0.  We will be implementing the BlendDemo in the next couple of posts.  We will base this demo off our previous example, the Textured Hills Demo.  We will be adding transparency to our water mesh, a fog effect, and a box with a wire texture, with transparency implemented using pixel shader clipping.  We’ll need to update our shader effect, Basic.fx, to support these additional effects, along with its C# wrapper class.  We’ll also look at additional DirectX blend and rasterizer states, and build up a static class to manage our these for us, in the same fashion we used for our InputLayouts and Effects.  The full code for this example can be found on GitHub at https://github.com/ericrrichards/dx11.git, under the BlendDemo project.  Before we can get to the demo code, we need to cover some of the basics first, however.

blendDemo