2014-06-07 07:29:21 +02:00
|
|
|
SAMPLER_BINDING(9) uniform sampler2D samp9;
|
2011-01-31 01:08:06 +01:00
|
|
|
|
2013-03-07 19:51:57 +01:00
|
|
|
out vec4 ocol0;
|
|
|
|
in vec2 uv0;
|
|
|
|
|
|
|
|
uniform vec4 resolution;
|
|
|
|
|
|
|
|
void main()
|
2011-01-31 01:08:06 +01:00
|
|
|
{
|
2014-05-21 05:52:32 +02:00
|
|
|
float4 emboss = (texture(samp9, uv0+resolution.zw) - texture(samp9, uv0-resolution.zw))*2.0;
|
|
|
|
emboss -= (texture(samp9, uv0+float2(1,-1)*resolution.zw).rgba - texture(samp9, uv0+float2(-1,1)*resolution.zw).rgba);
|
|
|
|
float4 color = texture(samp9, uv0).rgba;
|
|
|
|
|
|
|
|
if (color.r > 0.8 && color.b + color.b < 0.2)
|
|
|
|
{
|
|
|
|
ocol0 = float4(1,0,0,0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
color += emboss;
|
|
|
|
if (dot(color.rgb, float3(0.3, 0.5, 0.2)) > 0.5)
|
|
|
|
ocol0 = float4(1,1,1,1);
|
|
|
|
else
|
|
|
|
ocol0 = float4(0,0,0,0);
|
|
|
|
}
|
|
|
|
}
|