Click or drag to resize

SceneViewSpaceEffect Property

Gets or sets a value indicating whether outer space is black with stars or transparent in the scene view.

Namespace:  Esri.ArcGISRuntime.UI.Controls
Assembly:  Esri.ArcGISRuntime (in Esri.ArcGISRuntime.dll) Version:
public SpaceEffect SpaceEffect { get; set; }

Property Value

Type: SpaceEffect
Setting the background to none will hide the starry sky effect and make the background color completely transparent. The atmosphere effect will remain unchanged. Default is Stars. To create an augmented reality experience set this to None to render through to the camera view behind it.


Example Name: ExploreScenesInFlyoverAR

Use augmented reality (AR) to quickly explore a scene more naturally than you could with a touch or mouse interface.

Code example screen shot.

// Copyright 2019 Esri.
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
// language governing permissions and limitations under the License.

using Android.App;
using Android.OS;
using Android.Support.V7.App;
using Android.Widget;
using Esri.ArcGISRuntime.ARToolkit;
using Esri.ArcGISRuntime.Geometry;
using Esri.ArcGISRuntime.Mapping;
using Esri.ArcGISRuntime.UI;
using System;

namespace ArcGISRuntimeXamarin.Samples.ExploreScenesInFlyoverAR
    [Activity(ConfigurationChanges =
        Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]
        "Explore scenes in flyover AR",
        "Augmented reality",
        "Use augmented reality (AR) to quickly explore a scene more naturally than you could with a touch or mouse interface.",
    public class ExploreScenesInFlyoverAR : AppCompatActivity
        // Hold references to the UI controls.
        private ARSceneView _arSceneView;

        protected override void OnCreate(Bundle bundle)

            Title = "Explore scenes in flyover AR";


        private void CreateLayout()
            // Create the layout.
            LinearLayout layout = new LinearLayout(this) {Orientation = Orientation.Vertical};

            // Add the AR scene view.
            _arSceneView = new ARSceneView(this);


            // Request camera permission. Initialize will be called when permissions are granted.

        private async void Initialize()
            // Create the scene with a basemap.
            Scene flyoverScene = new Scene(Basemap.CreateImagery());

            // Create the integrated mesh layer and add it to the scene.
            IntegratedMeshLayer meshLayer =
                new IntegratedMeshLayer(
                    new Uri(""));

                // Wait for the layer to load so that extent is available.
                await meshLayer.LoadAsync();

                // Start with the camera at the center of the mesh layer.
                Envelope layerExtent = meshLayer.FullExtent;
                Camera originCamera = new Camera(layerExtent.GetCenter().Y, layerExtent.GetCenter().X, 600, 0, 90, 0);
                _arSceneView.OriginCamera = originCamera;

                // Set the translation factor to enable rapid movement through the scene.
                _arSceneView.TranslationFactor = 1000;

                // Enable atmosphere and space effects for a more immersive experience.
                _arSceneView.SpaceEffect = SpaceEffect.Stars;
                _arSceneView.AtmosphereEffect = AtmosphereEffect.Realistic;

                // Display the scene.
                await flyoverScene.LoadAsync();
                _arSceneView.Scene = flyoverScene;
            catch (Exception ex)
                new Android.App.AlertDialog.Builder(this).SetMessage("Failed to start AR").SetTitle("Error").Show();

        protected override async void OnPause()
            await _arSceneView.StopTrackingAsync();

        protected override async void OnResume()

            // Start AR tracking without location updates.
            await _arSceneView.StartTrackingAsync();
See Also