39 cache_uniform(program.get(), s_env,
"s_env", gfx::uniform_type::Sampler);
40 cache_uniform(program.get(), u_data,
"u_data", gfx::uniform_type::Vec4);
45 std::unique_ptr<gpu_program> program;
std::shared_ptr< texture > ptr
Performs GGX prefiltering on six 2D face textures to produce a filtered cubemap.
auto run(const run_params ¶ms) -> gfx::texture::ptr
Execute prefilter. Returns the filtered cubemap (output_cube or created internally).
auto run_compute(const run_params ¶ms) -> gfx::texture::ptr
Execute prefilter using compute shader. Returns the filtered cubemap.
auto init(rtti::context &ctx) -> bool
Initialize shaders. Call once after bgfx::init() and asset registration.
std::shared_ptr< uniform > uniform_ptr
std::array< gfx::texture::ptr, 6 > input_faces
gfx::texture::ptr output_cube_prefiltered
Optional destination cubemap (will be created if null).
gfx::texture::ptr output_cube
Optional destination cubemap (will be created if null).
bool apply_prefilter
If false, copies mips from input to output.