Seam in skybox after converting project to Godot 4

Godot Version

Godot 4.2.1

Question

After converting a Godot 3.5 project to Godot 4.2.1, the skybox has a seam. I’ve been through all the import options and nothing seems to help. Any ideas?

Ok I figured out what is going on here, somewhat, maybe.

The Godot 3.5 project imported this asset with filtering seat to nearest-neighbor.

I read up a bit and I see that in 4.0 this is no longer an import option. The filtering is in the material. Makes sense. For a normal material I can just change the filtering method.

But this material uses a shader. I’m not very familiar with Godot but I found a couple of references to this issue. So I tried adding “filter_nearest” to the texture_albedo uniform sampler2d in the shader code below. Unfortunately, I don’t see the pixelation of the sky texture that I expected. Is this line correct? Any other thoughts?

uniform sampler2D texture_albedo : source_color, filter_nearest;

Here is the original shader:

shader_type spatial;
render_mode blend_mix,depth_draw_opaque,cull_front,diffuse_burley,specular_schlick_ggx,ambient_light_disabled;
uniform vec4 albedo : source_color;
uniform sampler2D texture_albedo : source_color;
uniform float specular;
uniform float metallic;
uniform float roughness : hint_range(0,1);
uniform float point_size : hint_range(0,128);
uniform sampler2D texture_metallic : hint_default_white;
uniform vec4 metallic_texture_channel;
uniform sampler2D texture_roughness : hint_default_white;
uniform vec4 roughness_texture_channel;
uniform vec3 uv1_scale;
uniform vec3 uv1_offset;
uniform vec3 uv2_scale;
uniform vec3 uv2_offset;


void vertex() {
	UV=UV*uv1_scale.xy+uv1_offset.xy;
}




void fragment() {
	vec2 base_uv = UV;
	vec4 albedo_tex = texture(texture_albedo,base_uv);
	ALBEDO = albedo.rgb * albedo_tex.rgb;
	float metallic_tex = dot(texture(texture_metallic,base_uv),metallic_texture_channel);
	METALLIC = metallic_tex * metallic;
	float roughness_tex = dot(texture(texture_roughness,base_uv),roughness_texture_channel);
	ROUGHNESS = roughness_tex * roughness;
	SPECULAR = specular;
	ALPHA = albedo.a * UV[1];
}

Ok, it turned out that setting the Compression mode to VRAM Uncompressed got me the results I needed. The nearest_filter option that I used in the shader was actually working, it was just hard to see. And now that I’ve changed these settings the seam has gone away.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.