Author Archives: olhovsky

Exponential shadow map filtering (in log space).

It turns out that I was performing a linear filter on my shadow map depths, but I should have been doing the shadow map prefiltering in log space. Whoops. Actually, there seems to be a lot of confusion about how … Continue reading


Exponential shadow mapping drawbacks.

I created a model that could demonstrate some harder cases for the various shadow mapping filters that I experimented with the other day. This model (which is two copies of a sort of church-like building), casts shadows on itself (where … Continue reading


Cascading shadow mapping and ESM.

I implemented shadow cascades today. Below is a screenshot of the current shadows, using two cascades. Note the artifacts that I’ve highlighted with green arrows. About 1/3 of the depth range is represented by the first cascade (and 2/3 in … Continue reading


Shadow map filtering experimentation.

Edit: I demonstrated some harder cases for the important filters here. I also used a brighter light so that it’s easier to see the shadow edges   Over the past two weeks I’ve been working on various parts of my … Continue reading


HDRBlendable Xbox 360 performance and dual paraboloid point light shadow optimization.

While working on dual paraboloid point light shadows, at first I used two R32 textures for the shadow maps, one map per hemisphere of the point light. Here’s a quick glimpse at what point light shadows are currently looking like … Continue reading


Deferred lighting.

My forward rendered lighting setup almost suited my purposes, but it turned out that the limitations of the XBOX CPU limited me to far too few terrain chunks, and therefore far too few lights. To this end, I’ve been exploring … Continue reading


“Game3″ post-mortem. (Or how I learned to stop worrying and love development outside of the DBP competition.)

This game was called “Game3″ just because this is the 3rd XNA project I’ve opened on this computer, and that was the default name. I’ve put in somewhere between 500-900 hours into this project (schoolwork being mixed in there makes … Continue reading


My own physics or BEPU?

Norbo (the creator of the BEPU physics engine) dropped by the day before last to let me know that I should expect much higher performance than what I was seeing in my BEPU tests. He suggested that I should be … Continue reading

1 Comment

Physics engine integrated, and sphere-terrain collision done.

Terrain collision was a little harder than I thought it would be. This is owing to the fact that the terrain is a concave body, and many contacts are possible with a single sphere and the terrain. Contrast this with … Continue reading


Summer classes start today.

Well, I have class again, which means I have to reduce the work on this project slightly. Hopefully there won’t be any serious tests until a week or two after the competition deadline.

Posted in Uncategorized | 4 Comments

The physics engine (made from scratch!).

In the last few days I wrote a physics engine from scratch using a technique that no other 3D XNA physics engine (that I know of) uses yet: Speculative contact continuous collision detection. I’ve been looking for a good physics … Continue reading


Terrain changes (and the first video capture).

If you’re like me then you’re tired of seeing the terrain, and you want to see the gameplay. Sure, I want to work on nothing but the gameplay at this point. However, the gameplay takes place at night — and … Continue reading


VS2010 corruption woes and a new GPU.

I bought a new GPU today, and after installing it and restarting, visual studio decided to stop working, producing random errors (e.g. “Unable to start program. Cannot find file specified.” when trying to run the project). After wasting an hour … Continue reading

1 Comment

Status update: Point light stress testing.

Yesterday I added over 1000 (one thousand) moving point lights to the terrain. On the PC this was fine. The scene partitioning used by my forward rendering setup uses a lot of CPU time though, so on the XBOX this … Continue reading


Last post before my next exam (in 4 days).

I have my last exam on the 28th, so I won’t post again until after that is done. In the meantime, have a look at the current state of the game below. PS3 shaders can use a maximum of 512 … Continue reading


Texturing steep terrain slopes.

In a GPU Gems 3 article (skip to section 1.5) they solve the issue of texturing terrain at various slopes by using triplanar texturing. The following image illustrates the problem. I’ve done something similar to solve the problem of stretching on very … Continue reading


Slope based terrain texturing.

Today I worked on getting the terrain texturing to match the new procedurally created level from yesterday. In the image above, a dead grass texture is applied to flat portions of terrain, a green texture on the edges at intermediate … Continue reading


Procedural level creation.

I spent today creating a method for procedurally building the terrain in a game level. The framework for procedural placement of various objects (e.g. trees) is started, but I won’t have time to finish implementing that today. As usual I … Continue reading


First enemy: Doll.

I haven’t posted in a while since I’ve been working on physics code. Progress on things that I can actually post screenshots of has been slow. Before next month I’m going to buy a video card that is fast enough … Continue reading


Optimizing terrain culling.

The code that culls terrain chunks was using a 3D bounding box vs camera frustum test for each terrain chunk, which was incredibly slow. On the XBOX 360 this was taking about 4ms for ~200 intersection tests. At 60FPS you … Continue reading


Trees and tree collision.

I made this tree last night, and started working on extending the collision testing system (which currently only tests for collisions against the terrain). I do UV mapping in 3D Coat. You might notice that I didn’t map one of … Continue reading


Experimenting with a darker lighting setup.

I bought a new monitor yesterday, and although I have three LCD screens that I’ve been using for testing, none of them had very good contrast or color. I calibrated this new LED/LCD monitor and started doing some testing in … Continue reading


Dozens of point lights with forward rendering.

I’ve spent the last few days working on spatial partitioning, object pooling code (and fighting with stackoverflow about it), and other necessary performance optimization code. Most AAA titles seem to support something like 5-6 dynamic lights. I’m sure you’ve noticed … Continue reading


Avoiding garbage collections on the compact CLR.

I haven’t posted in a few days because I’ve been working on almost purely programming related tasks, which don’t lead to pretty screenshots. I’ve been improving the efficiency of the spatial partitioning scheme, and terrain draw args sorting. Today though, … Continue reading

Posted in Coding, DBP2011, XNA | Tagged , , , | 3 Comments

Erratic development speed.

I have a priority queue of game features that need to be completed. E.g.: [-3] Pure black rolling fog to simplify fog shader. [4] Dual paraboid point light shadow map implementation [2] Terrain diffuse lighting based lightning effect. [6] Moon … Continue reading


Sky effect and bloom filter.

I’ve added a bloom filter, which every big title seems to use these days. The bloom filter takes the brightest parts of the image, blurs them, and mixes the result back into the scene. This makes lights glow, softens bright … Continue reading


The importance of assertion statements.

When implementing a complex system, where there are many variables/objects, I can’t stress enough how important it is to have some sort of assertion tests in your code. In C# we can write assertion tests that are only run when … Continue reading

Posted in Coding, DBP2011, XNA | Tagged | 6 Comments

Terrain point light progress.

I’ve built a GGR (Geographical Grid Registration) component for the terrain, which will permit better draw call arrangement and in particular, better effect state management when drawing many point lights — which is a goal. Since the terrain is arranged … Continue reading


Terrain lighting progress.

In order to light the terrain, normals must be generated from which we can measure the angle of a light ray’s incidence with the terrain geometry, so that we can decide how bright a terrain triangle will be. For the … Continue reading


Fixing up cracks in the terrain.

Since the terrain is made up of varying level of detail chunks, when two chunks of different detail levels meet, their edges do not match up perfectly. This results in gaps/cracks in the terrain. To fix this, I’ve created a … Continue reading


The CPU vs GPU XBOX360 speed disparity.

Today and yesterday I mostly worked on class work. Actually I mostly worked on a single assignment :/ However, I did find time to write the terrain chunk drawing loop, which implicitly builds a quadtree and tests at each recursive … Continue reading

1 Comment

Terrain started, and quadtree vs. block based LOD.

I put pathfinding on hold because when implementing a hexagonal coordinate based path finding algorithm, I realized that there would be various difficulties with dealing with constructs imposed on the world such as the terrain grid or quadtree and any … Continue reading


Path finding: What would Kirk do?

In my previous post about the challenge of path finding on the XBOX with XNA, my A* algorithm benchmarks were abysmally slow. Recall from my previous post that pathfinding was done in 3D, including diagonal movement, allowing 26 possible directions … Continue reading


Every day can’t be a game development day.

My reality is that I can’t make every single day a game development day. Today I had to catch up with class work, and run various personal errands. To maintain momentum though, I did find time to do a little … Continue reading


A 64GB SSD Is Not Large Enough For Indie Game Developer’s Toolset

  I bought a Kingston 64GB SSD last week and the enormous performance improvement compared to my spinning HDD has been nothing short of breathtaking. When I purchased it I thought that 64GB would be plenty of room for just … Continue reading


The Challenge of Efficient Path Finding on the XBOX360

Yesterday, a friend taking an AI course showed me his midterm exam, and I noticed that there was an A* related question. This got me thinking about A* and after 6 hours of (trying to) make an SMT solver for … Continue reading


GUI Elements: Bars and Notifications.

Today I made a notification manager and some notifiers. This allows the game to intelligently queue notifications like notifying the user that she has a new ability or that an event is about to occur. There are now notifications at … Continue reading


HUD GUI: Health/Energy orbs.

I created the 2D overlay, the 3D holder tentacles, and I diverged somewhat from the draft designs seen in my previous post. The orb contents swirls and is composed of multiple layers — I’ve made numerous optimizations to make this … Continue reading

1 Comment

HUD GUI: Health & Energy Indicators

I actually have several possible indicators drawn out including bars, circular/spherical orbs and diegetic displays. The diegetic display would be a glowing bar drawn on the character in the game world, visible only if a 3rd person camera is always … Continue reading


Menu system started.

I’ve done a menu in XNA before, so working from that code and the gamestate management sample as examples of how to proceed, I built the following menu. Getting all of the animations and transitions right was a surprisingly long … Continue reading


DBP 2011 Entry Started

For the past two years I’ve been writing down specific ideas about a game that I’ve wanted to play for years, but no one has ever made. I have documented everything from user interface design to various algorithms to network … Continue reading


Fields vs. properties performance on the Xbox 360.

I took Sam Allen’s performance test and ran a similar test (below) on the Xbox 360 with XNA. static string _backing; // Backing store for property static string Property // Getter and setter { get { return _backing; } set … Continue reading

Posted in Coding, XNA | Tagged , , | 5 Comments

Occurences of one string in another.

The string “ABC” occurs in “ABBC” twice, if you remove any characters you wish from “ABBC”. The following algorithm finds such occurences in O(n) time given any two strings. One assumption worth noting for the O(n) time bound is that … Continue reading

Posted in Coding, Misc | Tagged , | 1 Comment

Extract Longest Non-Decreasing Sequence From Any Sequence

I wrote some python code that extracts the longest non-decreasing subsequence from any given sequence. This runs in O(n log n) time, and uses O(n) memory. ”’ An item in the final sequence, used to form a linked list. ”’ … Continue reading

Posted in Coding, Misc | Tagged , | 10 Comments

Foreach through non-primitive types creates garbage.

Time and again I have seen code like this used in XNA tutorials. effectDrawBlock.Begin(); foreach (EffectPass pass in effectDrawBlock.CurrentTechnique.Passes) { pass.Begin(); gd.DrawIndexedPrimitives(PrimitiveType.TriangleStrip, 0, 0, 35, 0, 70); pass.End(); } effectDrawBlock.End(); When you use a foreach over an array of ints … Continue reading

Posted in Coding, XNA | Tagged , | 4 Comments

ToString Garbage Creation in C#

I profiled my XNA game project today using the XNA Framework Remote Perf Monitor and discovered that I was generating about 8000 more manage objects per second than I was expecting to. It turns out that this code was generating … Continue reading

Posted in Coding, XNA | Tagged , , | 4 Comments

Convert greyscale images to Alpha8 format with a Custom Content Processor in XNA 3.1.

I noticed that at least two terrain engine examples in XNA are reading heightmap images into 4 channel textures instead of single channel textures. To create a custom content processor that will permit you to convert any Texture2D compatible input … Continue reading

Posted in Coding, XNA | Tagged , , , | 2 Comments

2D CDF 9/7 Wavelet Transform in Python

As promised, here is an implementation of the Cohen-Daubechies-Feauveau 9 tap / 7 tap wavelet transform on a 2D signal in Python. This is the same transform used in the JPEG2000 codec. ”’ 2D CDF 9/7 Wavelet Forward and Inverse Transform (lifting implementation) … Continue reading

Posted in Coding | Tagged , , , , , , | 17 Comments