Skip to content

Screen space effect

(Documentation unfinished)

Screen space attribute estimation

ss

Input image without screen effects

Screenshot_20230101_160408

Naive screen space ambient occlusion

#include <glk/effects/naive_screen_space_ambient_occlusion.hpp>

auto ssao = std::make_shared<glk::NaiveScreenSpaceAmbientOcclusion>();
viewer->set_screen_effect(ssao);

ss_1672541947 275343

Smoothed screen space ambient occlusion

#include <glk/effects/screen_space_ambient_occlusion.hpp>

auto ssao = std::make_shared<glk::ScreenSpaceAmbientOcclusion>();
viewer->set_screen_effect(ssao);

ss_1672541948 458399

Screen space lighting

#include <glk/effects/screen_space_lighting.hpp>

Eigen::Vector3f light0_pos(1.0f, 1.0f, 5.0f);
Eigen::Vector4f light0_color(2.0f, 2.0f, 2.0f, 1.0f);

Eigen::Vector3f light1_pos(0.0f, -2.0f, 2.0f);
Eigen::Vector4f light1_color(0.5f, 0.5f, 0.5f, 1.0f);

auto lighting_effect = std::make_shared<glk::ScreenSpaceLighting>();
lighting_effect->set_light(0, light0_pos, light0_color);
lighting_effect->set_light(1, light1_pos, light1_color);

viewer->enable_normal_buffer();
viewer->set_screen_effect(lighting_effect);

ss_1672541955 615492 ss_1672541966 604093