Class Material
- java.lang.Object
-
- com.google.ar.sceneform.rendering.Material
-
@RequiresApi(api=24) public class Material extends java.lang.Object
Represents a reference to a material.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Material.Builder
Builder for constructing aMaterial
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Material.Builder
builder()
Constructs aMaterial
ExternalTexture
getExternalTexture(java.lang.String name)
Material
makeCopy()
Creates a new instance of this Material.void
setBaseColorTexture(Texture texture)
void
setBoolean(java.lang.String name, boolean x)
void
setBoolean2(java.lang.String name, boolean x, boolean y)
void
setBoolean3(java.lang.String name, boolean x, boolean y, boolean z)
void
setBoolean4(java.lang.String name, boolean x, boolean y, boolean z, boolean w)
void
setDepthTexture(java.lang.String name, DepthTexture depthTexture)
Sets aDepthTexture
to a parameter of the type 'sampler2d' on this material.void
setExternalTexture(java.lang.String name, ExternalTexture externalTexture)
Sets anExternalTexture
to a parameter of type 'samplerExternal' on this material.void
setFloat(java.lang.String name, float x)
void
setFloat2(java.lang.String name, float x, float y)
void
setFloat3(java.lang.String name, float x, float y, float z)
void
setFloat3(java.lang.String name, Vector3 value)
void
setFloat3(java.lang.String name, Color color)
void
setFloat4(java.lang.String name, float x, float y, float z, float w)
void
setFloat4(java.lang.String name, Color color)
void
setInt(java.lang.String name, int x)
void
setInt2(java.lang.String name, int x, int y)
void
setInt3(java.lang.String name, int x, int y, int z)
void
setInt4(java.lang.String name, int x, int y, int z, int w)
void
setTexture(java.lang.String name, Texture texture)
-
-
-
Method Detail
-
makeCopy
public Material makeCopy()
Creates a new instance of this Material.The new material will have a unique copy of the material parameters that can be changed independently. The getFilamentEngine material resource is immutable and will be shared between instances.
-
setBoolean
public void setBoolean(java.lang.String name, boolean x)
-
setBoolean2
public void setBoolean2(java.lang.String name, boolean x, boolean y)
-
setBoolean3
public void setBoolean3(java.lang.String name, boolean x, boolean y, boolean z)
-
setBoolean4
public void setBoolean4(java.lang.String name, boolean x, boolean y, boolean z, boolean w)
-
setFloat
public void setFloat(java.lang.String name, float x)
-
setFloat2
public void setFloat2(java.lang.String name, float x, float y)
-
setFloat3
public void setFloat3(java.lang.String name, float x, float y, float z)
-
setFloat3
public void setFloat3(java.lang.String name, Vector3 value)
-
setFloat3
public void setFloat3(java.lang.String name, Color color)
-
setFloat4
public void setFloat4(java.lang.String name, float x, float y, float z, float w)
-
setFloat4
public void setFloat4(java.lang.String name, Color color)
-
setInt
public void setInt(java.lang.String name, int x)
-
setInt2
public void setInt2(java.lang.String name, int x, int y)
-
setInt3
public void setInt3(java.lang.String name, int x, int y, int z)
-
setInt4
public void setInt4(java.lang.String name, int x, int y, int z, int w)
-
setTexture
public void setTexture(java.lang.String name, Texture texture)
-
setBaseColorTexture
public void setBaseColorTexture(Texture texture)
-
setDepthTexture
public void setDepthTexture(java.lang.String name, DepthTexture depthTexture)
Sets a
DepthTexture
to a parameter of the type 'sampler2d' on this material.- Parameters:
name
- the name of the parameter in the materialdepthTexture
- the texture to set
-
setExternalTexture
public void setExternalTexture(java.lang.String name, ExternalTexture externalTexture)
Sets anExternalTexture
to a parameter of type 'samplerExternal' on this material.- Parameters:
name
- the name of the parameter in the materialexternalTexture
- the texture to set
-
getExternalTexture
@Nullable public ExternalTexture getExternalTexture(java.lang.String name)
-
builder
public static Material.Builder builder()
Constructs aMaterial
-
-