C# bindings for KTX-Software.
Available as nuget package under Ktx2.NET.
If you are missing a function feel free to create an issue and I'll add it.
KTX2 bindings for C#. With NuGet package
Home Page: https://www.nuget.org/packages/Ktx2.NET
C# bindings for KTX-Software.
Available as nuget package under Ktx2.NET.
If you are missing a function feel free to create an issue and I'll add it.
Hi!
I finally had the time to test out the bindings. Unfortunately, I got into an issue. I want to assign the original byte array texture to a ktx2 one. Here is what I tried to do:
byte[] d3dtxTextureDataArray = textureData.SelectMany(b => b).ToArray();
fixed (byte* ptr = d3dtxTextureDataArray)
{
texture.PData = ptr;
texture.DataSize = (uint)d3dtxTextureDataArray.Length;
}
//...
fixed (Texture* ptr = &texture)
{
Ktx2.WriteToNamedFile(ptr, newKTX2Path);
}
I am almost certain I did something wrong, I get an exception when trying to save to a file (presumingly it doesn't allocate memory correctly): An unhandled exception of type 'System.AccessViolationException' occurred in Ktx2.NET.dll: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'
The file is created on the system, but there is no data inside it. I tried looking up the in the Khronos documentation, but in their samples they use ktxTexture_SetImageFromMemory.
Other than that so far it has been clean. I was also wondering if IsSRGB and ktx2ktx2 can be added as well (I could use it to transform to ktx1 and then transcode to rgba8).
Thanks!
Hi! I am working on a texture converter, which extracts texture data from proprietary game files to DDS. However, some of the formats like ETC1, ETC2, ATC, ASTC, PVRTC etc. have to be stored in a KTX/KTX2 container and I would like to use this wrapper.
However, it doesn't support some functions equivalent to DirectXTexNet's ones which I use
It would be great to have some of these:
WriteToMemory/WriteToFile
LoadFromFile
ComputePitch/Slice
BitsPerPixel
IsPremultipliedAlpha
KTX1 writer and loader would be great as well, but I understand this is primarily for KTX2 and Khronos has decided to deprecate version 1 (which unfortunately supports ATC compressed textures natively).
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.