fix issue with non-outlined renders not showing. depth is now a problem.

main
Brett 2024-07-15 17:51:38 -04:00
parent 1470d8469d
commit 672e6b8b60
4 changed files with 11 additions and 11 deletions

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.25) cmake_minimum_required(VERSION 3.25)
set(BLT_GRAPHICS_VERSION 0.13.22) set(BLT_GRAPHICS_VERSION 0.13.23)
set(BLT_GRAPHICS_TEST_VERSION 0.0.1) set(BLT_GRAPHICS_TEST_VERSION 0.0.1)
project(BLT_WITH_GRAPHICS VERSION ${BLT_GRAPHICS_VERSION}) project(BLT_WITH_GRAPHICS VERSION ${BLT_GRAPHICS_VERSION})

View File

@ -207,7 +207,9 @@ namespace blt::gfx
void post_reset(); void post_reset();
void draw_points(bool outlined, bool clear, const f32 denominator); void draw_points(bool outlined, bool clear, const f32 denominator);
void draw_lines(bool outlined, bool clear, const f32 denominator); void draw_lines(bool outlined, bool clear, const f32 denominator);
void draw_rectangles(bool outlined, bool clear, const f32 denominator); void draw_rectangles(bool outlined, bool clear, const f32 denominator);
void draw_objects(); void draw_objects();
@ -224,6 +226,10 @@ namespace blt::gfx
engine = pp_engine_t::make_multi_pp(std::make_unique<pp_render_target_t>()); engine = pp_engine_t::make_multi_pp(std::make_unique<pp_render_target_t>());
} }
explicit batch_renderer_2d(resource_manager& resources, matrix_state_manager& state, std::unique_ptr<pp_engine_t> ppEngine):
engine(std::move(ppEngine)), resources(resources), state(state)
{}
void create(); void create();
void drawRectangleInternal(std::string_view texture, const rectangle2d_t& rectangle, f32 z_index = 0); void drawRectangleInternal(std::string_view texture, const rectangle2d_t& rectangle, f32 z_index = 0);

@ -1 +1 @@
Subproject commit 46691d172ec65915b6a1e14dd9ae2c0a49dd15c4 Subproject commit 0e4dcfa55299eebd4659181b3622d24566f2f764

View File

@ -252,10 +252,8 @@ namespace blt::gfx
mat4x4 model; mat4x4 model;
model.translate(point.pos.x(), point.pos.y(), 0.0f); model.translate(point.pos.x(), point.pos.y(), 0.0f);
if (outlined) if (outlined && render_info.outline)
{ {
if (!render_info.outline)
continue;
model.scale(point.scale * render_info.outline_thickness, point.scale * render_info.outline_thickness, 1.0); model.scale(point.scale * render_info.outline_thickness, point.scale * render_info.outline_thickness, 1.0);
point_shader->setVec4("color", render_info.outline_color); point_shader->setVec4("color", render_info.outline_color);
point_shader->setVec4("use_texture", blt::vec4{0,0,0,0}); point_shader->setVec4("use_texture", blt::vec4{0,0,0,0});
@ -295,9 +293,7 @@ namespace blt::gfx
auto& [z_index, line] = object; auto& [z_index, line] = object;
float thickness = line.thickness; float thickness = line.thickness;
if (outlined){ if (outlined && render_info.outline){
if (!render_info.outline)
continue;
square_shader->setVec4("color", render_info.outline_color); square_shader->setVec4("color", render_info.outline_color);
square_shader->setVec4("use_texture", {0,0,0,0}); square_shader->setVec4("use_texture", {0,0,0,0});
thickness *= render_info.outline_thickness; thickness *= render_info.outline_thickness;
@ -359,9 +355,7 @@ namespace blt::gfx
auto& [z_index, rect] = object; auto& [z_index, rect] = object;
mat4x4 model; mat4x4 model;
if (outlined) { if (outlined && render_info.outline) {
if (!render_info.outline)
continue;
auto nsx = rect.size.x() * render_info.outline_thickness; auto nsx = rect.size.x() * render_info.outline_thickness;
auto nsy = rect.size.y() * render_info.outline_thickness; auto nsy = rect.size.y() * render_info.outline_thickness;
auto ns = blt::vec2(nsx, nsy); auto ns = blt::vec2(nsx, nsy);