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.
19 lines
555 B
GLSL
19 lines
555 B
GLSL
uniform vec4 lightColor;
|
|
uniform vec4 darkColor;
|
|
uniform vec2 repeat;
|
|
|
|
czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
{
|
|
czm_material material = czm_getDefaultMaterial(materialInput);
|
|
|
|
// From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights
|
|
float b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5)); // 0.0 or 1.0
|
|
|
|
vec4 color = mix(lightColor, darkColor, b);
|
|
color = czm_gammaCorrect(color);
|
|
material.diffuse = color.rgb;
|
|
material.alpha = color.a;
|
|
|
|
return material;
|
|
}
|