What’s next inline?

Well, after resolving the issue of the PointLight, it highlighted the fact that there is no real way of adding a new PointLight.  So, I’m going to start work on a LightManager class that will make this a lot easier.  As soon as I’ve done this, I’ll create a post explaining what has been implemented with a step-by-step guide so you can implement it yourselves.

Advertisements

Some interesting findings

Whilst I was so eager to get the Sky dome rendering working, I hadn’t realised but I had broken the PointLight implementation. I had changed the RenderTarget settings so that the new Moon functionality would work, but this is where it all went wrong. For now, I’ve commented out the DrawGlow and DrawMoon methods and reinstated the correct RenderTarget settings:

Correct settings:

colorRT = new RenderTarget2D(GraphicsDevice, backBufferWidth, backBufferHeight, false, SurfaceFormat.Color, DepthFormat.Depth24);
normalRT = new RenderTarget2D(GraphicsDevice, backBufferWidth, backBufferHeight, false, SurfaceFormat.Color, DepthFormat.None);
depthRT = new RenderTarget2D(GraphicsDevice, backBufferWidth, backBufferHeight, false, SurfaceFormat.Single, DepthFormat.None);
depthTexture = new RenderTarget2D(GraphicsDevice, backBufferWidth, backBufferHeight, false, SurfaceFormat.Single, DepthFormat.Depth24);
lightRT = new RenderTarget2D(GraphicsDevice, backBufferWidth, backBufferHeight, false, SurfaceFormat.Color, DepthFormat.None);
sceneRT = new RenderTarget2D(GraphicsDevice, backBufferWidth, backBufferHeight, false, SurfaceFormat.Color, DepthFormat.Depth24);

That's fixed the Sky brightness

Sky rendering

It has been a very long time since I’ve managed to get some time to work on Project Vanquish. And, as a result, I’ve managed to add in atmospheric scattering based on the example over at XNA Community. There are a few problems with it at the moment, for example, the sky is very dark and the clouds don’t appear, but I’ll be resolving those after I’ve fixed an issue with, what looks like, Z-Fighting. Anyway, here’s a screen grab of the latest developments.

Hmmm... need some form of AntiAliasing

Found out the darkness is caused by not correctly setting the Exposure.

By Neil_Knight Posted in XNA

Well, now I feel silly

The problem was not with the transparency but with the texture that I was rendering. I was using the Color RenderTarget instead of the Color Map texture. D’oh!! Also, further investigation showed that if I lowered the Lights intensity, this would make the models transparent again. So, I shuffled the draw order around and it’s resolved.

High Light intensity

Low Light intensity

By Neil_Knight Posted in XNA

Adding new hemispheric light

It’s been a short while since I’ve posted, so I thought I’d let you know what I’ve been working on. Whilst I’ve managed to finish of the SSAO implementation, I have been trying to implement a new light. So far, it’s going well, but I have a problem with the models appearing transparent.

So, I’m looking into this at that moment and will post news as it happens.

SSAO is now back…

and easier to use!

The small debug output windows are the SSAO before and after the blur process. I’ve made this a lot simpler to use as well. So, in your Game class, you can turn on SSAO with the following code:

SSAORenderer.Enabled = true;

There are two more properties that are now available in the SSAORenderer class. There are:

SSAORenderer.DistanceScale
SSAORenderer.SampleRadius

Set these values to get your desired look, and that’s it. The SSAORenderer is disabled by default, so you’ll have to enable it if you want to use it. Sourcecode available at Codeplex, changeset 15588.

SSAO Re-implementation

Just a quick post to say that I have started work on re-implementing the SSAO Renderer. I have made some tweaks to it so that you can now enable/disable from your Game class using a static Enabled property. This means that you have full-control over the renderer. I’ll also be adding two new properties that will allow you to change the SampleRadius and DistanceScale variables. This will allow the renderer to be more flexible and you can find the right look for your game.

I’m hoping to get this all sorted out this week, and I’ll make the source code available over at the Codeplex page.

New BoundingBox Renderer

I had a bit of spare time before I start to re-implement the SSAO, so I went on the hunt for some good articles about Bounding Boxes. I finally found a good article by Tim Jones which explained everything and had a great code example. I read through the article and wondered how I’d get away from creating a DrawableGameComponent for each model so I have modified the BoundingBoxComponent code in order to remove this.

With a slight shuffle of the code, it is now instantiated in the Actor class and the SceneManager class now has a new property, ShowBoundingBoxes. Set this to true and you’ll see them 🙂

No Bounding Boxes

Bounding Boxes

Big clean up

So, I decided to have a big tidy up with regards the project. This was sparked by the problems with the Shadow Rendering. In order to get the Shadows rendering correctly, I had to strip the project back to its bare-minimum. I then had issues with Source Control so I needed to resolve that as well. This was a good time to get everything sorted out in one go. The latest changeset (15378) has the stripped down version of the engine and also corrected the Source Control.  I have also released this code as a full release.

Shadow Renderer fixed!

It has taken a lot longer than I originally thought, but I have finally got the Shadow Renderer working.

PCF 2x2

Sorry for the long delay with this. The latest version of the source code can be found over at the Codeplex page.

PCF set to 5x5 with no directional light