Quantcast
Channel: Community | MonoGame - Latest topics
Viewing all articles
Browse latest Browse all 6821

Issue with Texture2D.FromStream

$
0
0

@StainlessTobii wrote:

Hi Guys,

I use a system for showing damage on meshes which uses the alpha channel.

So you create a skin for the mesh like this.

Then you cut holes in it using the alpha channel.

In the shader I override the alpha channel with a value based on damage levels.

However when I display the mesh in Monogame I get this

You can see that the parts with alpha < 1 are darker.

I have studied my shader in detail and I am confident that is not the issue, in fact I cannot see any possible way it could be. Even bad shader compilation wouldn't achieve what I am seeing.

So I am pretty sure it is caused by pre-multiplying the alpha channel.

The horrendous bug that Microsoft created in XNA 4.0 just so XNA could run on low powered mobile devices.

My guess is that if the texture is imported from a stream, it automatically does the multiply.

In the content importer (which I cannot use in this case) you have an option to turn off the pre-multiply.

I think we need another method on Texture2D, FromStream(GraphicsDevice,Stream,Options);

Don't know what I am going to do as a work around for the moment though....

Posts: 3

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 6821

Trending Articles