WorldEnvironment with two panorama pictures, for background, and reflections?

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

Hi…,

is there a way to have two panorama pictures in WorldEnvironment, one for the background, and one for reflections?

Thanks

Mike

:bust_in_silhouette: Reply From: MikeMikeMike

Hi…,

this seams to work only from Godot 4.0 on with a Sky shader:

shader_type sky;

uniform sampler2D panorama_reflections : filter_linear, source_color, hint_default_black;
uniform sampler2D panorama_background : filter_linear, source_color, hint_default_black;

void sky() {
	if (AT_CUBEMAP_PASS) {
		// reflection
		COLOR = texture(panorama_reflections, SKY_COORDS).rgb;
	}
	else {
		// background
		COLOR = texture(panorama_background, SKY_COORDS).rgb;
	}
}

Thanks

Mike