fix: defer creating image entity/material/etc until actually requested

feat: expose shadow options
This commit is contained in:
Nick Fisher
2024-07-02 16:17:23 +08:00
parent 7546b2a6c5
commit c7a0b2f5cc
8 changed files with 215 additions and 63 deletions

View File

@@ -19,6 +19,13 @@ enum LightType {
SPOT,
}
enum ShadowType {
PCF, //!< percentage-closer filtered shadows (default)
VSM, //!< variance shadows
DPCF, //!< PCF with contact hardening simulation
PCSS, //!< PCF with soft shadows and contact hardening
}
// copied from filament/backened/DriverEnums.h
enum PrimitiveType {
// don't change the enums values (made to match GL)
@@ -562,10 +569,25 @@ abstract class ThermionViewer {
{bool relative = false});
///
/// Enable/disable postprocessing.
/// Enable/disable postprocessing (disabled by default).
///
Future setPostProcessing(bool enabled);
///
/// Enable/disable shadows (disabled by default).
///
Future setShadowsEnabled(bool enabled);
///
/// Set shadow type.
///
Future setShadowType(ShadowType shadowType);
///
/// Set soft shadow options (ShadowType DPCF and PCSS)
///
Future setSoftShadowOptions(double penumbraScale, double penumbraRatioScale);
///
/// Set antialiasing options.
///
@@ -707,6 +729,7 @@ abstract class ThermionViewer {
/// Register a callback to be invoked when this viewer is disposed.
///
void onDispose(Future Function() callback);
}
abstract class AbstractGizmo {