mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-20 09:15:01 +01:00
Merge branch 'master' into feat/renderers-cleanup
This commit is contained in:
@@ -814,8 +814,16 @@ void scene_walk::Render(scene::shape_node const &Shape, bool const Ignorerange)
|
||||
break;
|
||||
}
|
||||
// render
|
||||
|
||||
auto const decal{data.decal && (m_renderpass.draw_mode != rendermode::shadows)};
|
||||
if (decal)
|
||||
{
|
||||
walk_decal(true);
|
||||
}
|
||||
walk_draw(data.geometry);
|
||||
if (decal)
|
||||
{
|
||||
walk_decal(false);
|
||||
}
|
||||
// debug data
|
||||
++m_renderpass.draw_stats.shapes;
|
||||
++m_renderpass.draw_stats.drawcalls;
|
||||
|
||||
@@ -265,6 +265,9 @@ class scene_walk
|
||||
// the runs written to the instance buffer of the frame, each as the modelview of its origin times its transforms
|
||||
virtual void walk_timbers_expand(std::vector<glm::mat4> const &Origins, std::vector<gl::timber_range> const &Ranges) {}
|
||||
virtual void walk_cull_face(bool const Enabled) = 0;
|
||||
// a decal (shapenode_data::decal) drawn pulled towards the camera in the depth buffer, over the surface it lies on; on top of the
|
||||
// bias the pass draws everything with. not in the shadows, which it casts none of
|
||||
virtual void walk_decal(bool const Enabled) {}
|
||||
// the glare of a lamp: drawn without the depth test, added to what is there; drawn only where the point of the light was
|
||||
// seen (walk_light_query() of the last frame, when the backend has it)
|
||||
virtual void walk_glare(bool const Enabled) = 0;
|
||||
|
||||
@@ -11,11 +11,13 @@ http://mozilla.org/MPL/2.0/.
|
||||
#include "rendering/common/shadersource.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cerrno>
|
||||
#include <cstring>
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
#include <mutex>
|
||||
#include <sstream>
|
||||
#include <system_error>
|
||||
|
||||
#include "utilities/Logs.h"
|
||||
|
||||
@@ -48,7 +50,13 @@ std::string read_file(std::string const &Path)
|
||||
{
|
||||
bool found{false};
|
||||
auto text{read_text(Path, found)};
|
||||
if ((false == found) || text.empty())
|
||||
if (false == found)
|
||||
{
|
||||
// with the reason the system gives: a file which is there but can't be opened (too many files open) looks
|
||||
// the same as a missing one otherwise
|
||||
throw shader_exception("cannot open shader: " + Path + " (" + std::generic_category().message(errno) + ")");
|
||||
}
|
||||
if (text.empty())
|
||||
{
|
||||
throw shader_exception("cannot read shader: " + Path);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user