awful drawings

Hi!
After monogame updating my game began to look so:


What happened?
All My images in png format.

Looks kinda nice :slightly_smiling:

What platform are you on? How do you load your texture data?

Maybe same as this:


Was fixed 4 days ago.

Thanks @mgarstenauer !

@naEska - We updated the 3.5 release to 3.5.1 just yesterday and it includes the fix for that. Maybe update again and give that a try.

Ok. I update monogame. Now:

original:

1 Like

This means Red and Blue channels are still swapped. :frowning:

Looks like the issue is not fully fixed

This is RB Whitaker HLSL skybox tutorial, picture is suppose to be a lot more reddish than that, and the dds file is not blueish, even the file processed through with pipeline tool.

Default settings was Color, tried no change, compressed, and Color without color key enabled, still blueish.
(as in the tutorial: premultiplied alpha set is false).
I tried both 3.5.1 and dev MonoGame dll.

Direct link to texture

@KonajuGames - And ideas as to what this could be?

I’ll grab the tutorial tonight and see what is happening.

Could it be the packing issue again ?
Does it have been tested on ALL supported format (including sounds, if relevant) ?

@Tom & @KonajuGames: if any of you need help (more testing for various cases for example) let me know, I’ll be glad to spare you some time.

It was a byte order issue, but not related to the previous issues. There were two issues in my DDS loader:

  1. The test if a byte swap was needed was incorrect for 32-bit pixel formats, and
  2. The byte swap was never actually done.

I’m fixing it now and adding a unit test for the full colour cube map DDS used in that tutorial.

Luckily it’s not required for sounds. The root cause of this issue is that half the industry likes RGB and the other half like BGR. With sounds, I haven’t seen anyone try to use right/left for stereo channel ordering yet. Some texture input formats are RGB exclusively and some other input formats can be either RGB or BGR. We just need to make sure it is BGR by the time it gets to the TextureProcessor.

Fixed in https://github.com/mono/MonoGame/pull/4763

Ok thanks for the explanation. Does this order shouldn’t be present in the header ? How picture manager/editor actually handle that ? There is at least the old, I guess, GQview and The Gimp which could be used if needed.

And thanks for the quick PR ;).

EDIT: get the source Ddsloader only, replace the one I have in my dev snapshot, rebuild but pipeline tool doesn’t work:

System.NullReferenceException: La référence d’objet n’est pas définie à une instance d’un objet.
à Eto.WinForms.Forms.WindowsFileDialog2.<>c.<SetFilters>b__9_0(FileDialogFilter f) à System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext()
à System.String.Join(String separator, IEnumerable1 values) à Eto.WinForms.Forms.WindowsFileDialog2.SetFilters()
à Eto.WinForms.Forms.WindowsFileDialog`2.ShowDialog(Window parent)
à MonoGame.Tools.Pipeline.MainView.AskOpenProject(String& projectFilePath) dans M:\c#\MonoGame\MonoGame\MonoGame-develop\MonoGame\Tools\Pipeline\Eto\MainWindow.cs:ligne 67
à MonoGame.Tools.Pipeline.PipelineController.OpenProject() dans M:\c#\MonoGame\MonoGame\MonoGame-develop\MonoGame\Tools\Pipeline\Common\PipelineController.cs:ligne 221
à MonoGame.Tools.Pipeline.MainView.OnOpenProjectClick(Object sender, EventArgs e) dans M:\c#\MonoGame\MonoGame\MonoGame-develop\MonoGame\Tools\Pipeline\Windows\MainView.cs:ligne 509
à System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
à System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
à System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
à System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
à System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
à System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
à System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
à System.Windows.Forms.Control.WndProc(Message& m)
à System.Windows.Forms.ToolStrip.WndProc(Message& m)
à System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
à System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

do I need something specific ?

With DDS files, the header gives you the masks to get each channel. From this I determine which order the channels are in.

The DdsLoader has nothing to do with the pipeline tool, which is what your callstack shows.

@naEska, are you able to provide me with a sample project that demonstrates your issue? I can’t reproduce it with the assets and code I’ve got here.

For the record, with the today dev snapshot (at least), with all assets rebuilt, I got the correct colors for the texture.

But, some thing happened with assimp, the first time I rebuild everything after a full cleaning, I got

Assimp.AssimpException: Error importing file: FBX-Parser (TOK_DATA, line …, col …) unexpected token, expected T
OK_KEY

(message coming from assimp issue #579 (no comment, closed since a while) for th skybox cube object, and it’s only for the first build, building a second time is ok (??)