leocad/resources/shaders/unlit_view_sphere_ps.glsl

15 lines
487 B
Text
Raw Normal View History

2018-11-23 01:13:02 +01:00
LC_PIXEL_INPUT vec3 PixelNormal;
LC_PIXEL_OUTPUT
uniform mediump vec4 HighlightParams[5];
2018-11-23 01:13:02 +01:00
uniform samplerCube Texture;
void main()
{
LC_SHADER_PRECISION float TexelAlpha = textureCube(Texture, PixelNormal).a;
2019-01-20 05:04:08 +01:00
LC_SHADER_PRECISION float Distance = length(vec3(HighlightParams[0]) - PixelNormal);
LC_SHADER_PRECISION float Highlight = step(Distance, HighlightParams[0].w);
gl_FragColor = mix(mix(HighlightParams[2], HighlightParams[3], Highlight), HighlightParams[1], TexelAlpha);
2018-11-23 01:13:02 +01:00
}