Material gets black interferences

Hi…,

in Godot 4.5 my shader material gets black interferences, when I use more than one light. What is going on? I could increase roughness over 0.4 to prevent this problem, but I need a roughness of 0.0, to get nice reflections. Below is my simple shader code.

Any ideas, how to solve this?

Thanks

Mike

shader_type spatial;
render_mode blend_mix, depth_draw_opaque, cull_back, diffuse_burley, specular_schlick_ggx;

uniform sampler2D texture_albedo : source_color, filter_linear_mipmap, repeat_enable;
uniform sampler2D texture_mixmap : hint_default_white, filter_linear_mipmap, repeat_enable;
uniform sampler2D texture_normal : hint_normal, filter_linear_mipmap, repeat_enable;

uniform float specular : hint_range(0.0, 1.0, 0.01) = 0.5;
uniform float metallic : hint_range(0.0, 1.0, 0.01) = 1.0;

void fragment() {
	// Color
	ALBEDO = texture(texture_albedo, UV).rgb;
	// Ambient Occlusion, red channel
	AO = texture(texture_mixmap, UV).r;
	// Roughness, green channel
	ROUGHNESS = texture(texture_mixmap, UV).g;
	// Metallic, blue channel
	METALLIC = texture(texture_mixmap, UV).b * metallic;
	// Specular
	SPECULAR = specular;
	// Normal Map
	NORMAL_MAP = texture(texture_normal, UV).rgb;
}

Shader is straight forward, have you tried other rendering modes like compatibility? Is there any chance your mixmap values are outside the 0.0 to 1.0 range?

Hi @gertkeno,

I use the Mobile rendering methode, because I want to release on iOS. Switching to Compatibility fixes this problem, but everything looks totally different. :frowning:

Any more ideas?

Thanks

Mike

Does this happen in-game too? Have you tested it on your target platform? It could be a driver issue with your specific machine

To your first answer: I have clamped rgb values from 0.0 to 1.0, no difference.

I have to check on iOS…

Hi @gertkeno,

you are right, on iOS this problem is fixed.

Thank you very much

Mike