Add existing to tracked
This commit is contained in:
Generated
Vendored
+29
@@ -0,0 +1,29 @@
|
||||
uniform vec4 color;
|
||||
uniform vec4 outlineColor;
|
||||
uniform float outlineWidth;
|
||||
|
||||
in float v_width;
|
||||
|
||||
czm_material czm_getMaterial(czm_materialInput materialInput)
|
||||
{
|
||||
czm_material material = czm_getDefaultMaterial(materialInput);
|
||||
|
||||
vec2 st = materialInput.st;
|
||||
float halfInteriorWidth = 0.5 * (v_width - outlineWidth) / v_width;
|
||||
float b = step(0.5 - halfInteriorWidth, st.t);
|
||||
b *= 1.0 - step(0.5 + halfInteriorWidth, st.t);
|
||||
|
||||
// Find the distance from the closest separator (region between two colors)
|
||||
float d1 = abs(st.t - (0.5 - halfInteriorWidth));
|
||||
float d2 = abs(st.t - (0.5 + halfInteriorWidth));
|
||||
float dist = min(d1, d2);
|
||||
|
||||
vec4 currentColor = mix(outlineColor, color, b);
|
||||
vec4 outColor = czm_antialias(outlineColor, color, currentColor, dist);
|
||||
outColor = czm_gammaCorrect(outColor);
|
||||
|
||||
material.diffuse = outColor.rgb;
|
||||
material.alpha = outColor.a;
|
||||
|
||||
return material;
|
||||
}
|
||||
Reference in New Issue
Block a user