From 6448148e2acceef1ec56484d5b7d31f3fe4eeb9b Mon Sep 17 00:00:00 2001 From: Thomas Gorisse Date: Fri, 24 Nov 2023 16:11:24 +0100 Subject: [PATCH] Changed Filament View default configuration --- .../java/io/github/sceneview/SceneView.kt | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/sceneview/src/main/java/io/github/sceneview/SceneView.kt b/sceneview/src/main/java/io/github/sceneview/SceneView.kt index e4b3ca7c..12070322 100644 --- a/sceneview/src/main/java/io/github/sceneview/SceneView.kt +++ b/sceneview/src/main/java/io/github/sceneview/SceneView.kt @@ -872,13 +872,26 @@ open class SceneView @JvmOverloads constructor( fun createView(engine: Engine) = engine.createView().apply { + // On mobile, better use lower quality color buffer + renderQuality = renderQuality.apply { + hdrColorBuffer = QualityLevel.MEDIUM + } + // Dynamic resolution often helps a lot dynamicResolutionOptions = dynamicResolutionOptions.apply { + // Disabled cause generating some camera stream wrong scaling ratio + enabled = true + homogeneousScaling = true + quality = QualityLevel.MEDIUM + } + + // MSAA is needed with dynamic resolution MEDIUM + multiSampleAntiAliasingOptions = multiSampleAntiAliasingOptions.apply { enabled = false - quality = QualityLevel.HIGH } + // FXAA is pretty cheap and helps a lot - antiAliasing = AntiAliasing.NONE - // ambient occlusion is the cheapest effect that adds a lot of quality + antiAliasing = AntiAliasing.FXAA + // Ambient occlusion is the cheapest effect that adds a lot of quality ambientOcclusionOptions = ambientOcclusionOptions.apply { enabled = true }