3

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: enter image description here

but image for texture is:

enter image description here

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...

sahap
  • 390
  • 3
  • 19
  • Post your code. [mcve] –  Jul 24 '16 at 05:09
  • 1
    MickyD, thank you. Done. – sahap Jul 24 '16 at 06:10
  • I investigated new behavior. – sahap Jul 25 '16 at 14:56
  • I'm confused, you say it works and does not work on Windows 7. Which is it? –  Jul 25 '16 at 15:22
  • I have host Windows 7 machine, where example is working fine. And I have virtual machine with another Windows 7 machine, where example not working. The second one machine, VM system have no installed Monogame Desktop components, just run executables copied from first machine. On the host machine Installed Monogame Desktop. – sahap Jul 25 '16 at 15:33
  • Can you before drawing clear screen like: `game.GraphicsDevice.Clear(Color.Transparent);` ? – Nejc Galof Jul 29 '16 at 13:49
  • No changes... After I removing Effect.EnableDefaultLighting(); Effect.LightingEnabled = true; VertexColorEnabled = true; and it works... – sahap Jul 30 '16 at 15:31
  • It seems what it only not working on Intel HD Graphics, but on Radeon and NVidia works fine... Tested successfully on: ATI Radeon HD 5700 Series, NVIDIA GeForce GT 430 and NVIDIA GeForce GT 240. Lights not working on: Intel HD Graphics 4000 and maybe other Integrated graphics – sahap Aug 02 '16 at 08:17
  • Also tested on NVIDIA 540M with success result and on Intel HD Graphics 4400 with no lighting. – sahap Aug 03 '16 at 13:26

1 Answers1

0

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.

A Coday
  • 33
  • 5