Skip to content
Snippets Groups Projects
Commit 3dc6e61d authored by Petr Babic's avatar Petr Babic
Browse files

conform to gfx refactor

parent db2bced0
No related branches found
No related tags found
No related merge requests found
......@@ -17,54 +17,34 @@ void Presenter::initialize()
{
osi::presenters()->push_back<com::Folder>("maker")->push_back<com::Link>(self_name() + ".link", this);
// gfx::object_system()->push_frame_back(
// gfx::object_system()->insert_object(
// { "grid" },
// gfx::shader_generators()->insert_shader_forward_varying_color(),
// gfx::buffer_generators()->insert_procedural_grid()
// ),
// grid_frame()
// );
// Generate grid
auto grid_shader = gfx::shader_system()->insert_shader("grid_shader", gfx::Shader::Pipeline::FORWARD, {"shaders"});
auto grid_color = grid_shader->insert<gfx::Shader::NodeConstant>(vec3{0, 0, 0});
grid_shader->connect(grid_shader->root(), gfx::Shader::MasterNode::inputs::color, grid_color, 0);
// --- BEGIN test_box ---
gfx::object_system()->push_frame_back(
gfx::object_system()->insert_object(
{ "grid" },
grid_shader,
gfx::buffer_generators()->insert_procedural_grid()
),
grid_frame()
);
auto shader = gfx::shader_system()->insert_shader("my_shader", gfx::Shader::Pipeline::FORWARD, {"shaders"});
auto color = shader->insert<gfx::Shader::MyConstant<vec3>>(vec3{0, 0, 1});
auto master = shader->find<gfx::Shader::MasterNode>();
shader->connect(master, 0, color, 0);
// Generate box
auto box_shader = gfx::shader_system()->insert_shader("box_shader", gfx::Shader::Pipeline::FORWARD, {"shaders"});
auto box_color = box_shader->insert<gfx::Shader::NodeConstant>(vec3{0, 0, 1});
box_shader->connect(box_shader->root(), gfx::Shader::MasterNode::inputs::color, box_color, 0);
com::Folder* const test_box = gfx::object_system()->insert_object(
{ "maker", "test_box" },
// gfx::shader_generators()->insert_shader_forward_uniform_color(),
shader,
box_shader,
gfx::buffer_generators()->insert_procedural_box_solid({ 0.5f, 0.5f, 0.5f } , "test_box", { "maker" })
);
gfx::object_system()->push_frame_back(
test_box ,
root()->push_back<com::Folder>("test_box")->push_back<com::Frame>()
);
// gfx::object_system()->get_uniforms(test_box)->push_back<com::FileVec3>("material_ambient_color", vec3{ 0.75f, 0.75f, 0 });
// The second instance
// com::Frame* const frame2 = root()->push_back<com::Folder>("test_box_2")->push_back<com::Frame>();
// frame2->move_origin({ 0.5f, 0, 1.5f });
// gfx::object_system()->push_frame_back(test_box, frame2);
// --- END test_box ---
// --- BEGIN directional light ---
// com::Frame* const frame_light = root()->push_back<com::Folder>("directional_light")->push_back<com::Frame>();
// com::Folder* const dir_light = gfx::light_system()->insert_light<gfx::DirectionalLight>(
// { "global", "directional" },
// frame_light,
// vec4{ 0.75f, 0.75f, 0.75f, 1 }
// );
// --- END directional light ---
// gfx::object_system()->insert_light(test_box, dir_light);
// gfx::light_system()->insert_shadow_caster(dir_light, test_box);
}
void Presenter::release()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment