Closed iMrShadow closed 2 months ago
could be an issue with mip maps, png doesn't support mip maps. I recommend adding this (see screenshot, HResult is already included in the package, in the namespace HexaGen.Runtime)
the solution to the png mip-map issue is this
DirectXTex.SaveToWICFile(mipChain.GetImages()[0], WICFlags.None, DirectXTex.GetWICCodec(WICCodecs.CodecPng), outputPath, null, default);
the solution to the png mip-map issue is this
DirectXTex.SaveToWICFile(mipChain.GetImages()[0], WICFlags.None, DirectXTex.GetWICCodec(WICCodecs.CodecPng), outputPath, null, default);
This worked partially, but the situation is weird again. Here's the breakdown:
Edit: This might be only related when dealing with folders in /Downloads. I will investigate further. However, it wouldn't make sense when loading the files (Issue #1). Edit 2: Using SaveToWICMemory works, and saving the file as bytes works well. Same work-around as #1 but in the opposite direction.
Also png doesn't support all Pixel formats, png only supports RGBA8 UNorm, RGBA16 UNorm, R8 UNorm, R16 UNorm
Do you have by any chance an Anti-Virus, that could cause that? (The source code of the native lib is in the project you need cmake to build it)
I only have Windows Defender and Malwarebytes, nothing too fancy
Also png doesn't support all Pixel formats, png only supports RGBA8 UNorm, RGBA16 UNorm, R8 UNorm, R16 UNorm
Yes, I am aware - that's why I have the uncompress function above. The function applies only to normal maps (which are commonly in BC3 and BC5 formats). Previously we used texconv.exe which automatically did that for us, but I want to get rid of external dependencies
It could be a permission problem. Maybe try running it in admin mode, just for testing.
It didn't work. Does the wrapper inherit the app's permissions, or it's standalone? It could be due to DirectXTex's way of doing things
the wrapper is simply a c layer that forwards calls to the c++ lib, I didn't change anything, (DirectXTex is imported as git sub module from the official repo) see source code, (you have to do a C# -> C -> Cpp layer because C# can only interop with C and COM)
I am closing the issue since there's a workaround for this and it may be related to DirectXTex's permissions, which this wrapper doesn't have control of.
Thanks for the help!
Hello! I am experiencing an interesting crash when working with large textures - in this case 2048x2048. I am using a function to restore the Z axis of normal maps when converting to PNG. It "works" for small images, but it doesn't for large. I am attaching the dds files I tested in various sizes. 4 of them should work (512x512, 1024x1024, 1024x2048, 2018x1024), the last one will crash (tile_roofShingles...dds)
Normal Maps.zip
Here's the code I used.