umbra 0.1.0-dev.4 umbra: ^0.1.0-dev.4 copied to clipboard
The core functionality for Umbra shaders which that helps Flutter developers to generate the necessary files for Flutter Shaders.
import 'dart:io';
import 'package:umbra/umbra.dart';
Future<void> main() async {
for (final file in [
File('./shaders/simple.glsl'),
File('./shaders/with_precision.glsl'),
File('./shaders/with_uniforms.glsl'),
File('./shaders/with_version.glsl'),
]) {
final specification = ShaderSpecification.fromFile(file);
final generator = RawShaderGenerator(specification);
final rawBytes = await generator.generate();
File(file.path.replaceAll('/shaders/', '/')).writeAsBytesSync(rawBytes);
}
}