godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
88.88k stars 20.15k forks source link

Viewports are messy and displayed wrong #49270

Open nerdnils opened 3 years ago

nerdnils commented 3 years ago

Hi there,

i want to use a viewport to show a label as texture on a plane. But I have some issues with using viewports.

  1. When using a viewport nothing shows up: https://pasteall.org/pic/bbdf47657f364a0b903610284cd0e9a1
  2. Everything seems to work fine when using no viewport but a viewportcontainer only: https://pasteall.org/pic/cd21b28fa64f4e83bb495ec22cea8638 but if this is intended what are viewports even made for?
  3. When using a viewportcontainer and a viewport it only displays parts of what I want to show and it is stretched looks bad and the BIGGER i make the viewport the more clinched and smaller it shows everything as shown here with size 500: https://pasteall.org/pic/8c75cdf7a77b46f8b6fc46bdf6e26858 and size 100(nothing else was changed here, all other values, objects, the whole scene stayed the same): https://pasteall.org/pic/a58efb8e8c3e4d17ab0b48e2c2b00740

How to get my text to display properly and get rid of those issues?

Zireael07 commented 3 years ago

When using a viewport, nothing shows up in editor, but it will show in game. I am using this method in my racer game, successfully.

An alternative is to display Controls by projecting their positions: https://github.com/godotengine/godot-demo-projects/pull/567/commits/54a8d37e6cab62f2173492b6fded9be38f0a2167

Calinou commented 3 years ago

@nerdnils Please upload a minimal reproduction project to make this easier to troubleshoot. Also, which Godot version are you using?

Also, you have to resize the ViewportContainer manually when the Viewport resolution changes. Otherwise, the viewport's contents will appear stretched due to the X resolution being much greater than the Y resolution (despite the display area being square).

nerdnils commented 3 years ago

@nerdnils Please upload a minimal reproduction project to make this easier to troubleshoot. Also, which Godot version are you using?

Also, you have to resize the ViewportContainer manually when the Viewport resolution changes. Otherwise, the viewport's contents will appear stretched due to the X resolution being much greater than the Y resolution (despite the display area being square).

Minimal is just create a 3D-Scene, under that node create a viewport, under the viewport a label. look at the viewport when you wrote some text on the label. I have 3.3.2 stable from archlinux repository.

Calinou commented 3 years ago

Minimal is just create a 3D-Scene, under that node create a viewport, under the viewport a label. look at the viewport when you wrote some text on the label. I have 3.3.2 stable from archlinux repository.

We can't look into troubleshooting this issue if you don't upload the project you reported the issue with. It's very unlikely that the Viewport node is broken, it seems to be a node configuration issue on your end.

PS: For support questions like these, please use other community platforms and only report bugs after you are certain that they are not due to a node configuration issue.

nerdnils commented 3 years ago

If it is on my end only why has Zireael07 the same issue? But here you are: https://easyupload.io/h4a7p9 Was 100% created from scratch with that 3 clicks I described on my last post. Same issues.

Zireael07 commented 3 years ago

I only have point one, and this is not a bug, just a limitation of Godot 3. As for the other points, this is likely something badly configured in your viewport/label sizes - I do not have stretched/cut off text. I set viewport world size to exactly the size the label has.

bend-n commented 1 year ago

These uploads/images dont work.

Calinou commented 1 year ago

If you need to display text in a 3D world, Godot 3.5 and later offer the Label3D node (or MeshInstance + TextMesh).

@nerdnils Can you (or anyone else) still reproduce this bug in Godot 3.5.1 or any later release?

If yes, please ensure that an up-to-date Minimal Reproduction Project (MRP) is included in this report (a MRP is a zipped Godot project with the minimal elements necessary to reliably trigger the bug). You can upload ZIP files in an issue comment with a drag and drop.