bluenoise-raytracer/raytracer/nvpro_core/fileformats
2024-05-25 11:53:25 +02:00
..
bmp.hpp cleanup and refactoring 2024-05-25 11:53:25 +02:00
cadscenefile.h cleanup and refactoring 2024-05-25 11:53:25 +02:00
cadscenefile.inl cleanup and refactoring 2024-05-25 11:53:25 +02:00
khr_df.h cleanup and refactoring 2024-05-25 11:53:25 +02:00
nv_dds.cpp cleanup and refactoring 2024-05-25 11:53:25 +02:00
nv_dds.h cleanup and refactoring 2024-05-25 11:53:25 +02:00
nv_ktx.h cleanup and refactoring 2024-05-25 11:53:25 +02:00
nv_ktx.inl cleanup and refactoring 2024-05-25 11:53:25 +02:00
README.md cleanup and refactoring 2024-05-25 11:53:25 +02:00
tiny_converter.cpp cleanup and refactoring 2024-05-25 11:53:25 +02:00
tiny_converter.hpp cleanup and refactoring 2024-05-25 11:53:25 +02:00

Table of Contents

khr_df.h

This header defines a structure that can describe the layout of image formats in memory. This means that the data format is transparent to the application, and the expectation is that this should be used when the layout is defined external to the API. Many Khronos APIs deliberately keep the internal layout of images opaque, to allow proprietary layouts and optimizations. This structure is not appropriate for describing opaque layouts.

nv_ktx.h

A mostly self-contained reader and writer for KTX2 files and reader for KTX1 files. Relies on Vulkan (for KTX2), GL (for KTX1), and the Khronos Data Format.

Sample usage for reading files:

KTXImage image;
ErrorWithText maybe_error = image.readFromFile("data/image.ktx2");
if(maybe_error.has_value())
{
// Do something with the error message, maybe_error.value()
}
else
{
// Access subresources using image.subresource(...), and upload them
// to the GPU using your graphics API of choice.
}

Define NVP_SUPPORTS_ZSTD, NVP_SUPPORTS_GZLIB, and NVP_SUPPORTS_BASISU to include the Zstd, Zlib, and Basis Universal headers respectively, and to enable reading these formats. This will also enable writing Zstd and Basis Universal-compressed formats. If you're using this inside the nvpro-samples framework, you can add all three quickly by adding _add_package_KTX() to your dependencies in CMakeLists.txt.

tiny_converter.hpp

Class TinyConverter

This class is used to convert a tinyobj::ObjReader to a tinygltf::Model.