run method

  1. @override
Vector4? run(
  1. Float32List v,
  2. ShaderBindings bindings,
  3. FragmentContext c
)
override

Returns linear RGBA for attachment zero. Null discards the fragment.

Implementation

@override
Vector4? run(Float32List v, ShaderBindings bindings, FragmentContext c) {
  final s = readSurface(v, bindings, c);
  // `L5`: reflects no light, as `unlit.frag` says.
  c.albedo = null;
  if (s == null) return null;
  final debug = writeDebugView(c, v, bindings, s, s.albedo);
  if (debug != null) return debug;
  // Fully rough, which is what WriteSurface's one-argument form means: a
  // surface that cannot say how polished it is should not be reflected off.
  return writeLit(
    c,
    v,
    bindings,
    color: s.albedo,
    alpha: s.alpha,
    normal: s.normal,
    roughness: 1.0,
  );
}