Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float4 mainImage(VertData v_in) : TARGET
- {
- float4 base = image.Sample(textureSampler, v_in.uv);
- float4 K = float4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
- float4 p = lerp(float4(base.bg, K.wz), float4(base.gb, K.xy), step(base.b, base.g));
- float4 q = lerp(float4(p.xyw, base.r), float4(base.r, p.yzx), step(p.x, base.r));
- float d = q.x - min(q.w, q.y);
- float e = 1.0e-10;
- float3 hsv = float3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
- hsv[0] += 0.5;
- float4 N = float4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
- float3 f = abs(frac(hsv.xxx + N.xyz) * 6.0 - N.www);
- float3 rgb = hsv.z * lerp(N.xxx, clamp(f - N.xxx, 0.0, 1.0), hsv.y);
- base.rgb = rgb;
- return base;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement