- 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.
Light.Builder
Stay organized with collections
Save and categorize content based on your preferences.
Inherited Methods
From class
java.lang.Object
Object
|
clone()
|
boolean
|
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
Public Methods
public
Light
build
()
Creates a new Light
based on the parameters set previously
Sets the "RGB" color of the light. Note that intensity if is a separate parameter, so you
should set the pure color (i.e. each channel is in the [0,1] range). However setting values
outside that range is valid.
Parameters
color |
"RGB" color, default is (1, 1, 1)
|
public
Light.Builder
setColorTemperature
(float temperature)
Sets the "RGB" color of the light based on the desired "color temperature."
Parameters
temperature |
color temperature in Kelvin on a scale from 1,000 to 10,000K. Typical
commercial and residential lighting falls somewhere in the 2000K to 6500K range.
|
public
Light.Builder
setFalloffRadius
(float falloffRadius)
Sets the range that the light intensity falls off to zero. This has no affect on infinite
light types - the Directional types.
Parameters
falloffRadius |
the light radius in world units, default is 10.0f.
|
public
Light.Builder
setInnerConeAngle
(float coneInner)
Spotlights shine light in a cone, this value determines the size of the inner part of the
cone. The intensity is interpolated between the inner and outer cone angles - meaning if they
are the same than the cone is perfectly sharp. Generally you will want the inner cone to be
smaller than the outer cone to avoid aliasing.
Parameters
coneInner |
inner cone angle in radians, default is 0.5
|
public
Light.Builder
setIntensity
(float intensity)
Sets the light intensity which determines how bright the light is in Lux (lx) or Lumens (lm)
(depending on the light type). Larger values produce brighter lights and near zero values
generate very little light. A household light bulb will generally have an intensity between
800 - 2500 lm whereas sunlight will be around 120,000 lx. There is no absolute upper bound
but values larger than sunlight (120,000 lx) are generally not needed.
Parameters
intensity |
the intensity of the light, values greater than one are valid. The intensity
will be clamped and cannot be zero or negative. For directional lights the default is 420
lx. For other other lights the default is 2500 lm.
|
public
Light.Builder
setOuterConeAngle
(float coneOuter)
Spotlights shine light in a cone, this value determines the size of the outer part of the
cone. The intensity is interpolated between the inner and outer cone angles - meaning if they
are the same than the cone is perfectly sharp. Generally you will want the inner cone to be
smaller than the outer cone to avoid aliasing.
Parameters
coneOuter |
outer cone angle in radians, default is 0.6
|
public
Light.Builder
setShadowCastingEnabled
(boolean enableShadows)
Determines whether the light casts shadows, or whether synthetic objects can block the light.
Parameters
enableShadows |
true to enable to shadows, false to disable; default is false.
|
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\u003eLight.Builder\u003c/code\u003e is a factory class used to create and customize \u003ccode\u003eLight\u003c/code\u003e objects in Sceneform.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods to set light properties such as color, intensity, falloff radius, and cone angles for spotlights.\u003c/p\u003e\n"],["\u003cp\u003eYou can also control whether a light casts shadows using the \u003ccode\u003esetShadowCastingEnabled\u003c/code\u003e method.\u003c/p\u003e\n"],["\u003cp\u003eAfter configuring the desired properties, call the \u003ccode\u003ebuild()\u003c/code\u003e method to create a new \u003ccode\u003eLight\u003c/code\u003e instance.\u003c/p\u003e\n"]]],["The `Light.Builder` class is a factory for creating `Light` objects. Key actions include setting light properties like color via RGB or color temperature, intensity in Lux or Lumens, and the falloff radius. For spotlights, it allows setting inner and outer cone angles. Shadow casting can be enabled or disabled. Finally, the `build()` method creates a new `Light` object using the configured parameters.\n"],null,["# Light.Builder\n\npublic static final class **Light.Builder** \nFactory class for [Light](/sceneform/reference/com/google/ar/sceneform/rendering/Light) \n\n### Public Methods\n\n|---------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Light](/sceneform/reference/com/google/ar/sceneform/rendering/Light) | [build](/sceneform/reference/com/google/ar/sceneform/rendering/Light.Builder#build())() Creates a new [Light](/sceneform/reference/com/google/ar/sceneform/rendering/Light) based on the parameters set previously |\n| [Light.Builder](/sceneform/reference/com/google/ar/sceneform/rendering/Light.Builder) | [setColor](/sceneform/reference/com/google/ar/sceneform/rendering/Light.Builder#setColor(com.google.ar.sceneform.rendering.Color))([Color](/sceneform/reference/com/google/ar/sceneform/rendering/Color) color) Sets the \"RGB\" color of the light. |\n| [Light.Builder](/sceneform/reference/com/google/ar/sceneform/rendering/Light.Builder) | [setColorTemperature](/sceneform/reference/com/google/ar/sceneform/rendering/Light.Builder#setColorTemperature(float))(float temperature) Sets the \"RGB\" color of the light based on the desired \"color temperature.\" |\n| [Light.Builder](/sceneform/reference/com/google/ar/sceneform/rendering/Light.Builder) | [setFalloffRadius](/sceneform/reference/com/google/ar/sceneform/rendering/Light.Builder#setFalloffRadius(float))(float falloffRadius) Sets the range that the light intensity falls off to zero. |\n| [Light.Builder](/sceneform/reference/com/google/ar/sceneform/rendering/Light.Builder) | [setInnerConeAngle](/sceneform/reference/com/google/ar/sceneform/rendering/Light.Builder#setInnerConeAngle(float))(float coneInner) Spotlights shine light in a cone, this value determines the size of the inner part of the cone. |\n| [Light.Builder](/sceneform/reference/com/google/ar/sceneform/rendering/Light.Builder) | [setIntensity](/sceneform/reference/com/google/ar/sceneform/rendering/Light.Builder#setIntensity(float))(float intensity) Sets the light intensity which determines how bright the light is in Lux (lx) or Lumens (lm) (depending on the light type). |\n| [Light.Builder](/sceneform/reference/com/google/ar/sceneform/rendering/Light.Builder) | [setOuterConeAngle](/sceneform/reference/com/google/ar/sceneform/rendering/Light.Builder#setOuterConeAngle(float))(float coneOuter) Spotlights shine light in a cone, this value determines the size of the outer part of the cone. |\n| [Light.Builder](/sceneform/reference/com/google/ar/sceneform/rendering/Light.Builder) | [setShadowCastingEnabled](/sceneform/reference/com/google/ar/sceneform/rendering/Light.Builder#setShadowCastingEnabled(boolean))(boolean enableShadows) Determines whether the light casts shadows, or whether synthetic objects can block the light. |\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\nPublic Methods\n--------------\n\n#### public [Light](/sceneform/reference/com/google/ar/sceneform/rendering/Light)\n**build**\n()\n\nCreates a new [Light](/sceneform/reference/com/google/ar/sceneform/rendering/Light) based on the parameters set previously \n\n#### public [Light.Builder](/sceneform/reference/com/google/ar/sceneform/rendering/Light.Builder)\n**setColor**\n([Color](/sceneform/reference/com/google/ar/sceneform/rendering/Color) color)\n\nSets the \"RGB\" color of the light. Note that intensity if is a separate parameter, so you\nshould set the pure color (i.e. each channel is in the \\[0,1\\] range). However setting values\noutside that range is valid. \n\n##### Parameters\n\n| color | \"RGB\" color, default is (1, 1, 1) |\n|-------|-----------------------------------|\n\n#### public [Light.Builder](/sceneform/reference/com/google/ar/sceneform/rendering/Light.Builder)\n**setColorTemperature**\n(float temperature)\n\nSets the \"RGB\" color of the light based on the desired \"color temperature.\" \n\n##### Parameters\n\n| temperature | color temperature in Kelvin on a scale from 1,000 to 10,000K. Typical commercial and residential lighting falls somewhere in the 2000K to 6500K range. |\n|-------------|--------------------------------------------------------------------------------------------------------------------------------------------------------|\n\n#### public [Light.Builder](/sceneform/reference/com/google/ar/sceneform/rendering/Light.Builder)\n**setFalloffRadius**\n(float falloffRadius)\n\nSets the range that the light intensity falls off to zero. This has no affect on infinite\nlight types - the Directional types. \n\n##### Parameters\n\n| falloffRadius | the light radius in world units, default is 10.0f. |\n|---------------|----------------------------------------------------|\n\n#### public [Light.Builder](/sceneform/reference/com/google/ar/sceneform/rendering/Light.Builder)\n**setInnerConeAngle**\n(float coneInner)\n\nSpotlights shine light in a cone, this value determines the size of the inner part of the\ncone. The intensity is interpolated between the inner and outer cone angles - meaning if they\nare the same than the cone is perfectly sharp. Generally you will want the inner cone to be\nsmaller than the outer cone to avoid aliasing. \n\n##### Parameters\n\n| coneInner | inner cone angle in radians, default is 0.5 |\n|-----------|---------------------------------------------|\n\n#### public [Light.Builder](/sceneform/reference/com/google/ar/sceneform/rendering/Light.Builder)\n**setIntensity**\n(float intensity)\n\nSets the light intensity which determines how bright the light is in Lux (lx) or Lumens (lm)\n(depending on the light type). Larger values produce brighter lights and near zero values\ngenerate very little light. A household light bulb will generally have an intensity between\n800 - 2500 lm whereas sunlight will be around 120,000 lx. There is no absolute upper bound\nbut values larger than sunlight (120,000 lx) are generally not needed. \n\n##### Parameters\n\n| intensity | the intensity of the light, values greater than one are valid. The intensity will be clamped and cannot be zero or negative. For directional lights the default is 420 lx. For other other lights the default is 2500 lm. |\n|-----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n\n#### public [Light.Builder](/sceneform/reference/com/google/ar/sceneform/rendering/Light.Builder)\n**setOuterConeAngle**\n(float coneOuter)\n\nSpotlights shine light in a cone, this value determines the size of the outer part of the\ncone. The intensity is interpolated between the inner and outer cone angles - meaning if they\nare the same than the cone is perfectly sharp. Generally you will want the inner cone to be\nsmaller than the outer cone to avoid aliasing. \n\n##### Parameters\n\n| coneOuter | outer cone angle in radians, default is 0.6 |\n|-----------|---------------------------------------------|\n\n#### public [Light.Builder](/sceneform/reference/com/google/ar/sceneform/rendering/Light.Builder)\n**setShadowCastingEnabled**\n(boolean enableShadows)\n\nDetermines whether the light casts shadows, or whether synthetic objects can block the light. \n\n##### Parameters\n\n| enableShadows | true to enable to shadows, false to disable; default is false. |\n|---------------|----------------------------------------------------------------|"]]