gl_engine: fix gradient color interpretation error

Fix when gradient position is same as some starting or ending point
of a gradient stop, the output color is blank
This commit is contained in:
RuiwenTang 2024-06-04 18:18:48 +08:00 committed by Hermet Park
parent eadf66e178
commit 059c452249

View file

@ -131,7 +131,7 @@ vec4 gradient(float t)
{ \n
float stopi = gradientStop(i); \n
float stopi1 = gradientStop(i + 1); \n
if (t > stopi && t <stopi1) \n
if (t >= stopi && t <= stopi1) \n
{ \n
col = (uGradientInfo.stopColors[i] * (1. - gradientStep(stopi, stopi1, t))); \n
col += (uGradientInfo.stopColors[i + 1] * gradientStep(stopi, stopi1, t)); \n