add dithering to view
This commit is contained in:
@@ -126,10 +126,12 @@ using namespace filament;
|
||||
auto view = reinterpret_cast<View *>(tView);
|
||||
View::MultiSampleAntiAliasingOptions multiSampleAntiAliasingOptions;
|
||||
multiSampleAntiAliasingOptions.enabled = msaa;
|
||||
|
||||
multiSampleAntiAliasingOptions.sampleCount = 2;
|
||||
view->setMultiSampleAntiAliasingOptions(multiSampleAntiAliasingOptions);
|
||||
|
||||
TemporalAntiAliasingOptions taaOpts;
|
||||
taaOpts.enabled = taa;
|
||||
|
||||
view->setTemporalAntiAliasingOptions(taaOpts);
|
||||
view->setAntiAliasing(fxaa ? AntiAliasing::FXAA : AntiAliasing::NONE);
|
||||
}
|
||||
@@ -175,6 +177,20 @@ using namespace filament;
|
||||
});
|
||||
}
|
||||
|
||||
EMSCRIPTEN_KEEPALIVE void View_setDitheringEnabled(TView *tView, bool enabled) {
|
||||
auto *view = reinterpret_cast<View *>(tView);
|
||||
if(enabled) {
|
||||
view->setDithering(Dithering::TEMPORAL);
|
||||
} else {
|
||||
view->setDithering(Dithering::NONE);
|
||||
}
|
||||
}
|
||||
|
||||
EMSCRIPTEN_KEEPALIVE bool View_isDitheringEnabled(TView *tView) {
|
||||
auto *view = reinterpret_cast<View *>(tView);
|
||||
return view->getDithering() == Dithering::TEMPORAL;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user