Why does my Viewport Texture look washed out?

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

I’m using a ViewportTexture to render a UI scene to a Mesh’s texture. This works fine, however, the colors on the Mesh look washed out, while everything looks as expected in the UI scene. Doing some searches, I’ve tried changing SRGB/Linear settings and HDR on both the Viewport and the ViewportTexture, but nothing has worked. I’ve encountered this problem with a few other Godot Nodes, particularly Sprite3D, but I’ve never managed to solve it.

If it’s relevant, the material on the Mesh is using a local ViewportTexture for its albedo texture.

:bust_in_silhouette: Reply From: yrtv

From https://docs.godotengine.org/pt_BR/latest/tutorials/misc/gles2_gles3_differences.html

In GLES2, SCREEN_TEXTURE (accessed via a ShaderMaterial) does not have
computed mip-maps. So when accessing at a different LOD, the texture
will not appear blurry.

If renderer is GLES2 try GLES3

You may want to study GUI in 3D Demo - Godot Asset Library

I am using GLES3, but from the example project linked, I was able to find out that my problem was that I didn’t have albedo_tex_force_srgb enabled in the flags for the SpatialMaterial my mesh was using. Enabling this flag fixed the issue.

Thank you!

XanthiFrais | 2021-02-05 22:57