use high on painting shaders
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
mediump float blend_stroke_screen(mediump float base, mediump float stroke)
|
||||
highp float blend_stroke_screen(highp float base, highp float stroke)
|
||||
{
|
||||
return base + stroke - (base * stroke);
|
||||
}
|
||||
|
||||
mediump float blend_stroke_hard_light(mediump float base, mediump float stroke)
|
||||
mediump float blend_stroke_hard_light(highp float base, highp float stroke)
|
||||
{
|
||||
if (stroke < 0.5)
|
||||
return base * (stroke * 2.0); // multiply
|
||||
@@ -11,12 +11,12 @@ mediump float blend_stroke_hard_light(mediump float base, mediump float stroke)
|
||||
return blend_stroke_screen(base, 2.0 * stroke - 1.0);
|
||||
}
|
||||
|
||||
mediump float blend_stroke_hard_mix(mediump float base, mediump float stroke)
|
||||
highp float blend_stroke_hard_mix(highp float base, highp float stroke)
|
||||
{
|
||||
return base + stroke < 0.5 ? 0.0 : base + stroke;
|
||||
}
|
||||
|
||||
mediump float blend_stroke_color_dodge(mediump float base, mediump float stroke)
|
||||
highp float blend_stroke_color_dodge(highp float base, highp float stroke)
|
||||
{
|
||||
if (base == 0.0)
|
||||
return 0.0;
|
||||
@@ -26,7 +26,7 @@ mediump float blend_stroke_color_dodge(mediump float base, mediump float stroke)
|
||||
return base / (1.0 - stroke);
|
||||
}
|
||||
|
||||
mediump float blend_stroke_color_burn(mediump float base, mediump float stroke)
|
||||
highp float blend_stroke_color_burn(highp float base, highp float stroke)
|
||||
{
|
||||
if (base == 1.0)
|
||||
return 1.0;
|
||||
@@ -36,20 +36,20 @@ mediump float blend_stroke_color_burn(mediump float base, mediump float stroke)
|
||||
return 1.0 - min(1.0, (1.0 - base) / stroke);
|
||||
}
|
||||
|
||||
mediump float blend_stroke_linear_height(mediump float base, mediump float stroke, mediump float depth)
|
||||
highp float blend_stroke_linear_height(highp float base, highp float stroke, highp float depth)
|
||||
{
|
||||
mediump float partial = (1.0 - stroke) * pow(depth, 0.25) + (base * depth * 10.0);
|
||||
highp float partial = (1.0 - stroke) * pow(depth, 0.25) + (base * depth * 10.0);
|
||||
return base * partial;
|
||||
}
|
||||
|
||||
mediump float blend_stroke_height(mediump float base, mediump float stroke, mediump float depth)
|
||||
highp float blend_stroke_height(highp float base, highp float stroke, highp float depth)
|
||||
{
|
||||
mediump float A = pow((1.0 - stroke), max(1.0, (1.0 - depth) * 10.0)) * pow(depth, 0.25);
|
||||
mediump float B = (base * depth * 5.0);
|
||||
highp float A = pow((1.0 - stroke), max(1.0, (1.0 - depth) * 10.0)) * pow(depth, 0.25);
|
||||
highp float B = (base * depth * 5.0);
|
||||
return base * (A + B);
|
||||
}
|
||||
|
||||
mediump float blend_stroke(mediump float base, mediump float stroke, mediump float depth, int mode)
|
||||
highp float blend_stroke(highp float base, highp float stroke, highp float depth, int mode)
|
||||
{
|
||||
if (mode == 0) /* normal */ return mix(base, stroke, depth);
|
||||
else if (mode == 1) /* multiply */ return mix(base, base * stroke, depth);
|
||||
|
||||
Reference in New Issue
Block a user