PbrMaterial

Inheritance: java.lang.Object, com.aspose.threed.A3DObject, com.aspose.threed.Material

public class PbrMaterial extends Material

Material for physically based rendering based on albedo color/metallic/roughness

Constructors

ConstructorDescription
PbrMaterial()Construct a default PBR material instance
PbrMaterial(Vector3 albedo)Construct a default PBR material with specified albedo color value.

Fields

FieldDescription
MAP_AMBIENTUsed in setTexture to assign a ambient texture mapping.
MAP_DIFFUSEUsed in setTexture to assign a diffuse texture mapping.
MAP_EMISSIVEUsed in setTexture to assign a emissive texture mapping.
MAP_NORMALUsed in setTexture to assign a normal texture mapping.
MAP_SPECULARUsed in setTexture to assign a specular texture mapping.

Methods

MethodDescription
equals(Object arg0)
findProperty(String propertyName)Finds the property.
fromMaterial(Material material)Allow convert other material to PbrMaterial Example:
getAlbedo()Gets the base color of the material
getAlbedoTexture()Gets the texture for albedo
getClass()
getEmissiveColor()Gets the emissive color
getEmissiveTexture()Gets the texture for emissive
getMetallicFactor()Gets the metalness of the material, value of 1 means the material is a metal and value of 0 means the material is a dielectric.
getMetallicRoughness()Gets the texture for metallic(in R channel) and roughness(in G channel)
getName()Gets the name.
getNormalTexture()Gets the texture of normal mapping
getOcclusionFactor()Gets the factor of ambient occlusion
getOcclusionTexture()Gets the texture for ambient occlusion
getProperties()Gets the collection of all properties.
getProperty(String property)Get the value of specified property
getRoughnessFactor()Gets the roughness of the material, value of 1 means the material is completely rough and value of 0 means the material is completely smooth
getSpecularTexture()Gets the texture for specular color
getTexture(String slotName)Gets the texture from the specified slot, it can be material’s property name or shader’s parameter name
getTransparency()Gets the transparency factor.
hashCode()
iterator()Gets the enumerator to enumerate internal texture slots.
notify()
notifyAll()
removeProperty(Property property)Removes a dynamic property.
removeProperty(String property)Remove the specified property identified by name
setAlbedo(Vector3 value)Sets the base color of the material
setAlbedoTexture(TextureBase value)Sets the texture for albedo
setEmissiveColor(Vector3 value)Sets the emissive color
setEmissiveTexture(TextureBase value)Sets the texture for emissive
setMetallicFactor(double value)Sets the metalness of the material, value of 1 means the material is a metal and value of 0 means the material is a dielectric.
setMetallicRoughness(TextureBase value)Sets the texture for metallic(in R channel) and roughness(in G channel)
setName(String value)Sets the name.
setNormalTexture(TextureBase value)Sets the texture of normal mapping
setOcclusionFactor(double value)Sets the factor of ambient occlusion
setOcclusionTexture(TextureBase value)Sets the texture for ambient occlusion
setProperty(String property, Object value)Sets the value of specified property
setRoughnessFactor(double value)Sets the roughness of the material, value of 1 means the material is completely rough and value of 0 means the material is completely smooth
setSpecularTexture(TextureBase value)Sets the texture for specular color
setTexture(String slotName, TextureBase texture)Sets the texture to specified slot
setTransparency(double value)Sets the transparency factor.
toString()Formats object to string
wait()
wait(long arg0)
wait(long arg0, int arg1)

PbrMaterial()

public PbrMaterial()

Construct a default PBR material instance

PbrMaterial(Vector3 albedo)

public PbrMaterial(Vector3 albedo)

Construct a default PBR material with specified albedo color value.

Parameters:

ParameterTypeDescription
albedoVector3The default albedo color value

MAP_AMBIENT

public static final String MAP_AMBIENT

Used in setTexture to assign a ambient texture mapping.

MAP_DIFFUSE

public static final String MAP_DIFFUSE

Used in setTexture to assign a diffuse texture mapping.

MAP_EMISSIVE

public static final String MAP_EMISSIVE

Used in setTexture to assign a emissive texture mapping.

MAP_NORMAL

public static final String MAP_NORMAL

Used in setTexture to assign a normal texture mapping.

MAP_SPECULAR

