Package limn.render3d
Record Class Material.Raw
java.lang.Object
java.lang.Record
limn.render3d.Material.Raw
- All Implemented Interfaces:
Material
- Enclosing interface:
Material
public static record Material.Raw(String vertexSource, String fragmentSource)
extends Record
implements Material
Custom GLSL. The backend provides the standard uniforms
u_mvp
(mat4), u_model (mat4) and u_normalMatrix (mat3) and the
vertex attributes at their fixed locations (VertexAttribute).
Non-portable: opts out of the shader-IR's multi-target guarantees.
A shortcut, not a back door: the pass's Frame and Lights uniform blocks are bound to the built-in PBR program only, so a raw shader cannot see the lights, the shadow map or the environment at all. Reach for it for effects that do not need them.
Color space is part of this contract: the fragment
writes into a RenderTarget, whose contents are linear light,
premultiplied, scene-referred. Write linear: decode any authored sRGB
constant (see ColorSpace) and premultiply by alpha. A raw shader
that writes display-referred sRGB has those numbers read as linear light
and tonemapped a second time by the composite; nothing detects that, the
image is just visibly wrong.
-
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of thefragmentSourcerecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.Returns the value of thevertexSourcerecord component.
-
Constructor Details
-
Raw
Creates an instance of aRawrecord class.- Parameters:
vertexSource- the value for thevertexSourcerecord componentfragmentSource- the value for thefragmentSourcerecord component
-
-
Method Details
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
vertexSource
Returns the value of thevertexSourcerecord component.- Returns:
- the value of the
vertexSourcerecord component
-
fragmentSource
Returns the value of thefragmentSourcerecord component.- Returns:
- the value of the
fragmentSourcerecord component
-