Package limn.render3d.shader
@NullMarked
package limn.render3d.shader
A neutral, typed shader IR: a material's surface is a
SurfaceOutputs built from
Expr nodes, and a backend's code generator walks that DAG
to emit its own shading language, so the toolkit ships no GLSL, and a new target means
a new generator rather than new materials.
StandardSurface expresses the built-in metallic-roughness
surface in this IR, and is the model for writing a custom one.-
ClassDescriptionA node in the neutral, typed shader-expression DAG.Binary arithmetic; result type follows GLSL scalar/vector promotion.A built-in or engine helper call with a declared result type.A constructor like
vec4(rgb, a)orvec3(x).A numeric literal, scalar or vector by value count.A value computed by a bounded loop: a state of one value or several, their initial values, and the state after one turn, taken at mostmaxIterationstimes.Arithmetic operators.Non-portable inline GLSL, valid only fortarget.A named value: an input the framework or the surface declares (a UBO member, a varying, a sampler, aMaterial.Surfaceinput), or the state of theExpr.Loopit is read in, whichExpr.Loop.of(limn.render3d.shader.Expr, int, java.util.function.Function<? super limn.render3d.shader.Expr, ? extends limn.render3d.shader.Expr>)hands the loop's turn.Samplessampleratuv→ vec4.Component selection, e.g.The value types the neutral shader IR works with: the GLSL scalar/vector types plussampler2D.Builds theSurfaceOutputsfor the built-in metallic-roughness material, the same surface the hand-written reference shader computes, expressed as neutral IR so one code generator can target multiple shading languages.What a material's surface function contributes to the engine's lighting core: the metallic-roughness inputs.A shading-language target the IR can be compiled to.