Bloom326984

I am getting color banding issues when viewing my project on my Xbox 360. The textures look perfect when the app is ran on windows, using the same XNA source just in a different project. But when I display the textures on an Xbox 360, I get serious color banding. These issues are most pronounced when my Xbox is set to output at 720p or higher resolutions, but the color banding is still there even if the Xbox is set to 480p. The following code is what I am using to setup my 'prefered' values for my graphics device. If you got any idea what could be causing this, I would appreciate the input.

graphics.IsFullScreen = true;

graphics.PreferredBackBufferFormat = graphics.GraphicsDevice.DisplayMode.Format;

graphics.PreferredBackBufferHeight = graphics.GraphicsDevice.DisplayMode.Height;

graphics.PreferredBackBufferWidth = graphics.GraphicsDevice.DisplayMode.Width;

graphics.ApplyChanges();

Thanks in advance



Re: XNA Framework Color Banding

Bloom

Maybe nobody knows a solution, but has anbody else experienced this I am still having this issue. I should also note that the textures are not compressed, and this isn't a texture resolution problem. I notice the same effect with textures that are both hi-res and low-res.

Thanks again





Re: XNA Framework Color Banding

Jon Watte

Is it possible that you chose a different processor for your textures when you created the Xbox project Depending on which processor you use, different compression (or lack thereof) will be selected.






Re: XNA Framework Color Banding

parlance

If the problem isn't with the color depth in the texture format, the problem could be the color depth in the back buffer format. Try specifically selecting a 32-bit color format backbuffer by adding this line before your graphics device is initialized (Game.Initialize) and see if the problem persists.

graphics.PreferredBackBufferFormat = SurfaceFormat.Rgb32;





Re: XNA Framework Color Banding

Bloom

First, thanks for the replys on this issue.

I double checked to make sure, but yes both the projects are using the same texture importer/processor and there is no compression being used on the textures.

I tried setting the PreferredBackBufferFormat to what you said, but RGB32 isn't supported apparently. I get a run-time error saying it isn't a valid value =/ I tried BGR32, which ran without a run-time error, but this didn't make any difference. I tried most all of the other SurfaceFormat values also. They either crashed with similar run-time errors or just didn't make any visual difference. The only one that seemed to make a difference was 'BGRA1010102'. However, the results where not desireable, as would probably be expected.

If you have any additional suggestions or info, I would appreciate it. Thanks again





Re: XNA Framework Color Banding

Shawn Hargreaves - MSFT

What kind of display is your Xbox connected to I wonder if the quantising could actually be happening in the video output stage, or inside the display device for some reason





Re: XNA Framework Color Banding

Bloom

My XBox is hooked up to a Samsung DLP (Model# HLR4667W). It's a pretty common hdtv so I would be shocked that other owners havn't said anything, if it were an issue with the set. Also, I should note that this issue occurs when my XBox is set to display non-hd resolutions on this same tv and on a non-hd tv that I have.

Thanks again





Re: XNA Framework Color Banding

Shawn Hargreaves - MSFT

I think you're going to have to post code for a repro case that demonstrates this problem - it doesn't seem like anyone is going to be able to diagnose the problem just by guessing.





Re: XNA Framework Color Banding

Bloom

No problem Shawn. Here is the code, hope it helps. Let me know if there is anything else I could provide to better figure this out. Thanks again

namespace GfxTest

{

public class Game1 : Microsoft.Xna.Framework.Game

{

GraphicsDeviceManager graphics;

ContentManager content;

private Model mMapGeo = null;

private Texture2D mColorMap = null;

private Vector3 mCamTar = new Vector3(0.0f, 0.0f, 0.0f);

private Vector3 mCamViewDir = new Vector3(-520.0f, -457.0f, 470.0f);

private Vector3 mCamPos = new Vector3(0.0f, 50.0f, 100.0f);

private Matrix mProjMtx;

private Matrix mViewMtx;

private Vector3 mLightDir = Vector3.Normalize(new Vector3(-0.8f, 0.0f, 1.0f));

private Color mDiffuse = Color.White;

private Color mAmbient = new Color(25, 25, 25, 255);

public Game1()

{

graphics = new GraphicsDeviceManager(this);

content = new ContentManager(Services);

}

protected override void Initialize()

{

graphics.IsFullScreen = true;

graphics.PreferredBackBufferFormat = graphics.GraphicsDevice.DisplayMode.Format;

graphics.PreferredBackBufferHeight = graphics.GraphicsDevice.DisplayMode.Height;

graphics.PreferredBackBufferWidth = graphics.GraphicsDevice.DisplayMode.Width;

graphics.ApplyChanges();

base.Initialize();

}

protected override void LoadGraphicsContent(bool loadAllContent)

{

if (loadAllContent)

{

}

this.mMapGeo = this.content.Load<Model>("Content\\MapMeshes\\geo_1_1~0");

this.mColorMap = this.content.Load<Texture2D>("Content\\MapTextures\\colorMap_1_1~0");

this.mCamTar = this.mMapGeo.Meshes[0].BoundingSphere.Center;

this.mCamPos = Vector3.Add(this.mCamTar, this.mCamViewDir);

this.mProjMtx = Matrix.CreatePerspectiveFieldOfView(MathHelper.ToRadians(45.0f),

this.graphics.GraphicsDevice.Viewport.Width / this.graphics.GraphicsDevice.Viewport.Height, 1.0f, float.MaxValue);

this.mViewMtx = Matrix.CreateLookAt(this.mCamPos, this.mCamTar, new Vector3(0.0f, 0.0f, 1.0f));}

protected override void Draw(GameTime gameTime)

{

graphics.GraphicsDevice.Clear(Color.CornflowerBlue);

this.graphics.GraphicsDevice.RenderState.CullMode = CullMode.CullClockwiseFace;

foreach (ModelMesh mesh in this.mMapGeo.Meshes)

{

foreach (BasicEffect effect in mesh.Effects)

{

effect.World = Matrix.Identity;

effect.Projection = this.mProjMtx;

effect.View = this.mViewMtx;

effect.TextureEnabled = true;

effect.Texture = this.mColorMap;

effect.DirectionalLight0.DiffuseColor = this.mDiffuse.ToVector3();

effect.DirectionalLight0.Direction = this.mLightDir;

effect.DirectionalLight0.Enabled = true;

effect.LightingEnabled = true;

}

mesh.Draw();

}

base.Draw(gameTime);

}

}

}





Re: XNA Framework Color Banding

manders

Hi,

Maybe try Shawn's Xbox screen capture utility: http://blogs.msdn.com/shawnhar/archive/2007/01/08/capturing-screenshots-from-xbox-xna-games.aspx

...and see if a screenshot from your 360 still looks bad when displayed on your PC monitor.

I believe HDTV's have a different gamma than monitors, so depending on what color ranges your art uses, you might see more banding on one platform than another. But if the image still looks bad on your PC monitor, it seems the graphics pipeline would be the source of the issue, rather than the video output stage.

-Mike





Re: XNA Framework Color Banding

Jon Watte

graphics.PreferredBackBufferFormat = graphics.GraphicsDevice.DisplayMode.Format;


Try setting this to Color instead, and see if it improves. Another format you can try is R10G10B10A2, although that's been reported to be broken.






Re: XNA Framework Color Banding

Bloom

Bingo!

I did exactly what you suggested and the screen shot, when viewed on the PC, looked perfect. So, it must be the gamma issue that you speak of. I'll have to read around a bit to see how people deal with gamma correction like this, but at least now I know the source of my problem. Thanks a bunch to everyone who helped.