Reputation: 389
I can't find solution for this problem:
I'm using VertexPositionTexture to create rectangle with texture and DrawUserPrimitives to draw some primitives.
Rectangle is:
tmpPoint.VerticesList[0] = new VertexPositionTexture(new Vector3(-size, size, 0), new Vector2(0, 0));
tmpPoint.VerticesList[1] = new VertexPositionTexture(new Vector3(size, size, 0), new Vector2(1f, 0));
tmpPoint.VerticesList[2] = new VertexPositionTexture(new Vector3(-size, -size, 0), new Vector2(0, 1f));
tmpPoint.VerticesList[3] = new VertexPositionTexture(new Vector3(size, -size, 0), new Vector2(1f, 1f));
Effect setted up:
Effect = new BasicEffect(game.GraphicsDevice) {
VertexColorEnabled = true,
TextureEnabled = true };
Effect.EnableDefaultLighting();
And drawing method:
public void DrawRectangle()
{
originalBlend = game.GraphicsDevice.BlendState;
game.GraphicsDevice.BlendState = BlendState.AlphaBlend;
Effect.World = PointScale * PointRotation * PointTranslation;
Effect.CurrentTechnique.Passes[0].Apply();
game.GraphicsDevice.DrawUserPrimitives<VertexPositionTexture>(PrimitiveType.TriangleStrip, VerticesList, 0, vertexBuffer.VertexCount / 2); 0, 0, 4, 0, 2);
game.GraphicsDevice.BlendState = originalBlend;
}
All fine, but rectangle with texture has no colors, only alpha channel and gradients of black. It looks like this:
but image for texture is:
When I tried to remove:
Effect.EnableDefaultLighting();
Effect.LightingEnabled = true;
VertexColorEnabled = true;
Colors are working...
You may be confused, but it already works fine with colors on machine with Windows 7. When I checked-in in TFS all changes, and get latest version on Windows 10 machine, I have this problem. I haven't Windows 7 machine yet. But I checked on another machine with Windows 7 executables, no success...
On host machine with no problems:
DLL's in the C:\Program Files (x86)\MonoGame\v3.0\Assemblies\DesktopGL path are 3.5.1.1679
DLL's in the C:\Program Files (x86)\MSBuild\MonoGame\v3.0\Tools are 3.5.1.1679
DLL's in the Debug\ path are 3.5.1.1679
loaded assemblies(listed only with differences):
mscorlib.dll 4.6.1076
System.Core.dll 4.6.1055.0
System.dll 4.6.1075.0
System.Drawing.dll 4.6.1068.2
System.Windows.Forms.dll 4.6.1055.0
On another Windows 10(any version of Windows 7+) machine with problems (no difference):
DLL's in the C:\Program Files (x86)\MonoGame\v3.0\Assemblies\DesktopGL path are 3.5.1.1679
DLL's in the C:\Program Files (x86)\MSBuild\MonoGame\v3.0\Tools are 3.5.1.1679
DLL's in the Debug\ path are 3.5.1.1679
loaded assemblies(listed only with differences):
mscorlib.dll 4.6.1080
System.Core.dll 4.6.1038.0
System.dll 4.6.1081.0
System.Drawing.dll 4.6.1078.0
System.Windows.Forms.dll 4.6.1038.0
Opened issue: https://github.com/mono/MonoGame/issues/5029
UPDATE: It seems what it only not working on Intel HD Graphics, but on Radeon and NVidia works fine...
Upvotes: 3
Views: 636
Reputation: 33
Not saying is the ultimate answer, but one very important thing to check is that you have the lastest driver version for the Intel graphics system.
Upvotes: 0