Hey Godot Engine users, I'm fairly new to 3D rendering, esp in this engine, and I am looking for help with something. Do NOT answer if you are not familiar with Godot, this is a GODOT-SPECIFIC question.
Brief summary: I am looking to render the game at one resolution, then with a custom shader scale it to the window resolution.
More detailed description:
I would like to render my game at a low internal resolution, even if the window is a higher resolution than that. Naturally, this means that there will need to be upscaling.
Godot provides the Viewport scaling mode which uses a nearest-neighbor upscale method. This is close to what I want, but not quite.
I have a nearest-neighbor fragment shader that provides additional blending on pixel borders when at non-integer scaling factors. The question I am encountering is - how do I apply this?
If I want to have a low internal resolution, it seems that I need to make use of the Viewport scaling mode. However, the upscaling to window size is performed automatically by the engine in this case. I cannot render anything at window resolution within the default Godot-provided Viewport, only at target resolution.
As such, the only solution I can think of is a secondary Viewport. Have Godot use the None scaling mode so the primary Viewport is at window resolution, then create a secondary Viewport which is at the lower target resolution. I would need to have the entire game render to that secondary, smaller Viewport, then using a ColorRect with a ShaderMaterial under the primary Viewport apply my shader to upscale it to window size.
However... this seems messy. I would need to somehow ensure that every single level is under this secondary Viewport, and every single level has that ColorRect under the primary Viewport. This is very undesirable boilerplate. Is there a way to customize the "default tree" that Godot uses, that everything loads into? Or is there a better way to do this that I am not aware of?
Perhaps I should write a GDNative extension or something of the sort that adds a scaling mode to do what I want?
Y'all I'm stumped.
