Mixing 2D + 3D: pixel ratio / scanline effect looks wrong with 3D renderer (Godot 4.x)

Hi everyone, I’m mixing 2D sprites/UI with a 3D scene in Godot [4.x]. I switched the project to a 3D renderer because I need both 2D + 3D, but my pixel/scanline style looks inconsistent (scanlines scale weirdly and pixel ratio doesn’t match the viewport).

Setup

  • Godot: [4.x.x]

  • Rendering method: [Forward+ / Mobile / Compatibility]

  • Window size: [e.g., 1280x720], stretch: [mode/aspect]

  • 2D is drawn via: [CanvasLayer / Node2D / SubViewportTexture]

  • 3D camera: [FOV / resolution]

Problem

  • Expected: scanlines/pixel grid stays stable regardless of resolution

  • Actual: scanlines/pixels shift or scale differently when resizing / changing resolution

What I tried

  • Changing Project Settings → Display → Window → Stretch

  • Changing viewport scaling mode

  • Using a SubViewport for the 2D layer

What’s the recommended approach to keep a consistent pixel/scanline look when mixing 2D + 3D in Godot 4? Any best-practice setup is appreciated.