public static final String MAP_SPECULAR

Used in setTexture to assign a specular texture mapping.

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

findProperty(String propertyName)

public Property findProperty(String propertyName)

Finds the property. It can be a dynamic property (Created by CreateDynamicProperty/SetProperty) or native property(Identified by its name)

Parameters:

ParameterTypeDescription
propertyNamejava.lang.StringProperty name.

Returns: Property - The property.

fromMaterial(Material material)

public static PbrMaterial fromMaterial(Material material)

Allow convert other material to PbrMaterial Example:

var mat = new LambertMaterial();
     var tex = new Texture();
     tex.setFileName("diffuse.png");
     mat.setTexture(Material.MAP_DIFFUSE, tex);
     mat.setDiffuseColor(new Vector3(0.3, 0.9, 0.4));
     PbrMaterial pbr = PbrMaterial.fromMaterial(mat);

Parameters:

ParameterTypeDescription
materialMaterial

Returns: PbrMaterial

getAlbedo()

public Vector3 getAlbedo()

Gets the base color of the material

Returns: Vector3 - the base color of the material

getAlbedoTexture()

public TextureBase getAlbedoTexture()

Gets the texture for albedo

Returns: TextureBase - the texture for albedo

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getEmissiveColor()

public Vector3 getEmissiveColor()

Gets the emissive color

Returns: Vector3 - the emissive color

getEmissiveTexture()

public TextureBase getEmissiveTexture()

Gets the texture for emissive

Returns: TextureBase - the texture for emissive

getMetallicFactor()

public double getMetallicFactor()

Gets the metalness of the material, value of 1 means the material is a metal and value of 0 means the material is a dielectric.

Returns: double - the metalness of the material, value of 1 means the material is a metal and value of 0 means the material is a dielectric.

getMetallicRoughness()

public TextureBase getMetallicRoughness()

Gets the texture for metallic(in R channel) and roughness(in G channel)

Returns: TextureBase - the texture for metallic(in R channel) and roughness(in G channel)

getName()

public String getName()

Gets the name.

Returns: java.lang.String - the name.

getNormalTexture()

public TextureBase getNormalTexture()

Gets the texture of normal mapping

Returns: TextureBase - the texture of normal mapping

getOcclusionFactor()

public double getOcclusionFactor()

Gets the factor of ambient occlusion

Returns: double - the factor of ambient occlusion

getOcclusionTexture()

public TextureBase getOcclusionTexture()

Gets the texture for ambient occlusion

Returns: TextureBase - the texture for ambient occlusion

getProperties()

public PropertyCollection getProperties()

Gets the collection of all properties.

Returns: PropertyCollection - the collection of all properties.

getProperty(String property)

public Object getProperty(String property)

Get the value of specified property

Parameters:

ParameterTypeDescription
propertyjava.lang.StringProperty name

Returns: java.lang.Object - The value of the found property

getRoughnessFactor()

public double getRoughnessFactor()

Gets the roughness of the material, value of 1 means the material is completely rough and value of 0 means the material is completely smooth

Returns: double - the roughness of the material, value of 1 means the material is completely rough and value of 0 means the material is completely smooth

getSpecularTexture()

public TextureBase getSpecularTexture()

Gets the texture for specular color

Returns: TextureBase - the texture for specular color

getTexture(String slotName)

public TextureBase getTexture(String slotName)

Gets the texture from the specified slot, it can be material’s property name or shader’s parameter name

Parameters:

ParameterTypeDescription
slotNamejava.lang.StringSlot name.

Returns: TextureBase - The texture. Example:

var mat = new LambertMaterial();
     var tex = new Texture();
     tex.setFileName("diffuse.png");
     mat.setTexture(Material.MAP_DIFFUSE, tex);
     tex = (Texture)mat.getTexture(Material.MAP_DIFFUSE);

getTransparency()

public double getTransparency()

Gets the transparency factor. The factor should be ranged between 0(0%, fully opaque) and 1(100%, fully transparent) Any invalid factor value will be clamped.

Returns: double - the transparency factor. The factor should be ranged between 0(0%, fully opaque) and 1(100%, fully transparent) Any invalid factor value will be clamped.

hashCode()

public native int hashCode()

Returns: int

iterator()

public Iterator<TextureSlot> iterator()

