Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blend_mul can no longer make an image brighter #66978

Open
rainlizard opened this issue Oct 6, 2022 · 2 comments
Open

blend_mul can no longer make an image brighter #66978

rainlizard opened this issue Oct 6, 2022 · 2 comments

Comments

@rainlizard
Copy link
Contributor

rainlizard commented Oct 6, 2022

Godot version

v4.0.beta2.official [f8745f2]

System information

Windows 10, default, GTX 970

Issue description

blend_mul can no longer make an image brighter, and negative alpha values no longer work (I think it functioned like blend_mul).

3 5
4 0

Steps to reproduce

shader_type canvas_item;
render_mode blend_mul;

void fragment() {
	vec4 baseCol = texture(TEXTURE, UV);
	baseCol.r *= 5.0;
	baseCol.g *= 5.0;
	baseCol.b *= 5.0;
	baseCol.a *= 1.0;
	COLOR = baseCol;
}

Minimal reproduction project

blend_mul 3.5.zip
blend_mul 4.0.zip

@Calinou
Copy link
Member

Calinou commented Oct 6, 2022

This likely happens because in 4.0, vertex color in 2D and 3D is limited to 8 bpc and can no longer be "overbright". You can notice this if you set Modulate to Color(2, 2, 2) for instance (using Raw mode on the color picker).

I think this should be made possible again, but it may have to be an opt-in project setting for performance reasons.

@rainlizard
Copy link
Contributor Author

I'm having an absolute impossible time recreating some layered effects from 3.5 without this. blend_add is no substitute, it looks ghastly. I managed to recreate blend_mul using SCREEN_TEXTURE and SCREEN_UV but ran into limitations of SCREEN_TEXTURE not working when used multiple times.

I hope there's desire from others for this feature, I tried compiling Godot myself but it took over 30 minutes to compile and have no idea where to even look to change something like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants