@@ -61,7 +61,7 @@ namespace OpenGL
61
61
m_line_mb.clear ();
62
62
m_tri_mb.clear ();
63
63
}
64
- void DebugRenderer::render (System::SceneSystem& p_scene, const Buffer& p_view_properties, const FBO& p_target_FBO)
64
+ void DebugRenderer::render (System::SceneSystem& p_scene, const Buffer& p_view_properties, const Buffer& p_point_lights_buffer, const FBO& p_target_FBO)
65
65
{
66
66
if (!m_line_mb.empty ())
67
67
{
@@ -99,17 +99,20 @@ namespace OpenGL
99
99
dc.m_polygon_offset_units = opt.m_position_offset_units ;
100
100
dc.set_uniform (" model" , model);
101
101
dc.set_uniform (" colour" , p_collider.m_collided ? glm::vec4 (opt.m_bounding_box_collided_colour , 1 .f ) : glm::vec4 (opt.m_bounding_box_colour , 1 .f ));
102
+ dc.set_UBO (" ViewProperties" , p_view_properties);
102
103
dc.submit (*m_bound_shader, m_AABB_outline_mesh->get_VAO (), p_target_FBO);
103
104
}
104
105
if (opt.m_fill_bounding_box )
105
106
{
106
107
DrawCall dc;
108
+ dc.m_blending_enabled = true ;
107
109
dc.m_cull_face_enabled = false ;
108
110
dc.m_polygon_offset_enabled = true ;
109
111
dc.m_polygon_offset_factor = opt.m_position_offset_factor ;
110
112
dc.m_polygon_offset_units = opt.m_position_offset_units ;
111
113
dc.set_uniform (" model" , model);
112
114
dc.set_uniform (" colour" , p_collider.m_collided ? glm::vec4 (opt.m_bounding_box_collided_colour , 0 .2f ) : glm::vec4 (opt.m_bounding_box_colour , 0 .2f ));
115
+ dc.set_UBO (" ViewProperties" , p_view_properties);
113
116
dc.submit (*m_bound_shader, m_AABB_filled_mesh->get_VAO (), p_target_FBO);
114
117
}
115
118
});
@@ -122,6 +125,8 @@ namespace OpenGL
122
125
{
123
126
DrawCall dc;
124
127
dc.set_uniform (" scale" , opt.m_light_position_scale );
128
+ dc.set_UBO (" ViewProperties" , p_view_properties);
129
+ dc.set_SSBO (" PointLightsBuffer" , p_point_lights_buffer);
125
130
dc.submit_instanced (*m_light_position_shader, m_point_light_mesh->get_VAO (), p_target_FBO, point_light_count);
126
131
}
127
132
}
0 commit comments