Gets the enumerator to enumerate internal texture slots.

Returns: java.util.Iterator<com.aspose.threed.TextureSlot>

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

removeProperty(Property property)

public boolean removeProperty(Property property)

Removes a dynamic property.

Parameters:

ParameterTypeDescription
propertyPropertyWhich property to remove

Returns: boolean - true if the property is successfully removed

removeProperty(String property)

public boolean removeProperty(String property)

Remove the specified property identified by name

Parameters:

ParameterTypeDescription
propertyjava.lang.StringWhich property to remove

Returns: boolean - true if the property is successfully removed

setAlbedo(Vector3 value)

public void setAlbedo(Vector3 value)

Sets the base color of the material

Parameters:

ParameterTypeDescription
valueVector3New value

setAlbedoTexture(TextureBase value)

public void setAlbedoTexture(TextureBase value)

Sets the texture for albedo

Parameters:

ParameterTypeDescription
valueTextureBaseNew value

setEmissiveColor(Vector3 value)

public void setEmissiveColor(Vector3 value)

Sets the emissive color

Parameters:

ParameterTypeDescription
valueVector3New value

setEmissiveTexture(TextureBase value)

public void setEmissiveTexture(TextureBase value)

Sets the texture for emissive

Parameters:

ParameterTypeDescription
valueTextureBaseNew value

setMetallicFactor(double value)

public void setMetallicFactor(double value)

Sets the metalness of the material, value of 1 means the material is a metal and value of 0 means the material is a dielectric.

Parameters:

ParameterTypeDescription
valuedoubleNew value

setMetallicRoughness(TextureBase value)

public void setMetallicRoughness(TextureBase value)

Sets the texture for metallic(in R channel) and roughness(in G channel)

Parameters:

ParameterTypeDescription
valueTextureBaseNew value

setName(String value)

public void setName(String value)

Sets the name.

Parameters:

ParameterTypeDescription
valuejava.lang.StringNew value

setNormalTexture(TextureBase value)

public void setNormalTexture(TextureBase value)

Sets the texture of normal mapping

Parameters:

ParameterTypeDescription
valueTextureBaseNew value

setOcclusionFactor(double value)

public void setOcclusionFactor(double value)

Sets the factor of ambient occlusion

Parameters:

ParameterTypeDescription
valuedoubleNew value

setOcclusionTexture(TextureBase value)

public void setOcclusionTexture(TextureBase value)

Sets the texture for ambient occlusion

Parameters:

ParameterTypeDescription
valueTextureBaseNew value

setProperty(String property, Object value)

public void setProperty(String property, Object value)

Sets the value of specified property

Parameters:

ParameterTypeDescription
propertyjava.lang.StringProperty name
valuejava.lang.ObjectThe value of the property

setRoughnessFactor(double value)

public void setRoughnessFactor(double value)

Sets the roughness of the material, value of 1 means the material is completely rough and value of 0 means the material is completely smooth

Parameters:

ParameterTypeDescription
valuedoubleNew value

setSpecularTexture(TextureBase value)

public void setSpecularTexture(TextureBase value)

Sets the texture for specular color

Parameters:

ParameterTypeDescription
valueTextureBaseNew value

setTexture(String slotName, TextureBase texture)

public void setTexture(String slotName, TextureBase texture)

Sets the texture to specified slot

Parameters:

ParameterTypeDescription
slotNamejava.lang.StringSlot name.
textureTextureBaseTexture. Example:
var mat = new LambertMaterial();
     var tex = new Texture();
     tex.setFileName("diffuse.png");
     mat.setTexture(Material.MAP_NORMAL, tex);
``` |

### setTransparency(double value) {#setTransparency-double-}

public void setTransparency(double value)



Sets the transparency factor. The factor should be ranged between 0(0%, fully opaque) and 1(100%, fully transparent) Any invalid factor value will be clamped.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| value | double | New value |

### toString() {#toString--}

public String toString()



Formats object to string

**Returns:**
java.lang.String - Object string
### wait() {#wait--}

public final void wait()





### wait(long arg0) {#wait-long-}

public final void wait(long arg0)





**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| arg0 | long |  |

### wait(long arg0, int arg1) {#wait-long-int-}

public final void wait(long arg0, int arg1)





**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| arg0 | long |  |
| arg1 | int |  |