mirror of https://github.com/adamdruppe/arsd.git
nanovega: more shader fixes for shitel
This commit is contained in:
parent
238eefa2c3
commit
871b27712d
10
nanovega.d
10
nanovega.d
|
@ -12263,14 +12263,14 @@ bool glnvg__renderCreate (void* uptr) nothrow @trusted @nogc {
|
||||||
// Calculate gradient color using box gradient
|
// Calculate gradient color using box gradient
|
||||||
vec2 pt = (paintMat*vec3(fpos, 1.0)).xy;
|
vec2 pt = (paintMat*vec3(fpos, 1.0)).xy;
|
||||||
float d = clamp((sdroundrect(pt, extent, radius)+feather*0.5)/feather, 0.0, 1.0);
|
float d = clamp((sdroundrect(pt, extent, radius)+feather*0.5)/feather, 0.0, 1.0);
|
||||||
if (midp <= 0) {
|
if (midp <= 0.0) {
|
||||||
color = mix(innerCol, outerCol, d);
|
color = mix(innerCol, outerCol, d);
|
||||||
} else {
|
} else {
|
||||||
midp = min(midp, 1.0);
|
float gdst = min(midp, 1.0);
|
||||||
if (d < midp) {
|
if (d < gdst) {
|
||||||
color = mix(innerCol, middleCol, d/midp);
|
color = mix(innerCol, middleCol, d/gdst);
|
||||||
} else {
|
} else {
|
||||||
color = mix(middleCol, outerCol, (d-midp)/midp);
|
color = mix(middleCol, outerCol, (d-gdst)/gdst);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Combine alpha
|
// Combine alpha
|
||||||
|
|
Loading…
Reference in New Issue