2016-07-23 39 views
3

ich nicht Lösung für dieses Problem finden:monogame Textur ohne Farben

I VertexPositionTexture bin mit Rechteck erstellen mit Textur und DrawUserPrimitives einige Grundelemente aus.

Rechteck ist:

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:

Effect = new BasicEffect(game.GraphicsDevice) { 
    VertexColorEnabled = true, 
    TextureEnabled = true }; 
Effect.EnableDefaultLighting(); 

und Zeichenmethode:

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 in Ordnung, aber Rechteck mit Textur keine Farben hat, nur Alpha-Kanal und Farbverläufe von Schwarz. Es sieht wie folgt aus: enter image description here

aber Bild für Textur ist:

enter image description here

Als ich zu entfernen versucht:

Effect.EnableDefaultLighting(); 
Effect.LightingEnabled = true; 
VertexColorEnabled = true; 

Farben arbeiten ...

Sie möglicherweise verwirrt, aber es funktioniert bereits gut mit Farben auf der Maschine mit Windows 7. Als ich eingecheckt in TFS alle c hanges, und bekomme die neueste Version auf Windows 10 Maschine, ich habe dieses Problem. Ich habe noch keine Windows 7 Maschine. Aber ich überprüfte auf einem anderen Rechner mit Windows 7 ausführbaren Dateien, keinen Erfolg ...

Auf Host-Maschine ohne Probleme:

  • DLL in dem Verzeichnis C: \ Program Files (x86) \ monogame \ v3. 0 \ Assemblies \ DesktopGL Weg sind 3.5.1.1679

  • DLL in das Verzeichnis C: \ Program Files (x86) \ MSBuild \ monogame \ v3.0 \ tools sind 3.5.1.1679

  • DLL in dem Debug \ Pfad sind 3.5.1.1679

geladen Baugruppen (nur aufgeführt, mit Unterschieden):

  • 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

auf einem anderen Windows 10 (alle Versionen von Windows 7+) Maschine mit Problemen (kein Unterschied):

  • DLL in das Verzeichnis C: \ Program Files (x86) \ monogame \ v3 .0 \ Assemblies \ DesktopGL Pfad sind 3.5.1.1679

  • DLL in das Verzeichnis C: \ Program Files (x86) \ MSBuild \ monogame \ v3.0 \ tools sind 3.5.1.1679

  • DLL in dem Debug \ Pfad sind 3.5.1.16 79

geladen Baugruppen (nur aufgeführt, mit Unterschieden):

  • 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

Eröffnet Ausgabe: https://github.com/mono/MonoGame/issues/5029

UPDATE: Es scheint, was es nur nicht funktioniert auf Intel HD Graphics, aber auf Radeon und NVidia funktioniert gut ...

+0

Geben Sie Ihren Code ein. [mcve] – MickyD

+1

MickyD, danke. Erledigt. – sahap

+0

Ich untersuchte neues Verhalten. – sahap

Antwort

0

Nicht zu sagen ist die ultimative Antwort, aber eine sehr wichtige Sache zu prüfen ist, dass Sie die neueste Treiberversion für das Intel Grafiksystem haben.

+0

Hallo, schon installiert. Manuell und per Windows Update – sahap