material-maker/addons/material_maker/nodes/preview_sdf2d.shader
RodZill4 455dcc7fde Started optimizing 2D preview
float parameters don't trigger shader regeneration anymore
2020-03-13 07:50:04 +01:00

10 lines
249 B
GLSL

vec4 preview_2d(vec2 uv) {
$(code)
float d = $(value);
vec3 col = vec3(cos(d*min(256, preview_size)));
col *= clamp(1.0-d*d, 0.0, 1.0);
col *= vec3(1.0, vec2(step(-0.015, d)));
col *= vec3(vec2(step(d, 0.015)), 1.0);
return vec4(col, 1.0);
}