- Sceneform SDK for Android
was open sourced and archived ( github.com/google-ar/sceneform-android-sdk
) with version 1.16.0.
- This site ( developers.google.com/sceneform
) serves as the documentation archive for the previous version, Sceneform SDK for Android
1.15.0.
- Do not use version 1.17.0 of the Sceneform Maven artifacts
.
- The 1.17.1 Maven artifacts can be used. Other than the version, however, the 1.17.1 artifacts are identical to the 1.15.0 artifacts.
PlaneRenderer
Stay organized with collections
Save and categorize content based on your preferences.
Control rendering of ARCore planes.
Used to visualize detected planes and to control whether Renderables cast shadows on them.
Public Methods
CompletableFuture< Material
> |
getMaterial
() Returns default material instance used to render the planes.
|
boolean |
isEnabled
() Check if the plane renderer is enabled.
|
boolean |
isShadowReceiver
() Return true if Renderables in the scene cast shadows onto the planes.
|
boolean |
isVisible
() Return true if plane visualization is visible.
|
void |
setEnabled
(boolean enabled) Enable/disable the plane renderer.
|
void |
setShadowReceiver
(boolean shadowReceiver) Control whether Renderables in the scene should cast shadows onto the planes.
|
void |
setVisible
(boolean visible) Control visibility of plane visualization.
|
Inherited Methods
From class
java.lang.Object
Constants
public
static
final String
MATERIAL_COLOR
Float3 material parameter to control the RGB tint of the plane.
Constant Value:
"color"
public
static
final String
MATERIAL_SPOTLIGHT_RADIUS
Float material parameter to control the radius of the spotlight.
Constant Value:
"radius"
public
static
final String
MATERIAL_TEXTURE
Material parameter that controls what texture is being used when rendering the planes.
Constant Value:
"texture"
public
static
final String
MATERIAL_UV_SCALE
Float2 material parameter to control the X/Y scaling of the texture's UV coordinates. Can be
used to adjust for the texture's aspect ratio and control the frequency of tiling.
Constant Value:
"uvScale"
Public Methods
public
CompletableFuture< Material
>
getMaterial
()
Returns default material instance used to render the planes.
public
boolean
isEnabled
()
Check if the plane renderer is enabled.
public
boolean
isShadowReceiver
()
Return true if Renderables in the scene cast shadows onto the planes.
public
boolean
isVisible
()
Return true if plane visualization is visible.
public
void
setEnabled
(boolean enabled)
Enable/disable the plane renderer.
public
void
setShadowReceiver
(boolean shadowReceiver)
Control whether Renderables in the scene should cast shadows onto the planes.
If false - no planes receive shadows, regardless of the per-plane setting.
public
void
setVisible
(boolean visible)
Control visibility of plane visualization.
If false - no planes are drawn. Note that shadow visibility is independent of plane
visibility.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-06-26 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-06-26 UTC."],[[["\u003cp\u003e\u003ccode\u003ePlaneRenderer\u003c/code\u003e controls the visual representation of detected ARCore planes and their shadow-casting behavior.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can customize plane appearance using material parameters like color, spotlight radius, texture, and UV scaling.\u003c/p\u003e\n"],["\u003cp\u003eThe class provides methods to enable/disable plane rendering, control shadow reception, and manage plane visibility.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ePlaneRenderer\u003c/code\u003e offers access to the default material used for rendering and allows for dynamic adjustments during runtime.\u003c/p\u003e\n"],["\u003cp\u003ePlane visibility and shadow reception can be controlled independently, enabling flexible customization of AR scenes.\u003c/p\u003e\n"]]],["The `PlaneRenderer` class manages ARCore plane rendering. It allows control over plane visualization, including enabling/disabling the renderer and toggling visibility. It also controls whether objects cast shadows onto the planes. Key actions include `setEnabled`, `setVisible`, and `setShadowReceiver`. Customizable material properties via constants are `MATERIAL_COLOR`, `MATERIAL_SPOTLIGHT_RADIUS`, `MATERIAL_TEXTURE`, and `MATERIAL_UV_SCALE`. There are methods to return the state like: `isEnabled`, `isVisible`, and `isShadowReceiver`. `getMaterial` provides default plane material.\n"],null,["# PlaneRenderer\n\npublic class **PlaneRenderer** \nControl rendering of ARCore planes.\n\nUsed to visualize detected planes and to control whether Renderables cast shadows on them. \n\n### Constants\n\n|--------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------|\n| [String](https://developer.android.com/reference/java/lang/String) | [MATERIAL_COLOR](/sceneform/reference/com/google/ar/sceneform/rendering/PlaneRenderer#MATERIAL_COLOR) | Float3 material parameter to control the RGB tint of the plane. |\n| [String](https://developer.android.com/reference/java/lang/String) | [MATERIAL_SPOTLIGHT_RADIUS](/sceneform/reference/com/google/ar/sceneform/rendering/PlaneRenderer#MATERIAL_SPOTLIGHT_RADIUS) | Float material parameter to control the radius of the spotlight. |\n| [String](https://developer.android.com/reference/java/lang/String) | [MATERIAL_TEXTURE](/sceneform/reference/com/google/ar/sceneform/rendering/PlaneRenderer#MATERIAL_TEXTURE) | Material parameter that controls what texture is being used when rendering the planes. |\n| [String](https://developer.android.com/reference/java/lang/String) | [MATERIAL_UV_SCALE](/sceneform/reference/com/google/ar/sceneform/rendering/PlaneRenderer#MATERIAL_UV_SCALE) | Float2 material parameter to control the X/Y scaling of the texture's UV coordinates. |\n\n### Public Methods\n\n|--------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| CompletableFuture\\\u003c[Material](/sceneform/reference/com/google/ar/sceneform/rendering/Material)\\\u003e | [getMaterial](/sceneform/reference/com/google/ar/sceneform/rendering/PlaneRenderer#getMaterial())() Returns default material instance used to render the planes. |\n| boolean | [isEnabled](/sceneform/reference/com/google/ar/sceneform/rendering/PlaneRenderer#isEnabled())() Check if the plane renderer is enabled. |\n| boolean | [isShadowReceiver](/sceneform/reference/com/google/ar/sceneform/rendering/PlaneRenderer#isShadowReceiver())() Return true if Renderables in the scene cast shadows onto the planes. |\n| boolean | [isVisible](/sceneform/reference/com/google/ar/sceneform/rendering/PlaneRenderer#isVisible())() Return true if plane visualization is visible. |\n| void | [setEnabled](/sceneform/reference/com/google/ar/sceneform/rendering/PlaneRenderer#setEnabled(boolean))(boolean enabled) Enable/disable the plane renderer. |\n| void | [setShadowReceiver](/sceneform/reference/com/google/ar/sceneform/rendering/PlaneRenderer#setShadowReceiver(boolean))(boolean shadowReceiver) Control whether Renderables in the scene should cast shadows onto the planes. |\n| void | [setVisible](/sceneform/reference/com/google/ar/sceneform/rendering/PlaneRenderer#setVisible(boolean))(boolean visible) Control visibility of plane visualization. |\n\n### Inherited Methods\n\nFrom class java.lang.Object \n\n|-----------------------------------------------------------------------------|---------------------------------------------------------------------------------|\n| [Object](https://developer.android.com/reference/java/lang/Object) | clone() |\n| boolean | equals([Object](https://developer.android.com/reference/java/lang/Object) arg0) |\n| void | finalize() |\n| final [Class](https://developer.android.com/reference/java/lang/Class)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](https://developer.android.com/reference/java/lang/String) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nConstants\n---------\n\n#### public static final [String](https://developer.android.com/reference/java/lang/String)\n**MATERIAL_COLOR**\n\nFloat3 material parameter to control the RGB tint of the plane. \nConstant Value: \"color\" \n\n#### public static final [String](https://developer.android.com/reference/java/lang/String)\n**MATERIAL_SPOTLIGHT_RADIUS**\n\nFloat material parameter to control the radius of the spotlight. \nConstant Value: \"radius\" \n\n#### public static final [String](https://developer.android.com/reference/java/lang/String)\n**MATERIAL_TEXTURE**\n\nMaterial parameter that controls what texture is being used when rendering the planes. \nConstant Value: \"texture\" \n\n#### public static final [String](https://developer.android.com/reference/java/lang/String)\n**MATERIAL_UV_SCALE**\n\nFloat2 material parameter to control the X/Y scaling of the texture's UV coordinates. Can be\nused to adjust for the texture's aspect ratio and control the frequency of tiling. \nConstant Value: \"uvScale\"\n\nPublic Methods\n--------------\n\n#### public CompletableFuture\\\u003c[Material](/sceneform/reference/com/google/ar/sceneform/rendering/Material)\\\u003e\n**getMaterial**\n()\n\nReturns default material instance used to render the planes. \n\n#### public boolean\n**isEnabled**\n()\n\nCheck if the plane renderer is enabled. \n\n#### public boolean\n**isShadowReceiver**\n()\n\nReturn true if Renderables in the scene cast shadows onto the planes. \n\n#### public boolean\n**isVisible**\n()\n\nReturn true if plane visualization is visible. \n\n#### public void\n**setEnabled**\n(boolean enabled)\n\nEnable/disable the plane renderer. \n\n##### Parameters\n\n| enabled | |\n|---------|---|\n\n#### public void\n**setShadowReceiver**\n(boolean shadowReceiver)\n\nControl whether Renderables in the scene should cast shadows onto the planes.\n\nIf false - no planes receive shadows, regardless of the per-plane setting. \n\n##### Parameters\n\n| shadowReceiver | |\n|----------------|---|\n\n#### public void\n**setVisible**\n(boolean visible)\n\nControl visibility of plane visualization.\n\nIf false - no planes are drawn. Note that shadow visibility is independent of plane\nvisibility. \n\n##### Parameters\n\n| visible | |\n|---------|---|"]]