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.
  • Class
    Description
    A 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) or vec3(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 most maxIterations times.
    Arithmetic operators.
    Non-portable inline GLSL, valid only for target.
    A named value: an input the framework or the surface declares (a UBO member, a varying, a sampler, a Material.Surface input), or the state of the Expr.Loop it is read in, which Expr.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.
    Samples sampler at uv → vec4.
    Component selection, e.g.
    The value types the neutral shader IR works with: the GLSL scalar/vector types plus sampler2D.
    Builds the SurfaceOutputs for 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.