You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
703 B
GLSL
26 lines
703 B
GLSL
uniform vec4 color;
|
|
uniform float glowPower;
|
|
uniform float taperPower;
|
|
|
|
czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
{
|
|
czm_material material = czm_getDefaultMaterial(materialInput);
|
|
|
|
vec2 st = materialInput.st;
|
|
float glow = glowPower / abs(st.t - 0.5) - (glowPower / 0.5);
|
|
|
|
if (taperPower <= 0.99999) {
|
|
glow *= min(1.0, taperPower / (0.5 - st.s * 0.5) - (taperPower / 0.5));
|
|
}
|
|
|
|
vec4 fragColor;
|
|
fragColor.rgb = max(vec3(glow - 1.0 + color.rgb), color.rgb);
|
|
fragColor.a = clamp(0.0, 1.0, glow) * color.a;
|
|
fragColor = czm_gammaCorrect(fragColor);
|
|
|
|
material.emission = fragColor.rgb;
|
|
material.alpha = fragColor.a;
|
|
|
|
return material;
|
|
}
|