Unravel Engine C++ Reference
Loading...
Searching...
No Matches
atmospheric_pass.h
Go to the documentation of this file.
1#pragma once
2
6
7namespace unravel
8{
9
11{
12public:
14 {
15 math::vec3 light_direction = math::normalize(math::vec3(0.2f, -0.8f, 1.0f));
16
17 // [1.9 - 10.0f]
18 float turbidity = 1.9f;
19 };
20
21 auto init(rtti::context& ctx) -> bool;
22 void run(gfx::frame_buffer::ptr input, const camera& camera, gfx::render_view& rview, delta_t dt, const run_params& params);
23
24private:
25 struct atmospheric_program : uniforms_cache
26 {
27 void cache_uniforms()
28 {
29 cache_uniform(program.get(), u_parameters, "u_parameters", gfx::uniform_type::Vec4);
30 cache_uniform(program.get(), u_kr_and_intensity, "u_kr_and_intensity", gfx::uniform_type::Vec4);
31 cache_uniform(program.get(), u_turbidity_parameters1, "u_turbidity_parameters1", gfx::uniform_type::Vec4);
32 cache_uniform(program.get(), u_turbidity_parameters2, "u_turbidity_parameters2", gfx::uniform_type::Vec4);
33 cache_uniform(program.get(), u_turbidity_parameters3, "u_turbidity_parameters3", gfx::uniform_type::Vec4);
34
35 }
36
37 gfx::program::uniform_ptr u_parameters;
38 gfx::program::uniform_ptr u_kr_and_intensity;
39 gfx::program::uniform_ptr u_turbidity_parameters1;
40 gfx::program::uniform_ptr u_turbidity_parameters2;
41 gfx::program::uniform_ptr u_turbidity_parameters3;
42
43
44 std::unique_ptr<gpu_program> program;
45
46 } atmospheric_program_;
47};
48} // namespace unravel
void run(gfx::frame_buffer::ptr input, const camera &camera, gfx::render_view &rview, delta_t dt, const run_params &params)
auto init(rtti::context &ctx) -> bool
Class representing a camera. Contains functionality for manipulating and updating a camera....
Definition camera.h:35
std::chrono::duration< float > delta_t
std::shared_ptr< uniform > uniform_ptr
Definition program.h:19
Structure for caching uniforms.
void cache_uniform(gpu_program *program, gfx::program::uniform_ptr &uniform, const hpp::string_view &name, gfx::uniform_type type, uint16_t num=1)
Caches a uniform in the GPU program.