Package com.google.android.filament
Class Skybox.Builder
- java.lang.Object
-
- com.google.android.filament.Skybox.Builder
-
- Enclosing class:
- Skybox
public static class Skybox.Builder extends java.lang.ObjectUseBuilderto construct aSkyboxobject instance.
-
-
Constructor Summary
Constructors Constructor Description Builder()UseBuilderto construct aSkyboxobject instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Skyboxbuild(Engine engine)Creates aSkyboxobjectSkybox.Buildercolor(float[] color)Sets theSkyboxto a constant color.Skybox.Buildercolor(float r, float g, float b, float a)Sets theSkyboxto a constant color.Skybox.Builderenvironment(Texture cubemap)Set the environment map (i.e.Skybox.Builderintensity(float envIntensity)Skybox.BuildershowSun(boolean show)Indicates whether the sun should be rendered.
-
-
-
Method Detail
-
environment
@NonNull public Skybox.Builder environment(@NonNull Texture cubemap)
Set the environment map (i.e. the skybox content).The
Skyboxis rendered as though it were an infinitely large cube with the camera inside it. This means that the cubemap which is mapped onto the cube's exterior will appear mirrored. This follows the OpenGL conventions.The
cmgentool generates reflection maps by default which are therefore ideal to use as skyboxes.
-
showSun
@NonNull public Skybox.Builder showSun(boolean show)
Indicates whether the sun should be rendered. The sun can only be rendered if there is at least one light of typeLightManager.Type.SUNin theScene. The default value isfalse.- Parameters:
show-trueif the sun should be rendered,falseotherwise- Returns:
- This Builder, for chaining calls.
-
intensity
@NonNull public Skybox.Builder intensity(float envIntensity)
Sets theSkyboxintensity when noIndirectLightis set on theScene.This call is ignored when an
IndirectLightis set on theScene, and the intensity of theIndirectLightis used instead.- Parameters:
envIntensity- Scale factor applied to the skybox texel values such that the result is in lux, or lumen/m^2 (default = 30000)- Returns:
- This Builder, for chaining calls.
- See Also:
IndirectLight.Builder.intensity(float)
-
color
@NonNull public Skybox.Builder color(float r, float g, float b, float a)
Sets theSkyboxto a constant color. Default is opaque black. Ignored if an environment is set.- Returns:
- This Builder, for chaining calls.
-
color
@NonNull public Skybox.Builder color(@NonNull @Size(min=4L) float[] color)
Sets theSkyboxto a constant color. Default is opaque black. Ignored if an environment is set.- Parameters:
color- an array of 4 floats- Returns:
- This Builder, for chaining calls.
-
-