• Create Account

### #Actualcodymanix

Posted 19 January 2013 - 05:31 PM

Hi Iam having trouble getting transparent texture to work correctly. I append what the problem is.

As you can see, the transparency works good for the bottom faces. But the faces in the background are somehow obstructed by the transparent texture although it should shine through. This effect seem always to happen with all faces in this direction, doesnt seem to happen with faces pointing in the other direction. What could this strange effect be?

Iam using the following (and the BasicShader) to draw things:

CullMode=Off;
AspectRatio = (float)Engine.Instance.Graphics.Viewport.Width / (float)Engine.Instance.Graphics.Viewport.Height;
NearPlane = 0.1f;
FarPlane = 250.0f; Graphics.Clear(ClearOptions.Target | ClearOptions.DepthBuffer, Color.LightBlue, 1.0f, 0);
Graphics.BlendState = BlendState.AlphaBlend;
Graphics.DrawPrimitives(PrimitiveType.TriangleStrip, cubeSide * 4, 2);

EDIT3: I found that it only happens if I look at a face that is behind, right or top from the cube I am looking at.
It doesn't happen for front, bottom or left faces. Could this have to do something with my normals, since Iam using different geometry for each cube side (6 different Meshes)? Without AlphaBlend everything is rendering fine. I now tried VertexPositionTexure (without normals), still the same problem.

### #5codymanix

Posted 19 January 2013 - 05:20 PM

Hi Iam having trouble getting transparent texture to work correctly. I append what the problem is.

As you can see, the transparency works good for the bottom faces. But the faces in the background are somehow obstructed by the transparent texture although it should shine through. This effect seem always to happen with all faces in this direction, doesnt seem to happen with faces pointing in the other direction. What could this strange effect be?

Iam using the following (and a basic light shader) to draw things:

FieldOfView = MathHelper.ToRadians(45);
AspectRatio = (float)Engine.Instance.Graphics.Viewport.Width / (float)Engine.Instance.Graphics.Viewport.Height;
NearPlane = 0.1f;
FarPlane = 250.0f;
Graphics.Clear(ClearOptions.Target | ClearOptions.DepthBuffer, Color.LightBlue, 1.0f, 0);
Graphics.BlendState = BlendState.AlphaBlend;
Graphics.DrawPrimitives(PrimitiveType.TriangleStrip, cubeSide * 4, 2);

EDIT: I now tried the same with BasicEffect, but the problem is still there.

EDIT2: I found of that it only happens if I look at a face that is behind, right or top on the cube I am looking at.
It doesn't happen for front,bottom or left faces. If have Culling=Off, But could this have to do something with my normals, since Iam using different geometry for each cube side (6 different Meshes)? But without Alphablend everything is rendering fine.

### #4codymanix

Posted 19 January 2013 - 05:05 PM

Hi Iam having trouble getting transparent texture to work correctly. I append what the problem is.

As you can see, the transparency works good for the bottom faces. But the faces in the background are somehow obstructed by the transparent texture although it should shine through. This effect seem always to happen with all faces in this direction, doesnt seem to happen with faces pointing in the other direction. What could this strange effect be?

Iam using the following (and a basic light shader) to draw things:

FieldOfView = MathHelper.ToRadians(45);
AspectRatio = (float)Engine.Instance.Graphics.Viewport.Width / (float)Engine.Instance.Graphics.Viewport.Height;
NearPlane = 0.1f;
FarPlane = 250.0f;
Graphics.Clear(ClearOptions.Target | ClearOptions.DepthBuffer, Color.LightBlue, 1.0f, 0);
Graphics.BlendState = BlendState.AlphaBlend;
Graphics.DrawPrimitives(PrimitiveType.TriangleStrip, cubeSide * 4, 2);

EDIT: I now tried the same with BasicEffect, but the problem is still there.

### #3codymanix

Posted 19 January 2013 - 05:04 PM

Hi Iam having trouble getting transparent texture to work correctly. I append what the problem is.

As you can see, the transparency works good for the bottom faces. But the faces in the background are somehow obstructed by the transparent texture although it should shine through. This effect seem always to happen with all faces in this direction, doesnt seem to happen with faces pointing in the other direction. What could this strange effect be?

Iam using the following (and a basic light shader) to draw things:

FieldOfView = MathHelper.ToRadians(45);AspectRatio = (float)Engine.Instance.Graphics.Viewport.Width / (float)Engine.Instance.Graphics.Viewport.Height;NearPlane = 0.1f;FarPlane = 250.0f; Graphics.Clear(ClearOptions.Target | ClearOptions.DepthBuffer, Color.LightBlue, 1.0f, 0);Graphics.BlendState = BlendState.AlphaBlend;Graphics.DrawPrimitives(PrimitiveType.TriangleStrip, cubeSide * 4, 2);

EDIT: I now tried the same with BasicEffect, but the problem is still there.

### #2codymanix

Posted 19 January 2013 - 05:04 PM

Hi Iam having trouble getting transparent texture to work correctly. I append what the problem is.

As you can see, the transparency works good for the bottom faces. But the faces in the background are somehow obstructed by the transparent texture although it should shine through. This effect seem always to happen with all faces in this direction, doesnt seem to happen with faces pointing in the other direction. What could this strange effect be?

Iam using the following (and a basic light shader) to draw things:

FieldOfView = MathHelper.ToRadians(45);AspectRatio = (float)Engine.Instance.Graphics.Viewport.Width / (float)Engine.Instance.Graphics.Viewport.Height;NearPlane = 0.1f;FarPlane = 250.0f; Graphics.Clear(ClearOptions.Target | ClearOptions.DepthBuffer, Color.LightBlue, 1.0f, 0);Graphics.BlendState = BlendState.AlphaBlend;Graphics.DrawPrimitives(PrimitiveType.TriangleStrip, cubeSide * 4, 2);

EDIT: I now tried the same with BasicEffect, but the problem is still there.

### #1codymanix

Posted 19 January 2013 - 04:55 PM

Hi Iam having trouble getting transparent texture to work correctly. I append what the problem is.

As you can see, the transparency works good for the bottom faces. But the faces in the background are somehow obstructed by the transparent texture although it should shine through. This effect seem always to happen with all faces in this direction, doesnt seem to happen with faces pointing in the other direction. What could this strange effect be?

Iam using the following (and a basic light shader) to draw things:

FieldOfView = MathHelper.ToRadians(45);
AspectRatio = (float)Engine.Instance.Graphics.Viewport.Width / (float)Engine.Instance.Graphics.Viewport.Height;
NearPlane = 0.1f;
FarPlane = 250.0f;

Graphics.Clear(ClearOptions.Target | ClearOptions.DepthBuffer, Color.LightBlue, 1.0f, 0);
Graphics.BlendState = BlendState.AlphaBlend;
Graphics.DrawPrimitives(PrimitiveType.TriangleStrip, cubeSide * 4, 2);

PARTNERS