2013-03-07 11:51:57 -07:00
|
|
|
void main()
|
2009-08-09 15:40:54 -06:00
|
|
|
{
|
2014-07-29 11:08:57 -06:00
|
|
|
float4 emboss = (SampleLocation(GetCoordinates()+GetInvResolution()) - SampleLocation(GetCoordinates()-GetInvResolution()))*2.0;
|
|
|
|
emboss -= (SampleLocation(GetCoordinates()+float2(1,-1)*GetInvResolution()).rgba - SampleLocation(GetCoordinates()+float2(-1,1)*GetInvResolution()).rgba);
|
|
|
|
float4 color = Sample();
|
2014-05-20 21:52:32 -06:00
|
|
|
|
|
|
|
if (color.r > 0.8 && color.b + color.b < 0.2)
|
|
|
|
{
|
2014-07-29 11:08:57 -06:00
|
|
|
SetOutput(float4(1,0,0,0));
|
2014-05-20 21:52:32 -06:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
color += emboss;
|
|
|
|
if (dot(color.rgb, float3(0.3, 0.5, 0.2)) > 0.5)
|
2014-07-29 11:08:57 -06:00
|
|
|
SetOutput(float4(1,1,1,1));
|
2014-05-20 21:52:32 -06:00
|
|
|
else
|
2014-07-29 11:08:57 -06:00
|
|
|
SetOutput(float4(0,0,0,0));
|
2014-05-20 21:52:32 -06:00
|
|
|
}
|
|
|
|
}
|