Commit b69c076b authored by Johannes Braun's avatar Johannes Braun
Browse files

Finally finished fixing texture issues.

parent aa2f5167
......@@ -27,8 +27,8 @@ void resetImportance(int id);
void main()
{
ivec2 target_size = u_render_target.imageSize();
//if (!(int(gl_GlobalInvocationID.x) < target_size.x && int(gl_GlobalInvocationID.y) < target_size.y))
// return;
if (!(int(gl_GlobalInvocationID.x) < target_size.x && int(gl_GlobalInvocationID.y) < target_size.y))
return;
int id = target_size.x * int(gl_GlobalInvocationID.y) + int(gl_GlobalInvocationID.x);
generate(id, target_size);
......
......@@ -35,7 +35,6 @@ namespace glare::core
for (auto && shader : shaders)
gl::detachShader(m_handle, shader->id());
Log_Debug << "Program was linked successfully.";
collectUniforms();
collectSubroutines(shaders);
......
......@@ -61,10 +61,6 @@ namespace glare::core
Log_Error << log;
throw std::runtime_error(log);
}
else
{
Log_Debug << "Shader compiled successfully.";
}
}
unsigned Shader::id() const
......
This diff is collapsed.
......@@ -57,7 +57,6 @@ namespace glare::core
parameters.wrap_t = gl::TextureWrapMode::eClampToEdge;
for (int face = 0; face < faces.size(); face++)
{
Log_Debug << "Face No " << face;
Image<uint8_t> image(faces[face]);
image.flip();
m_texture->set(gl::ImageTarget(static_cast<int>(gl::ImageTarget::eCubeMapPosX) + face), image, true);
......
......@@ -85,7 +85,7 @@ namespace glare::core
file_root_node->attach(scene.second);
}
Log_Info << "Decoding Collada File took " << clock.time() << "ms";
Log_Info << "Loading Collada File took " << clock.time() << "ms";
return file_root_node;
}
......@@ -747,7 +747,6 @@ namespace glare::core
void Collada::decodeImagesNode(const std::string &directory, const pugi::xml_node& img_node) const
{
Log_Debug << "Decoding images...";
for (const auto &image_sub : img_node.children())
{
const std::string id = image_sub.attribute("id").as_string();
......@@ -762,8 +761,6 @@ namespace glare::core
void Collada::decodeCameraNode(const pugi::xml_node& cam_node) const
{
Log_Debug << "Decoding cameras...";
for (const auto &camera_sub : cam_node.children())
{
auto camera = std::make_shared<core::Camera>();
......
......@@ -97,8 +97,8 @@ namespace glare::raytrace
m_trace_buffer.reserve<Trace>(width * height, gl::BufferUsage::eDynamicCopy);
m_render_target->set(core::Texture::SubTarget::e2D, core::Image<float>({ static_cast<int>(1440), static_cast<int>(900) }, 4));
m_color_storage->set(core::Texture::SubTarget::e2D, core::Image<float>({ static_cast<int>(1440), static_cast<int>(900) }, 4));
m_render_target = std::make_unique<core::Texture>(core::Image<float>({ static_cast<int>(width), static_cast<int>(height) }, 4));
m_color_storage = std::make_unique<core::Texture>(core::Image<float>({ static_cast<int>(width), static_cast<int>(height) }, 4));
m_render_shader->uniform("u_render_target", m_render_target->imageAddress(gl::Access::eReadWrite));
m_render_shader->uniform("u_color_store", m_color_storage->imageAddress(gl::Access::eReadWrite));
......@@ -110,7 +110,7 @@ namespace glare::raytrace
if (m_samples_current == 0)
{
m_collector->collect();
gl::clearTextureImage(m_color_storage->id(), 0, gl::TextureFormat::eRGBA, gl::Type::eFloat, glm::value_ptr(glm::vec4(0)));
m_color_storage->clear(0);
}
for (unsigned sample = 0; sample < m_samples_per_frame; sample++) {
......
......@@ -44,7 +44,6 @@ namespace files
std::ifstream file(path);
if (file.good())
{
Log_Debug << "File " << path << " loaded successfully.";
return std::string(std::istreambuf_iterator<char>(file), std::istreambuf_iterator<char>());
}
......
......@@ -3,6 +3,9 @@
#include <iostream>
#include <functional>
#include <iomanip>
#include <string>
#include <filesystem>
// --------------------------------------------------------------------------
#define Log(level) if constexpr(logging::enabled<level>()) logging::log<level>(__FILE__, __LINE__)
......@@ -131,10 +134,11 @@ namespace logging
{
std::cout << '\n';
print(level_data<L>::win_color, level_data<L>::ansi_color, [&]() {
std::cout << "[" << level_data<L>::letter << "] in " << file_path::relative(file) << " : " << line;
std::cout << std::left << std::setw(38) << (std::string("[") + level_data<L>::letter + std::string("] in ") + std::experimental::filesystem::path(file).filename().string() + std::string(" : ") + std::to_string(line));
});
return std::cout << " -- ";
return std::cout << "| ";
}
}
#endif //__LOG_H
......@@ -586,13 +586,6 @@ namespace gl
void textureImage(unsigned texture, gl::ImageTarget target, int level, gl::TextureInternalFormat fmt, gl::TextureFormat format, std::initializer_list<int> dimensions, const void* data)
{
/* const static auto formatFromInternal = [](gl::TextureType target, gl::TextureInternalFormat internal_format)
{
gl::TextureFormat format;
gl::getInternalFormatParameter(target, internal_format, gl::TextureInternalFormatParameter::eTextureImageFormat, reinterpret_cast<int*>(&format));
return format == gl::TextureFormat::eNone ? gl::TextureFormat::eRG : format;
};*/
const static auto typeFromInternal = [](gl::TextureType target, gl::TextureInternalFormat internal_format)
{
gl::Type type;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment