Skip to content

high-poly models looking very low-resolution/pixelated #60

@redesign3d

Description

@redesign3d

Hey,

I've been playing with the package for a few days now, and managed to successfully load models, created a new Camera which allows for free transformation etc. - but one thing I cannot seem to understand is why models I load look pixelated, but only when exceeding a certain polycount.
The FlutterLogo from the example looks perfectly fine, yet any higher poly models end up being pixelated.

This is my CustomPainter:

class _ScenePainter extends CustomPainter {
  final Scene scene;
  final OrbitCamera orbitCamera;

  _ScenePainter(this.scene, this.orbitCamera);

  @override
  void paint(Canvas canvas, Size size) {
    // Render scene using updated camera
    scene.render(
      orbitCamera.camera, 
      canvas, 
      viewport: Offset.zero & size, 
      
    );
  }

  @override
  bool shouldRepaint(covariant CustomPainter oldDelegate) => true;
}

and setting antiAlias and filterQuality did not change anything, except now it looks more muddy than it did before:

class _ScenePainter extends CustomPainter {
  final Scene scene;
  final OrbitCamera orbitCamera;

  _ScenePainter(this.scene, this.orbitCamera);

  @override
  void paint(Canvas canvas, Size size) {
    // Create a Paint with anti-alias and high filter quality.
    final paint = Paint()
      ..isAntiAlias = true
      ..filterQuality = FilterQuality.high;

    // Draw the scene onto an offscreen layer with the custom paint.
    canvas.saveLayer(Offset.zero & size, paint);
    scene.render(
      orbitCamera.camera, 
      canvas, 
      viewport: Offset.zero & size,
    );
    canvas.restore();
  }

  @override
  bool shouldRepaint(covariant CustomPainter oldDelegate) => true;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    renderingBehavior when preparing or drawing geometry to the screen.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions