View on GitHub Sample viewer app

Render features in a scene statically or dynamically by setting the feature layer rendering mode.

Screenshot of Set feature layer rendering mode on scene sample

Use case

In dynamic rendering mode, features and graphics are stored on the GPU. As a result, dynamic rendering mode is good for moving objects and for maintaining graphical fidelity during extent changes, since individual graphic changes can be efficiently applied directly to the GPU state. This gives the map or scene a seamless look and feel when interacting with it. The number of features and graphics has a direct impact on GPU resources, so large numbers of features or graphics can affect the responsiveness of maps or scenes to user interaction. Ultimately, the number and complexity of features and graphics that can be rendered in dynamic rendering mode is dependent on the power and memory of the device’s GPU.

In static rendering mode, features and graphics are rendered only when needed (for example, after an extent change) and offloads a significant portion of the graphical processing onto the CPU. As a result, less work is required by the GPU to draw the graphics, and the GPU can spend its resources on keeping the UI interactive. Use this mode for stationary graphics, complex geometries, and very large numbers of features or graphics. The number of features and graphics has little impact on frame render time, meaning it scales well, and pushes a constant GPU payload. However, rendering updates is CPU and system memory intensive, which can have an impact on device battery life.

How to use the sample

Use the ‘Zoom In’/‘Zoom Out’ button to trigger the zoom animation on both static and dynamic scenes.

How it works

  1. Create a scene with operational layers and set the FeatureRenderingMode for each layer.
  2. The FeatureRenderingMode can be set to Static, Dynamic, or Automatic.
  • In Static rendering mode, the number of features and graphics has little impact on frame render time, meaning it scales well, however points don’t stay screen-aligned and point/polyline/polygon objects are only redrawn once scene view navigation is complete.
  • In Dynamic rendering mode, large numbers of features or graphics can affect the responsiveness of scenes to user interaction, however points remain screen-aligned and point/polyline/polygon objects are continually redrawn while the scene view is navigating.
  • When left to automatic rendering, points are drawn dynamically and polylines and polygons statically.

Relevant API

  • FeatureLayer
  • FeatureLayer.RenderingMode
  • Scene
  • SceneView

Tags

3D, dynamic, feature layer, features, rendering, static

Sample Code

MainActivity.kt MainActivity.kt SetFeatureLayerRenderingModeOnSceneViewModel.kt SetFeatureLayerRenderingModeOnSceneScreen.kt
/* Copyright 2026 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.
*
*/
package com.esri.arcgismaps.sample.setfeaturelayerrenderingmodeonscene
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.runtime.Composable
import com.arcgismaps.ApiKey
import com.arcgismaps.ArcGISEnvironment
import com.esri.arcgismaps.sample.sampleslib.theme.SampleAppTheme
import com.esri.arcgismaps.sample.setfeaturelayerrenderingmodeonscene.screens.SetFeatureLayerRenderingModeOnSceneScreen
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// authentication with an API key or named user is
// required to access basemaps and other location services
ArcGISEnvironment.apiKey = ApiKey.create(BuildConfig.ACCESS_TOKEN)
setContent {
SampleAppTheme {
SetFeatureLayerRenderingModeOnSceneApp()
}
}
}
@Composable
private fun SetFeatureLayerRenderingModeOnSceneApp() {
Surface(color = MaterialTheme.colorScheme.background) {
SetFeatureLayerRenderingModeOnSceneScreen(
sampleName = getString(R.string.set_feature_layer_rendering_mode_on_scene_app_name)
)
}
}
}