Latest Entries »

GameDev StackExchange Site

For those of you who are familiar with Stack Overflow (.com) and it’s sister site StackExchange, there is a game development site currently in private beta. It’ll be open for public beta in 2 days and we need as many people as possible to join and partake in the community. Consider checking it out:

http://area51.stackexchange.com/proposals/2825/game-development

Edit: The site is now in public beta! http://gamedev.stackexchange.com

XNA 4.0 Breaking Changes – Effect

The Effect API has been modified in XNA 4.0. Effect parameters work as usual, however the following:

effect.Begin();

foreach(EffectPass pass in effect.CurrentTechnique.Passes) {
	pass.Begin();

	// Draw

	pass.End();
}

effect.End();

Is now

foreach (EffectPass pass in effect.CurrentTechnique.Passes)
{
    pass.Apply();

    // Draw
}

Or, if you are using a single pass technique

effect.CurrentTechnique.Passes[0].Apply();

// Draw

XNA 4.0 Blend States

Opaque (Default):

Additive:

Alpha:

Non Premultiplied:

Site Attacked

The site was attacked as some of you noticed. I managed to eradicate the code that was injected into just about every file on the server and removed the hundreds of files uploaded onto the server by said attack.

Unfortunately my theme was destroyed in the process. I’m currently working to repair it from backups but for now I’ve switched to this shiny theme. I kind of like it actually–we’ll see. The site could use a redesign.

One of the things that has changed with XNA Version 4.0 is RenderTargets. The constructor parameters have changed, as has their interaction with the DepthStencilBuffer class.

While previously we had to specify a DepthStencilBuffer instance of the same width, height, and multisampling settings as a render target we were trying to set to the graphics device, the render target now takes care of this for us.

In addition, the functions to set render targets to the graphics device have changed. We no longer specify indices for our render targets. Instead, we either set one render target using the “GraphicsDevice.SetRenderTarget(RenderTarget2D renderTarget)” function, or set multiple render targets using the “GraphicsDevice.SetRenderTargets(params RenderTargetBinding[] renderTargets)” function.

For example, the following draw code from XNA 3.1:

graphicsDevice.SetRenderTarget(0, renderTarg);

DepthStencilBuffer oldDepth = graphicsDevice.DepthStencilBuffer;
graphicsDevice.DepthStencilBuffer = depthBuffer;

// Draw

graphicsDevice.SetRenderTarget(0, null);
graphicsDevice..DepthStencilBuffer = oldDepth;

Would become in XNA 4.0:

graphicsDevice.SetRenderTarget(shadowTarg);

foreach (CModel model in Models)
    model.Draw(shadowCamera);

graphicsDevice.SetRenderTarget(null);

Other changes have been made to the RenderTarget as well–the “GetTexture()” function is gone now, for example (as the entire thing now inherits from Texture2D). I’ll update as I figure more out.

CubeMapper

While in the process of writing the book, I’ve created a tool that will automatically create a .dds cube map from six input files (each face of the cube).

It’s available at http://ig.codeplex.com/releases/view/46536

Enjoy!

Powered by WordPress | Theme: Motion by 85ideas.