precache static method

Future<void> precache()

Loads the shader before the first frame, so glass refracts from the start. Optional: glass loads it on its own and frosts until then.

Implementation

static Future<void> precache() async {
  final program = await load();
  if (program != null && canRecordImages) _warmUp(program);
}