add setBloom method
This commit is contained in:
@@ -53,6 +53,7 @@ namespace polyvox {
|
||||
~FilamentViewer();
|
||||
|
||||
void setToneMapping(ToneMapping toneMapping);
|
||||
void setBloom(float strength);
|
||||
void loadSkybox(const char* const skyboxUri);
|
||||
void removeSkybox();
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ void set_background_image(const void* const viewer, const char *path);
|
||||
void set_background_image_position(const void* const viewer, float x, float y, bool clamp);
|
||||
void set_background_color(const void* const viewer, const float r, const float g, const float b, const float a);
|
||||
void set_tone_mapping(const void* const viewer, int toneMapping);
|
||||
void set_bloom(const void* const viewer, float strength);
|
||||
void load_skybox(const void* const viewer, const char *skyboxPath);
|
||||
void load_ibl(const void* const viewer, const char *iblPath, float intensity);
|
||||
void remove_skybox(const void* const viewer);
|
||||
|
||||
@@ -138,10 +138,7 @@ FilamentViewer::FilamentViewer(const void* context, const ResourceLoaderWrapper*
|
||||
|
||||
setToneMapping(ToneMapping::ACES);
|
||||
|
||||
decltype(_view->getBloomOptions()) opts;
|
||||
opts.enabled = true;
|
||||
opts.strength = 0.6f;
|
||||
_view->setBloomOptions(opts);
|
||||
setBloom(0.6f);
|
||||
|
||||
_view->setScene(_scene);
|
||||
_view->setCamera(_mainCamera);
|
||||
@@ -238,6 +235,13 @@ FilamentViewer::FilamentViewer(const void* context, const ResourceLoaderWrapper*
|
||||
_scene->addEntity(imageEntity);
|
||||
}
|
||||
|
||||
void FilamentViewer::setBloom(float strength) {
|
||||
decltype(_view->getBloomOptions()) opts;
|
||||
opts.enabled = true;
|
||||
opts.strength = strength;
|
||||
_view->setBloomOptions(opts);
|
||||
}
|
||||
|
||||
void FilamentViewer::setToneMapping(ToneMapping toneMapping) {
|
||||
|
||||
ToneMapper* tm;
|
||||
|
||||
@@ -52,6 +52,11 @@ extern "C" {
|
||||
((FilamentViewer*)viewer)->setToneMapping((ToneMapping)toneMapping);
|
||||
}
|
||||
|
||||
FLUTTER_PLUGIN_EXPORT void set_bloom(const void* const viewer, float strength) {
|
||||
Log("Setting bloom to %f", strength);
|
||||
((FilamentViewer*)viewer)->setBloom(strength);
|
||||
}
|
||||
|
||||
FLUTTER_PLUGIN_EXPORT void load_skybox(const void* const viewer, const char* skyboxPath) {
|
||||
((FilamentViewer*)viewer)->loadSkybox(skyboxPath);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user