Merge pull request #8264 from Pokechu22/d3d11-anaglyph

Fix dubois anaglyph shaders on D3D11
This commit is contained in:
Connor McLaughlin 2019-07-26 20:32:40 +10:00 committed by GitHub
commit 3c8f6bca5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 21 deletions

View File

@ -7,11 +7,14 @@ void main()
{ {
float4 c0 = SampleLayer(0); float4 c0 = SampleLayer(0);
float4 c1 = SampleLayer(1); float4 c1 = SampleLayer(1);
mat3 l = mat3( 1.062,-0.205, 0.299,
-0.026, 0.908, 0.068, float3 lr = float3( 1.062,-0.205, 0.299);
-0.038,-0.173, 0.022); float3 lg = float3(-0.026, 0.908, 0.068);
mat3 r = mat3(-0.016,-0.123,-0.017, float3 lb = float3(-0.038,-0.173, 0.022);
0.006, 0.062, 0.017,
-0.094,-0.185, 0.991); float3 rr = float3(-0.016,-0.123,-0.017);
SetOutput(float4(c0.rgb * l + c1.rgb * r, c0.a)); float3 rg = float3( 0.006, 0.062, 0.017);
float3 rb = float3(-0.094,-0.185, 0.991);
SetOutput(float4(dot(lr, c0.rgb) + dot(rr, c1.rgb), dot(lg, c0.rgb) + dot(rg, c1.rgb), dot(lb, c0.rgb) + dot(rb, c1.rgb), c0.a));
} }

View File

@ -7,11 +7,14 @@ void main()
{ {
float4 c0 = SampleLayer(0); float4 c0 = SampleLayer(0);
float4 c1 = SampleLayer(1); float4 c1 = SampleLayer(1);
mat3 l = mat3(-0.062,-0.158,-0.039,
0.284, 0.668, 0.143, float3 lr = float3(-0.062,-0.158,-0.039);
-0.015,-0.027, 0.021); float3 lg = float3( 0.284, 0.668, 0.143);
mat3 r = mat3( 0.529, 0.705, 0.024, float3 lb = float3(-0.015,-0.027, 0.021);
-0.016,-0.015, 0.065,
0.009, 0.075, 0.937); float3 rr = float3( 0.529, 0.705, 0.024);
SetOutput(float4(c0.rgb * l + c1.rgb * r, c0.a)); float3 rg = float3(-0.016,-0.015, 0.065);
float3 rb = float3( 0.009, 0.075, 0.937);
SetOutput(float4(dot(lr, c0.rgb) + dot(rr, c1.rgb), dot(lg, c0.rgb) + dot(rg, c1.rgb), dot(lb, c0.rgb) + dot(rb, c1.rgb), c0.a));
} }

View File

@ -8,11 +8,14 @@ void main()
{ {
float4 c0 = SampleLayer(0); float4 c0 = SampleLayer(0);
float4 c1 = SampleLayer(1); float4 c1 = SampleLayer(1);
mat3 l = mat3( 0.437, 0.449, 0.164,
-0.062,-0.062,-0.024, float3 lr = float3( 0.437, 0.449, 0.164);
-0.048,-0.050,-0.017); float3 lg = float3(-0.062,-0.062,-0.024);
mat3 r = mat3(-0.011,-0.032,-0.007, float3 lb = float3(-0.048,-0.050,-0.017);
0.377, 0.761, 0.009,
-0.026,-0.093, 1.234); float3 rr = float3(-0.011,-0.032,-0.007);
SetOutput(float4(c0.rgb * l + c1.rgb * r, c0.a)); float3 rg = float3( 0.377, 0.761, 0.009);
float3 rb = float3(-0.026,-0.093, 1.234);
SetOutput(float4(dot(lr, c0.rgb) + dot(rr, c1.rgb), dot(lg, c0.rgb) + dot(rg, c1.rgb), dot(lb, c0.rgb) + dot(rb, c1.rgb), c0.a));
} }