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

Loaded Texture2D .xnb file gives different result from XNA

$
0
0

@monogany wrote:

I have a custom processor that uses the 2D Normal Map sample from XNA to create normal map bitmaps for 2d shadows from greyscale heightmaps
.
In the migrated MonoGame project, the output normal bitmaps are completely different from the ones output by XNA.

Via logging to output (launching the pipeline tool with debugger didn't work), I have narrowed down the problem to these lines:

TextureContent depthMapTexture = context.BuildAndLoadAsset<TextureContent,
                                              TextureContent>(depthMapTextureReference, null);

/* compute normals here, put it back in the bitmap, read from the bitmap & output the result, everything seems ok
(...)
*/

PixelBitmapContent<Vector4> bitmap;
bitmap = (PixelBitmapContent<Vector4>)depthMapTexture.Faces[0][0];

// convert the bitmap, this seems to change the values in the bitmap completely:
depthMapTexture.ConvertBitmapType(typeof(PixelBitmapContent<NormalizedByte4>));

Posts: 18

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 6821

Trending Articles