From 655a73981383de7803aa8df2dce4c5a5f116c699 Mon Sep 17 00:00:00 2001 From: Petr Babic <pbabic@redhat.com> Date: Mon, 15 Apr 2024 20:04:38 +0200 Subject: [PATCH] use new color buffers in deferred shading --- src/presenter.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/presenter.cpp b/src/presenter.cpp index a74ecd2..9fd5f73 100644 --- a/src/presenter.cpp +++ b/src/presenter.cpp @@ -126,16 +126,16 @@ static com::Folder *generate_box(vec3 position, vec3 half_sizes_along_axes) { gfx::shader_system()->insert_shader<gfx::ShaderGraph>({ "shaders" }, "box_shader", gfx::ShaderGraph::DEFERRED); auto container = shader->insert<gfx::ShaderGraph::TextureNode>(com::ContextPath{ "age", "texture", "container2.png" }); - // auto specular = shader->insert<gfx::ShaderGraph::TextureNode>( - // com::ContextPath{ "age", "texture", "container2_specular.png" }); + auto specular = shader->insert<gfx::ShaderGraph::TextureNode>( + com::ContextPath{ "age", "texture", "container2_specular.png" }); auto tex_coords = shader->insert<gfx::ShaderGraph::NodeVaryingTexcoord>(); shader->connect(container, gfx::ShaderGraph::TextureNode::inputs::tex_coord, tex_coords, 0); - // shader->connect(specular, gfx::ShaderGraph::TextureNode::inputs::tex_coord, tex_coords, 0); + shader->connect(specular, gfx::ShaderGraph::TextureNode::inputs::tex_coord, tex_coords, 0); shader->connect(shader->root(), gfx::ShaderGraph::MasterNodeLit::inputs::ambient, container, 0); shader->connect(shader->root(), gfx::ShaderGraph::MasterNodeLit::inputs::diffuse, container, 0); - shader->connect(shader->root(), gfx::ShaderGraph::MasterNodeLit::inputs::specular, container, 0); + shader->connect(shader->root(), gfx::ShaderGraph::MasterNodeLit::inputs::specular, specular, 0); auto material = gfx::material_system()->insert_material("box_material", shader, { gfx::material_system()->materials()->name() }); @@ -196,8 +196,8 @@ void Presenter::initialize() { gfx::object_system()->insert_light( box, gfx::light_system()->insert_light<gfx::AmbientLight>({ "ambient_light" }, nullptr, vec3{ 0.1, 1, 0.5 })); - print_tree(*root()); - print_tree(*gfx::material_system()->folder()); + // print_tree(*root()); + // print_tree(*gfx::material_system()->folder()); } void Presenter::release() { -- GitLab