Skip to content

Commit b4d0522

Browse files
Mee-guminggo
authored andcommitted
shader value validation (#20086)
1 parent a9a3223 commit b4d0522

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/cpp-tests/Resources/Shaders/example_Flower.fsh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ void main(void)
2525
float h = 0.5+0.5*cos(12.0*a-w*7.0+r*8.0);
2626
float d = 0.25+0.75*pow(h,1.0*r)*(0.7+0.3*w);
2727

28-
float col = u( d-r ) * sqrt(1.0-r/d)*r*2.5;
28+
float rd = 1.0-r/d;
29+
float col = 0.0;
30+
if(rd > 0.0)
31+
col = u( d-r ) * sqrt(rd)*r*2.5;
2932
col *= 1.25+0.25*cos((12.0*a-w*7.0+r*8.0)/2.0);
3033
col *= 1.0 - 0.35*(0.5+0.5*sin(r*30.0))*(0.5+0.5*cos(12.0*a-w*7.0+r*8.0));
3134
gl_FragColor = vec4(

0 commit comments

Comments
 (0)