fromAssets static method

Future<EnvironmentMap> fromAssets({
  1. required String radianceImagePath,
  2. String? irradianceImagePath,
})

Implementation

static Future<EnvironmentMap> fromAssets(
    {required String radianceImagePath, String? irradianceImagePath}) async {
  final radianceTexture = await gpuTextureFromAsset(radianceImagePath);
  gpu.Texture? irradianceTexture;

  if (irradianceImagePath != null) {
    irradianceTexture = await gpuTextureFromAsset(irradianceImagePath);
  }

  return EnvironmentMap.fromGpuTextures(
      radianceTexture: radianceTexture, irradianceTexture: irradianceTexture);
}