Unravel Engine C++ Reference
Loading...
Searching...
No Matches
atmospheric_pass_skybox.h
Go to the documentation of this file.
1#pragma once
2
5
10
11namespace unravel
12{
13
15{
16public:
23 bool init(rtti::context& ctx);
24
25 // Run after geometry
26 void run(gfx::frame_buffer::ptr target, const camera& cam, gfx::render_view& rview, delta_t dt, const run_params& params);
27
28private:
29 struct skybox_program : uniforms_cache
30 {
31 void cache_uniforms()
32 {
33 cache_uniform(program.get(), u_texCube, "s_texCube", gfx::uniform_type::Sampler);
34 cache_uniform(program.get(), u_sky_brightness, "u_sky_brightness", gfx::uniform_type::Vec4);
35 }
36
38 gfx::program::uniform_ptr u_sky_brightness;
39 std::unique_ptr<gpu_program> program;
40 } program_;
41
42 // A simple inside-out cube
43 std::unique_ptr<gfx::vertex_buffer> vb_;
44 std::unique_ptr<gfx::index_buffer> ib_;
45};
46} // namespace unravel
void run(gfx::frame_buffer::ptr target, const camera &cam, gfx::render_view &rview, delta_t dt, const run_params &params)
Class representing a camera. Contains functionality for manipulating and updating a camera....
Definition camera.h:62
std::chrono::duration< float > delta_t
Thread-safe handle to an asset.
std::shared_ptr< uniform > uniform_ptr
Definition program.h:19
float sky_brightness
Sky brightness multiplier (1.0 = neutral). Affects visible sky and irradiance.
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.