mirror of
https://github.com/godotengine/godot
synced 2024-10-02 23:48:45 +00:00
Fix albedo value wraparound in Compatibility render mode
Using the Compatibility renderer results in wrapped albedo values if a custom shader returns albedo values outside the expected range of [0,1]. This commit fixed this issue by clamping the albedo value to [0,1] right after the custom shader is executed. Fixes #91919
This commit is contained in:
parent
be56cab58c
commit
0e56b64fc4
|
@ -1523,6 +1523,9 @@ void main() {
|
||||||
#CODE : FRAGMENT
|
#CODE : FRAGMENT
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Keep albedo values in positive number range as negative values "wraparound" into positive numbers resulting in wrong colors
|
||||||
|
albedo = max(albedo, vec3(0.0));
|
||||||
|
|
||||||
#ifdef LIGHT_VERTEX_USED
|
#ifdef LIGHT_VERTEX_USED
|
||||||
vertex = light_vertex;
|
vertex = light_vertex;
|
||||||
#ifdef USE_MULTIVIEW
|
#ifdef USE_MULTIVIEW
|
||||||
|
|
Loading…
Reference in a new issue