godotengine / godot

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

PanoramaSky created using Viewport texture is always rendered pink. #68088

Open RicardRC opened 1 year ago

RicardRC commented 1 year ago

Godot version

master (f013315980ca13f4b66df29b5e32d3ecc310cb84)

System information

Windows 11, Nvidia 1070

Issue description

This test subviewport: image Looks like it's not having any effect once passet as viewport texture, like this: image

Notice that this happens even if I use both PR https://github.com/godotengine/godot/pull/64138 and https://github.com/godotengine/godot/pull/64152

Also, repro project shows no error or warning in any console or output.

Steps to reproduce

Open repro project, run, observe the pink where there should be a procedural sky.

Minimal reproduction project

ViewportBug.zip

Calinou commented 1 year ago

Is the viewport's update mode set to Always?

RicardRC commented 1 year ago

I've tried setting it to all combinations of update and clear mode.

Rindbee commented 1 year ago

If a resource's sub-resources have local_to_scene enabled, that resource also needs to have local_to_scene enabled.

If there is such a resource chain Node-R1-R2-R3(local_to_scene)-R4, it is required that R1, R2, and R3 all need to enable local_to_scene, and R4 does not have to be enabled.

ViewportTexture requires local_to_scene to be enabled, so both its parent resource and its ancestor resources need to enable local_to_scene.

RicardRC commented 1 year ago

Doing as @Rindbee says solved my problem. I think that the editor should complain when something needs a certain "local chain" and does not get one, or one resource is marked as local and it's not having any effect because there is a lack of a link on the locality chain. I know that viewport does ask for "local", but it did not hint at the chain Rindbee mentioned.