Repository: godot
Issue: Degraded quality of rendered content in Viewport in another Viewport
Labels: enhancement,discussion,topic:rendering,confirmed,topic:2d

**Godot version:**
3.0 and 3.1 alpha2


**OS/device including version:**
Arch Linux, GPU: NVIDIA GTX 770 (415.18.04)
Android, Xiaomi Redmi Note 4


**Issue description:**
I wrote small script that adapts game UI to match screen DPI:
`get_tree().set_screen_stretch(1, 4, new_size)`
And everything looks crispy clear. But, when I add new Viewport to the Scene, the content rendered in this Viewport looks very bad.

![2d_stretch_mode](https://user-images.githubusercontent.com/34661843/49623133-aa439300-f9cc-11e8-8ab3-89a2ce3af636.png)


I've tried multiple things :
- enabling/disabling Use Pixel Snap
- setting size of the Viewport to match root's size
- setting size_override of the Viewport to match root's size_override
- setting size and size_override of the Viewport to match root's size and size_override
- removing `set_screen_stretch`, setting the Viewport size and size_override to the same values as root would have if `set_screen_stretch` was called, and changing stretch mode and stretch aspect in Project Settings to multiple different values
- using TextureRect or ViewportContainer to render the Viewport
- enabling/disabling Snap Controls To Pixels

In every case something was wrong: blurry or pixelated font, wrong sizes of all UI elements...

So I commented all my code to be sure that this isn't related to some bug in my code. And then, at first everything was looking good. But as it turns out, content rendered in the Viewport looks a little bit different (blurred?) than outside of the Viewport. The difference is very subtle and hard to notice. Look at the TEST and circle. Open image in new tab for bigger version - easier to notice the issue.

![Open me in a new tab](https://user-images.githubusercontent.com/34661843/49623129-9f88fe00-f9cc-11e8-8c75-7a03c2726915.gif)

Is there some magical combination of settings to fix my issue? I was "debugging" my issue for over a week, and I haven't found any possible combination to fix it.

**Steps to reproduce:**
1. Add ViewportContainer to the Scene
2. Add Viewport to the ViewportContainer
3. Add Label with some text to the Viewport
4. Duplicate the Label and add it as a sibling of ViewportContainer (and move somewhere else, so it won't overlap content from Viewport)
5. Notice the very, very subtle differences between Labels.

**Minimal reproduction project:**
<!-- Recommended as it greatly speeds up debugging. Drag and drop a zip archive to upload it. -->
Running this project will result in the same looking image as in first picture. If you want to see the result of second image, comment `get_tree().set_screen_stretch(1, 4, window)` in dpi.gd file.
[Project for Godot 3.1 alpha2](https://github.com/godotengine/godot/files/2655616/dpi.zip)
PS. This project uses wrong DPI values in script on purpose, so the problem will be more noticeable on PC.
PS2. I'm not sure if this will be helpful, but I need to resize the window at startup, to fix the "blocky" text outside of the Viewport. I'm not sure if this is related the issue.