Commit 2af99e9f authored by Florian Oetke's avatar Florian Oetke
Browse files

low-level API to render non-entities

parent b0c50f7e
Pipeline #2274 passed with stage
in 4 minutes and 19 seconds
......@@ -216,6 +216,7 @@ namespace mirrage::renderer {
queue.insert(queue.end(), lines.begin(), lines.end());
}
}
auto low_level_draw_queue() -> auto& { return _frame_data.geometry_queue; }
auto profiler() const noexcept -> auto& { return _profiler; }
......
......@@ -179,9 +179,12 @@ namespace mirrage::renderer {
if(!geo.model->rigged())
continue;
auto offset = gsl::narrow<std::uint32_t>(required_size);
auto entity_mb = _ecs.get(geo.entity);
if(entity_mb.is_nothing())
continue;
auto entity = _ecs.get(geo.entity).get_or_throw("Invalid entity in render queue");
auto entity = entity_mb.get_or_throw();
auto offset = gsl::narrow<std::uint32_t>(required_size);
auto upload_required = entity.get<Shared_pose_comp>().process(true, [&](auto& sp) {
auto pose_offset = util::find_maybe(_animation_uniform_offsets, sp.pose_owner);
......
......@@ -141,11 +141,12 @@ namespace mirrage::renderer {
dpc.model = _renderer.global_uniforms().view_mat * dpc.model;
if(sub_mesh.material->substance_id() == "emissive"_strid) {
auto emissive_color =
_ecs.get(geo.entity)
.get_or_throw()
.template get<Material_property_comp>()
.process(glm::vec3(200, 200, 200), [](auto& m) { return m.emissive_color; });
auto emissive_color = glm::vec3(1000, 1000, 1000);
if(auto entity = _ecs.get(geo.entity); entity.is_some()) {
emissive_color = entity.get_or_throw().template get<Material_property_comp>().process(
emissive_color, [](auto& m) { return m.emissive_color; });
}
dpc.light_data = glm::vec4(emissive_color / 10000.0f, 1.f);
}
......
Supports Markdown
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