Package limn.render3d
Record Class Material.Pbr
java.lang.Object
java.lang.Record
limn.render3d.Material.Pbr
- All Implemented Interfaces:
Material
- Enclosing interface:
Material
public static record Material.Pbr(Vec4 baseColor, float metallic, float roughness, Vec3 emissive, GpuTexture baseColorTexture, Material.NormalMap normalMap, BlendMode blend)
extends Record
implements Material
Metallic-roughness PBR (Cook-Torrance GGX), lit by every
Light on the
pass plus a flat ambient term. baseColor is authored in sRGB (the
shader linearizes it) and, when baseColorTexture is set, modulated by
that texture, including its alpha. metallic/roughness are in
[0,1]; emissive is added after lighting (linear). A normalMap
perturbs the shading normal in tangent space; null shades with the
interpolated geometric normal.
A mesh carrying VertexAttribute.COLOR modulates base colour
and emissive per vertex, linear and unclamped; see
StandardSurface.
-
Nested Class Summary
Nested classes/interfaces inherited from interface limn.render3d.Material
Material.NormalMap, Material.Pbr, Material.Raw, Material.SimpleLit, Material.Surface, Material.Unlit -
Constructor Summary
ConstructorsConstructorDescriptionPbr(Vec4 baseColor, float metallic, float roughness, Vec3 emissive, GpuTexture baseColorTexture, Material.NormalMap normalMap, BlendMode blend) Creates an instance of aPbrrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thebaseColorrecord component.A copy with a different base colour; its w is opacity.Returns the value of thebaseColorTexturerecord component.blend()Returns the value of theblendrecord component.nullrestores opaque.emissive()Returns the value of theemissiverecord component.A copy that also emits light, in linear scene-referred units, unaffected by lighting.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.floatmetallic()Returns the value of themetallicrecord component.metallic(float metallic) A copy with a different metallic value,0dielectric to1metal.Returns the value of thenormalMaprecord component.normalMapped(Material.NormalMap normalMap) nullclears the map and shades with the geometric normal.static Material.Pbrof(float r, float g, float b) An opaque dielectric of the given sRGB color (roughness 0.5, no texture).floatReturns the value of theroughnessrecord component.roughness(float roughness) A copy with a different roughness,0mirror to1fully diffuse.textured(GpuTexture texture) A copy samplingtexturefor base colour, modulated by the base colour value.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Pbr
public Pbr(Vec4 baseColor, float metallic, float roughness, Vec3 emissive, GpuTexture baseColorTexture, Material.NormalMap normalMap, BlendMode blend) Creates an instance of aPbrrecord class.- Parameters:
baseColor- the value for thebaseColorrecord componentmetallic- the value for themetallicrecord componentroughness- the value for theroughnessrecord componentemissive- the value for theemissiverecord componentbaseColorTexture- the value for thebaseColorTexturerecord componentnormalMap- the value for thenormalMaprecord componentblend- the value for theblendrecord component
-
-
Method Details
-
of
An opaque dielectric of the given sRGB color (roughness 0.5, no texture). -
metallic
A copy with a different metallic value,0dielectric to1metal. -
roughness
A copy with a different roughness,0mirror to1fully diffuse. -
emissive
A copy that also emits light, in linear scene-referred units, unaffected by lighting. -
baseColor
A copy with a different base colour; its w is opacity. -
textured
A copy samplingtexturefor base colour, modulated by the base colour value. -
normalMapped
nullclears the map and shades with the geometric normal. -
blend
nullrestores opaque. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
baseColor
Returns the value of thebaseColorrecord component.- Returns:
- the value of the
baseColorrecord component
-
metallic
public float metallic()Returns the value of themetallicrecord component.- Returns:
- the value of the
metallicrecord component
-
roughness
public float roughness()Returns the value of theroughnessrecord component.- Returns:
- the value of the
roughnessrecord component
-
emissive
Returns the value of theemissiverecord component.- Returns:
- the value of the
emissiverecord component
-
baseColorTexture
Returns the value of thebaseColorTexturerecord component.- Returns:
- the value of the
baseColorTexturerecord component
-
normalMap
Returns the value of thenormalMaprecord component.- Returns:
- the value of the
normalMaprecord component
-
blend
Returns the value of theblendrecord component.
-