Additive shading with a texture with black background

Godot Version

4.4

Question

I have a texture with a black background and some coloured galaxy spirals on it. When I put this on a quad and try to shade it using my shader code below I get lots of artifacts and the colours are incorrect, particularly on the darker parts that are approaching black. Hoping someone can tell me where I’m going wrong or a better approach. I’m going for a look where all my textures blend additively in the scene. These are the original images and how it renders. I’ve turned off all compression etc on imports.

https://imgur.com/a/OMD9ZKw

shader_type spatial;

render_mode blend_add, unshaded, cull_disabled;

uniform sampler2D front_texture : source_color;

void fragment() {
  vec4 tex_color = texture(front_texture, UV);

  ALBEDO = tex_color.rgb;
}

Try re-importing the texture with High Quality enabled or change its Compress Mode to Lossless

Thanks mrcdk, I already tried that and it didn’t change anything sadly.

I’ve noticed that if I don’t use unshaded it looks ok, but then of course it’s affected by lighting and I can see the light shining off the background of the texture.

Original image, what you shared is .jpg. Is that the same format, you are using as texture? If so, maybe you could try use .png. JPEG does not have alpha channel, so additive blending could bring artifacts what you are describing.

Also you could try use emission instead of albedo, without additive blending.

shader_type spatial;

render_mode cull_disabled;

uniform sampler2D front_texture : source_color;

void fragment() {
	vec4 tex_color = texture(front_texture, UV);
	EMISSION = tex_color.rgb;
}