For a 3d game rendered at low resolution, how would you make a Subpixel Camera?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By jscul

For reference, this is the effect I’m trying to create.

Here’s the minimal working GitHub repository to replicate the problem.

The reason this doesn’t work in my game right now is the camera moves with the player. Meaning that (due to 3d physics and the fact the player occupies space between pixels) I need to translate the camera to a place where all 3d objects (sprites) will render the same without jitter. I’m getting close but I’m not quite there.

Here are the camera settings.

Here’s my proposed solution:

  1. Attach Camera to the Player (which moves in subpixel 3d space).
  2. Create a script for all movable objects and the camera to “snap pixel” offset the sprite/camera relative to the parent given the global transform of the parent. Static objects don’t need this because they’ll be adjusted via adjusting the camera.
  3. Render w/ size 360x240.

The code formatting is bad in Godot. But the relevant script can be found here.

I’m extremely close with this solution, but there’s still jitter on static non-moving 3d objects in my scene. I’m wondering if there’s a better way to do this or if I’m fighting an unwinnable battle. It seems like if you can do it in Unity, you should be able to do it in Godot too.

Did you ever get an answer for this? I am also trying to recreate t3ssel8r’s pixel engine in Godot.

creardon19 | 2021-06-29 00:23