Archive for the ‘Blog’ Category

HLSL Development Cookbook – Review

Saturday, September 7th, 2013

I just picked up a copy of the new HLSL Development Cookbook. The book is a great continuation of the very basic shader set up I have implemented in the XNA tutorial engine, but goes into much more complex and deeper shaders taking full advantage of the new possibilities provided by DirectX 11.

The book tends to be pretty source heavy (HLSL source that is) with very little C++ or DirectX code being shown, so it is definitely recommended to at least have a basic grasp of setting up a simple DirectX 11 application works before tackling the content. On the bright side though, all of the HLSL source is explained in great detail including many diagrams to help get across more of the complicated concepts that aren’t necessarily obvious just from reading the code itself. One thing I really got from these descriptions and diagrams was a good explanation of how the half angle optimization for Blinn Specular works. I always knew how to write the code for this technique but never really understood the real reasoning behind why it works until now.

If you found the samples in my lighting tutorials helpful at all, then you will love the first chapter of this book. The same basic layout is used in all of the shaders that I introduced, but right away a more advanced look at using different light types and effects are included. Each “recipe” builds on top of the last one, so going through the whole chapter one sample at a time is a great way to build your knowledge of all the standard lighting types and shaders normally used.

Once you have a firm grasp of the different shading models and techniques for each light type, Chapter 2 will take you into the much more complicated but also more high performance world of Deferred Shading. Using the new Hull and Domain shader functionality provided by DirectX 11, much of the hard work of optimizing the steps of Deferred Shading are easily handled. All of the complexities of basic Hull and Domain shaders are explained while developing the model, and each light type from the first chapter is then implemented in a single flexible shader that can eventually handle multiple lights (up to 4) in a single rendering pass.

After Deferred Shading, the much more advanced and complex techniques of shadow maps, post processing, screen space effects like ambient occlusion and “god rays”, and environmental effects like fog and decals are discussed in depth. There is too much content to go in to in a simple review, so why don’t you go pick up a copy and see for yourself how great the recipes in this title are and how much you can learn from it! I know I’ll be using the techniques in future development.

Book Link:
http://www.packtpub.com/high-level-shader-language-development-cookbook/book

Sample Chapter:
http://www.packtpub.com/sites/default/files/9781849694209_Chapter_02.pdf

Windows 8, Visual Studio 2012, DirectX 11

Thursday, September 27th, 2012

For a short while now I have been working on porting over most (if not all quite yet) of the functionality of the tutorial HMEngine to a DirectX 11 and C++ version of things that I have been calling “Haze”. Recently, quite a few changes have been occurring that greatly affected how I have been going about this and I have once again wiped the project slate clean and started it up again using the new functionality available in Windows 8 and Visual Studio 2012.

One of the major changes I have made to things now that the base engine is in place and working is changing the static ComponentManager class that used to handle all of the Initialization, Loading, Updating, and Rendering of objects. It has now been transformed into a Scene class and a Scene Manager. Using the new setup, I can put together completely independent groups of items, effects, and cameras (one per scene for now) and load and unload any scene at will.

Using the new XAML UI integration in the Windows 8 version of a Direct3D application, I have hooked up the Scene Mananager to a set of buttons and can swap between them with a simple click. Here is a quick screen shot of what I am talking about (albeit with a VERY simple scene):

Scenes

Technical Review: XNA 4.0 Game Development by Example – Visual Basic Edition.

Sunday, January 1st, 2012

Just finished up a detailed technical edit of the new Visual Basic version of a book I reviewed previously. The new Visual Basic version with my edits included is now available from Packt Publishing. Check it out!

XNA 4.0 Game Development by Example: Beginner’s Guide – Visual Basic Edition

Also available from Amazon

#12 Winter Ale

Friday, December 2nd, 2011
Malts Color (Lovibond) Amount (lbs)
6-row 8
Vienna 3 1
Crystal 60 1
Chocolate 350 1
Hops Alpha % Amount (oz)
US Goldings 5.7 2
Willamette 5.7 2
Yeast
Edinburgh Scottish Ale WLP #028 (Pitchable tdquid)

#11 Cream Ale

