Dustin Horne

Developing for fun...

HDC (Heartland Developer's Conference) 2011

I just wanted to post a quick update.  I'm on a bit of a hiatus from my XNA Terrain tutorial series for a few days as I'm attending the Heartland Developer's Conference in Omaha, NE.  One more day remains and so far the conference has been outstanding.  I had the pleasure of having lunch with Scott Hanselman today as well as attending his keynote and off-the-cuff presentations.  There are some exciting things coming out of the Microsoft stack soon and I'm sure I'll be blogging about them as I dive into them.

If you've never been to HDC I would highly recommend it.  The atmosphere is fantastic, the networking opportunities are phenomenal and the presentations are both informative and entertaining.  If you've never had a chance to see Hanselman speak I would highly recommend that as well.  He has a real knack for providing great information in a humorous and entertaining manner.  Here's a picture I had taken with Scott outside of the conference center:

 

Scott Hanselman and I at HDC 2011

XNA Terrain with LOD - Part 4: Drawing the Base Terrain

UPDATE:  If you've been following this terrain series you have probably seen some bugs and a few things that I've overlooked.  I spent the last few days following my own tutorial, updating the series text, and fixing and refactoring the code.  If you don't want to start the tutorial over just to find the few changes I've made, you can download the complete solution for parts 1 through 4 here: Terrain Solution Parts 1 through 4

In the first three parts of this tutorial we examined creating the basic data structures to hold our terrain data and structuring our QuadTree.  In this part of the tutorial I'm going to show you how to activate different depths of the terrain and draw it based on which vertices are active.  We won't get into dynamic LOD until the next section, but when we do you'll have a good idea of how we're going to output our indices and draw our specific triangles.  If you haven't already read the first three sections of this tutorial, please visit the table of contents page and check them out. More...

XNA Terrain with LOD - Part 3: Structuring the QuadTree

In Part 2 of the terrain series we looked at how to build the basic data storage containers that we'll be using to hold our vertex related data.  In this segment we're going to examine the QuadTree we'll be using to manage our terrain.  The QuadTree aids us in efficiently determining where we are in the terrain.  We'll also be using it to determine which individual vertices to display and which groups of vertices will be active. More...

XNA Terrain with LOD - Part 2: Creating the Data Objects

In this second part of the terrain series, we're going to build some of the data structures we'll be using for our terrain.  If you haven't already done so, please read Part 1 of the terrain series.

The most imporant piece of our terrain project is the terrain data and more specifically the vertex data.  Calculating all of the vertex data can be fairly CPU and time intensive and this is not something we want to do every frame.  For this reason, we're going to setup some simple data objects to store our vertex data.  Remember from part 1 of the series I said we're working with VertexPositionNormalTexture.  This allows us to easily send vertex data to the BasicEffect class and draw a simple texture with little effort.  You may decide you want to use a different vertex type and draw the data differently.  This is entirely up to you, but I would recommend sticking with VertexPositionNormalTexture for the duration of this series. More...

XNA Terrain with LOD - Part 1 : Introduction

Overview

Today I'm going to switch gears and write something a little more fun.  This is the first article in a series dedicated to developing a QuadTree based terrain for XNA 4.  Terrain generation is a hot topic amongst XNA developers and a question that arises often.

There are several different approaches to developing terrain.  The simplest method is the “brute force” approach where all terrain data is rendered every frame.  With the power of today’s hardware, this is definitely a viable solution for games with simple, low geometry terrains that target the PC, but it’s an approach that doesn’t scale well when terrain becomes more complex.

Another approach to terrain is to implement a Level of Detail (LOD) algorithm that sets out to reduce the complexity of the terrain as it gets further away from the user.  This step alone can increase efficiency and produce phenomenal gains in performance while raising the complexity and detail of the terrain.  There are several different approaches to LOD, and even more ways to improve performance beyond simply subdividing the terrain.

This series focuses on implementing something very similar to a ROAM algorithm.  Aside from simply subdividing the terrain, it also implements further improvements by performing view frustrum culling.  View frustrum culling put most simply is the process of culling away, or removing geometry that is not visible to the user. More...

Dynamic Custom Error Pages in ASP.NET MVC 2

Recently, I had to implement a dynamic custom 404 error page in an ASP.NET MVC2 website.  My first instinct was to turn CustomErrors mode on and setup a 404 Error, but this failed to return my custom error page in a shared hosting environment and instead displayed the default IIS 404 page.  I'll walk you through fixing this in just a minute, but for now I want to show you how to create the custom 404 page. More...

Asymmetric Encryption and Signing with RSA in Silverlight

While Silverlight is a powerful tool for rich client applications, it lacks the ability to perform asymmetric encryption out of the box.  In this article, I'm going to share a cryptography class library I've been working on and show you how to use it to perform standards compliant RSA Encryption in Silverlight that is cross compatible with .NET's built in RSACryptoServiceProvider, allowing you to encrypt from Silverlight using my library and decrypt on your website using the RSACryptoServiceProvider.  For brevity, only examples using my class library will be shown except for a few examples that show equivelant functionality from the RSACryptoServiceProvider (RSACSP).

Update 11/24/2010: The Scrypt library has been updated.  Key generation is now performed Asynchronously to avoid blocking the UI thread and freezing the browser.  I've updated the applicable source samples in this article to reflect the changes.

More...

UI Updates With Databinding and INotifyPropertyChanged

Today I'm going to show you how easy it is to leverage the power of property binding in Silverlight.  I'm going to provide a very simplistic example that, while not very useful in itself, I hope will spark your imagination and show you how easy it is.  In my example I'm going to show you how to capture the position of the mouse over a canvas and keep the live updated mouse position in a separate class.  In addition, I'll show you how to update your UI directly (moving a box with the mouse and using labels to show the current mouse position) without directly wiring a single event to those controls in your page codebehind!

Before the MVVM pattern folks start foaming at the mouth over this article, I'd like to point out that this is meant to be a very simple demonstration and is not meant to be an MVVM application.  However, I will introduce you to a few concepts along the way that you will leverage in the MVVM design pattern.  I'm going to briefly introduce you to the DataContext object and I'll be storing the mouse data in a separate class but I will not create a complete Model-View-ViewModel separation for this example.  I will, however be encouraging a separation of UI and logic that will serve as a good starting place when you decide to dive into the world of MVVM.  Now, on with the show...

 More...