Skip to content
Snippets Groups Projects
Verified Commit a3ccbd6d authored by Tobias Frisch's avatar Tobias Frisch
Browse files

[#82] Fixed wrong path and added logging to texture loading

parent 91f485e8
No related branches found
No related tags found
1 merge request!70Resolve "Voxel cone tracing"
Pipeline #26066 passed
......@@ -63,8 +63,7 @@ enum IndexType getIndexType(const enum fx::gltf::Accessor::ComponentType &t)
case fx::gltf::Accessor::ComponentType::UnsignedInt:
return IndexType::UINT32;
default:
std::cerr << "ERROR: Index type not supported: " <<
static_cast<uint16_t>(t) << std::endl;
vkcv_log(LogLevel::ERROR, "Index type not supported: %u", static_cast<uint16_t>(t));
return IndexType::UNDEFINED;
}
}
......@@ -368,7 +367,18 @@ int loadScene(const std::string &path, Scene &scene){
TextureData loadTexture(const std::filesystem::path& path) {
TextureData texture;
uint8_t* data = stbi_load(path.string().c_str(), &texture.width, &texture.height, &texture.componentCount, 4);
if (!data) {
vkcv_log(LogLevel::ERROR, "Texture could not be loaded from '%s'", path.c_str());
texture.width = 0;
texture.height = 0;
texture.componentCount = 0;
return texture;
}
texture.data.resize(texture.width * texture.height * 4);
memcpy(texture.data.data(), data, texture.data.size());
return texture;
......
......@@ -96,7 +96,7 @@ BloomAndFlares::BloomAndFlares(
compProg, { p_Core->getDescriptorSet(m_CompositeDescSet).layout });
// radial LUT
const auto texture = vkcv::asset::loadTexture("resources/radialLUT.png");
const auto texture = vkcv::asset::loadTexture("resources/RadialLUT.png");
m_radialLut.fill((void*)texture.data.data(), texture.data.size());
}
......
......@@ -2,8 +2,6 @@
#include <vkcv/Core.hpp>
#include <vkcv/camera/Camera.hpp>
#define GLM_DEPTH_ZERO_TO_ONE
#define GLM_FORCE_LEFT_HANDED
#include <glm/glm.hpp>
#include <glm/gtx/transform.hpp>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment