API reference
API reference
Select your platform
No SDKs available
No versions available

StereoMode

StereoMode

enum StereoMode : Enum<StereoMode>
StereoMode controls how a single texture is mapped to left and right eye views for stereoscopic rendering. Used in PanelConfigOptions for panel creation and SceneMaterial for material mapping based on eye display.
Example usage: Creating a panel for displaying stereoscopic 1920x1080 video.
override fun registerPanels(): List<PanelRegistration> {
  return listOf(
      PanelRegistration(R.layout.panel_layout) {
        config {
          includeGlass = false
          width = 1.0f * (1920f / 1080f) // Match aspect ratio of panel shape with video resolution
          height = 1.0f
          layoutWidthInPx = 1920 * 2 // Displaying a StereoMode.LeftRight video, so width needs to be doubled.
          layoutHeightInPx = 1080
          stereoMode = StereoMode.LeftRight // Assign StereoMode
        }
      })
}
Example usage: SceneMaterial applying a Stereoscopic effect to its texture. (Useful for custom shaders that use a Stereoscopic panel’s SceneTexture as input)
SceneMaterial.custom(
          "customShaderName",
          arrayOf(
              SceneMaterialAttribute("albedoSampler", SceneMaterialDataType.Texture2D),
          ))
      .apply {
         setTexture("albedoSampler", albedoTexture)
         setStereoMode(StereoMode.None)
       }

Entries

NameSummary
None

Default mode with no stereoscopic rendering.
LeftRight

Side-by-side stereo mode.
UpDown

Top-bottom stereo mode.
MonoLeft

Monoscopic left mode.
MonoUp

Monoscopic top mode.

Properties

NameSummary
name
val name: String
ordinal
val ordinal: Int
view2OffsetX
val view2OffsetX: Float

X offset for the second view (right eye)
view2OffsetY
val view2OffsetY: Float

Y offset for the second view (right eye)
viewScaleX
val viewScaleX: Float

X scale factor for both views
viewScaleY
val viewScaleY: Float

Y scale factor for both views

Functions

NameSummary
valueOf
fun valueOf(value: String): StereoMode

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
values
fun values(): Array<StereoMode>

Returns an array containing the constants of this enum type, in the order they’re declared.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon