render method

Future<void> render([
  1. double? dt
])

Implementation

Future<void> render([double? dt]) async{
  if(sourceTexture == null){
    FlutterAngle.activateTexture(texture!);
  }
  rendererUpdate?.call();
  if(postProcessor == null){
    // false target to get it to run
    if(sourceTexture != null && !kIsWeb){
      renderer!.setRenderTarget(falseRenderTarget);
      renderer!.render(falseMesh,falseCamera );
      renderer!.setRenderTarget(renderTarget);
    }

    renderer!.clear();
    renderer!.setViewport(0,0,width,height);
    renderer!.render(scene, camera);
  }
  else{
    renderer!.clear();
    renderer!.setRenderTarget(renderTarget);
    renderer!.setViewport(0,0,width,height);
    postProcessor?.call(dt);
  }

  if(sourceTexture != null){
    FlutterAngle.activateTexture(texture!);
  }
  await FlutterAngle.updateTexture(texture!,sourceTexture);
}