Deferred renderer: support retrieving depth buffer
This commit is contained in:
parent
271a3d1b6e
commit
42afb1692b
2 changed files with 8 additions and 0 deletions
|
|
@ -129,6 +129,8 @@ namespace psemek::gfx
|
||||||
|
|
||||||
void render(std::vector<object> const & objects, render_target const & target, options const & opts);
|
void render(std::vector<object> const & objects, render_target const & target, options const & opts);
|
||||||
|
|
||||||
|
gfx::texture_2d const & depth() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
psemek_declare_pimpl
|
psemek_declare_pimpl
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -874,6 +874,7 @@ void main()
|
||||||
{
|
{
|
||||||
impl().g_buffer_texture[i].nearest_filter();
|
impl().g_buffer_texture[i].nearest_filter();
|
||||||
}
|
}
|
||||||
|
impl().g_buffer_depth.nearest_filter();
|
||||||
|
|
||||||
impl().ambient_pass_program.bind();
|
impl().ambient_pass_program.bind();
|
||||||
impl().ambient_pass_program["u_g0"] = 0;
|
impl().ambient_pass_program["u_g0"] = 0;
|
||||||
|
|
@ -1943,4 +1944,9 @@ void main()
|
||||||
check_error();
|
check_error();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
texture_2d const & deferred_renderer::depth() const
|
||||||
|
{
|
||||||
|
return impl().g_buffer_depth;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue