0 votes

I want to write a spatial shader using blend_mul which multiplies the underlying color by values greater than 1. However I've noticed that when I try to write colors with components > 1 to ALBEDO, they get clamped to 1. Is there any way around this? Or are multiplicative shaders limited to only darkening colors. I'm using GLES2.

Godot version 3.5.1
in Engine by (12 points)

check out documentation for render_modeof spatial shaders. There should be something like blend_add or blend_multiply. By default values above 1 should glow.

Right, I'm already using the render_mode blend_mul. The problem I'm seeing is that I can't set the albedo to anything above 1. If I have eg. ALBEDO = vec3(2.0, 2.0, 2.0);, the shader has no effect, while using 0.5 instead works fine.

If I remember correctly blendadd will make colors glow, while blendmul will darken them. Do You expect any other effect to happen when color channel values is greater than one ?

I would expect the colors to be multiplied. So if I use blend_mul with albedo RGB(0.5, 1, 1), then the Red component of all the colors behind the object should be divided by 2 (which is what happens). But if I use albedo (2, 1, 1), I would expect the Red components to be multiplied by 2, but this isn't what happens. So I guess it's limited to 0 - 1? But I don't see why this would be the case, since I thought all the buffers were floating point.

Basically, how would I write a shader that doubles the color values of everything beneath it? (without using SCREEN_TEXTURE)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.