SubViewport texture look brighter than what the camera should show

Godot Version

v4.5.dev

Question

Hello :slightly_smiling_face: ,

I am currently working on some sort of portal for my 3D game, the idea is to have a door that will open when the player is close enough and act as a portal, the player can enter the door and should seemlessly be teleported on the other side like in the Portal games.

However, the render of my “portal” does not exactly look like what the camera would show on the other side : the color are a little too bright or are washed out :

To create this portal effect I am using a BoxMesh on which I added this shader :

shader_type spatial;
render_mode unshaded;

uniform sampler2D viewport_texture : source_color;
void fragment() {

	vec4 tex = texture(viewport_texture, SCREEN_UV);

	ALBEDO = tex.rgb;
}

Then for the “viewport_texture” I’m adding the SubViewport that is on this portal scene, it has a Camera3D as a child that is moved toward the exit portal paired with this one.

I tried to fiddle around the differents SubViewport parameters but I didn’t find anything that would make it look the same.

Finally, I also tried to tweak the sky parameters, most specificaly everything related to emission or energy multiplier, but I would still not find a solution.

The same issue can be seen in my debug room where the sky is almost the one by default for the engine :

When checking online the thing that seems to work for most peoples is putting the “source_color” flag on the sampler2d of the shader, but it didn’t work out for me.

If anyone know anything about this it would be of huge help :grinning_face_with_smiling_eyes: .