Shader albedo clamped to [0, 1]?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By chroma_zone

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.

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.

Inces | 2023-01-26 16:53

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.

chroma_zone | 2023-01-26 19:37

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

Inces | 2023-01-26 21:39

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.

chroma_zone | 2023-01-26 21:53

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

chroma_zone | 2023-01-26 21:56