Friday, December 2nd, 2011
  • Malts
  • Color (Lovibond)
  • Amount (lbs)
  • 6 Row
  • 6
  • Crystal
  • 10
  • 1
  • Flaked Maize
  • 1
  • Hops
  • Alpha %
  • Amount (oz)
  • Mt. Hood
  • 7.8
  • 4
  • Mt. Hood
  • 7.8
  • 2
  • Yeast
  • California Ale WLP #001 (Pitchable Liquid)
  • German Lager WLP #830 (Pitchable Liquid)

#10 Baltic Porter

Friday, December 2nd, 2011
  • Malts
  • Color (Lovibond)
  • Amount (lbs)
  • Pale 2-Row
  • 6
  • German Munich
  • 6.5
  • 4
  • Roasted Barley
  • 500
  • 0.5
  • Chocolate
  • 338-432
  • 1
  • Belgian Special B
  • 114
  • 1
  • Crystal
  • 60
  • 1
  • Hops
  • Alpha %
  • Amount (oz)
  • Saaz
  • 1
  • Saaz
  • 1
  • Yeast
  • Dusseldorf Alt WLP #036

#9 White Session Ale

Friday, December 2nd, 2011
  • Malts
  • Color (Lovibond)
  • Amount (lbs)
  • Bamberg Pilsner
  • 5
  • Crystal
  • 10
  • 1
  • Wheat Malt
  • 1
  • Hops
  • Alpha %
  • Amount (oz)
  • Chinook
  • 13.1
  • 2
  • Willamette
  • 4.5
  • 2
  • Yeast
  • California Ale WLP #001 (Pitchable Liquid)

Git, push all local branches to origin

Wednesday, October 26th, 2011

At work when we do bug fixes we always create a numbered branch matching our ticket number off of our current production code:

git checkout -b [ticket number here] production

This makes for incredibly simple merging and passing bug fixes around. I come across the issue a lot where I will have about 5 bug fix branches created locally and cannot remember which ones I have pushed to my origin (github) and which I haven’t. There is a command to view unpushed commited branches:

git log --branches --not --remotes --simplify-by-decoration --decorate --oneline

This ugly thing pretty much just parses the log for commits not in your remotes and dumps the result with one branch per line. What it doesn’t do is push these branches for me. Instead of trying to remember that all the time I decided today to just chain a few linux commands I do remember to make it a bit easier for myself:

git branch | grep [0-9] | xargs git push origin

This much shorter command just takes all of my number named branches and tries to push them. If they are already up to date, no biggie, git just returns a nice message telling me so. Branches that need updating on my origin get updated.

This little command only works when my HEAD is not currently on one of my numbered branches, otherwise the little “*” causes way more things than I want to push to my origin. There are, I’m sure, many ways to make this command better, but this simple form with its few prerequisites (not being on one of the branches being pushed) works out great for me.

Anyone else have some tricks for keeping your origin up to date?

Ireland Trip 2011

Monday, September 26th, 2011

2011 October 7 – 2011 October 17

I will try to get photos on the map as well as we are travelling. If I’m having too much fun to add photos you’ll just have to wait until we get back to see them!

View Ireland 2011 in a larger map

Pictures

Bozeman to SLC

Dublin

Dublin to Kinsale

Kinsale and Cork

Ring of Kerry

Dingle

Dingle to Ennis

Ennis (Cliffs of Moher)

More Tessellated Terrain

Thursday, August 25th, 2011

Just a quick note about some small changes I made to the terrain object in Haze. Originally its initialization code just created a single quad made of two triangles with an index buffer in the form {0, 1, 2, 2, 3, 0}. Since then I have updated the constructor to take in an initial size value (int) that sets the number of quads (width and height) in the x and z direction to create. The initialize method now just generates the starting geometry in a loop and sends quad indexes in instead of triangles {0, 1, 2, 3}

The major effect this has on things is that now there can be a single vertex for every single texel passed in as a height map. Since the max tessellation level is 64, we only have to make an 8×8 initial grid to get a full 512×512 tessellated terrain. This opens up other doors as well for things like levels of detail using different tessellation in different quads based on camera distance or view angle. Next up is to get some texture mapping going and see how much I can make things look like real terrain.

I might start with standard splatting techniques, but I’d really like to have the video card generate some of the splat “stencils” based on heights on the whole map (snowy parts at the highest points, less snow on steep slopes, etc.) We’ll see what happens.

Do NOT follow this link or you will be banned from the site!