I was working on a basic water caustic shader that I wanted to apply as sort of an overlay on top of other geometry under the water, and for it I wanted to use blend_mul to brighten up the parts of the surface the caustics are effecting, and since I'm using the same device from issue https://github.com/godotengine/godot/issues/43891 I also wanted to use the gl_compatibility renderer since it would provide the best performance for me. But my shader doesn't seem to work correctly in the compatibility renderer, only in mobile and forward+. In those two it looks as expected, but in gl_compatibility it looks completely white.
Example of the shader in forward+/mobile:
Example of the shader in gl_compatibility:
Not only that, but setting ALPHA in the shader effects the outcome as well which I wouldn't really expect for multiply blending. If I set the ALPHA to basically any value the effect just doesn't work, as you can see here
Godot version
4.0 beta 17
System information
Windows 10, gl_compatibility, Intel UHD 600
Issue description
I was working on a basic water caustic shader that I wanted to apply as sort of an overlay on top of other geometry under the water, and for it I wanted to use
blend_mul
to brighten up the parts of the surface the caustics are effecting, and since I'm using the same device from issue https://github.com/godotengine/godot/issues/43891 I also wanted to use thegl_compatibility
renderer since it would provide the best performance for me. But my shader doesn't seem to work correctly in the compatibility renderer, only in mobile and forward+. In those two it looks as expected, but in gl_compatibility it looks completely white.Example of the shader in forward+/mobile:
Example of the shader in gl_compatibility:
Not only that, but setting ALPHA in the shader effects the outcome as well which I wouldn't really expect for multiply blending. If I set the ALPHA to basically any value the effect just doesn't work, as you can see here
Here is the shader code itself
FWIW I think this might have something to do with the difference between 3.x and 4.0 fragment representation as discussed in #66978 but I'm not sure
Steps to reproduce
testing.tscn
Minimal reproduction project
blendmul_073824.zip