Render cursor on duplicated image

This commit is contained in:
loki
2021-05-06 12:00:39 +02:00
parent 3a0377851d
commit 0232d8027c
6 changed files with 115 additions and 62 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ cbuffer ColorMatrix : register(b0) {
//--------------------------------------------------------------------------------------
// Pixel Shader
//--------------------------------------------------------------------------------------
float2 PS(FragTexWide input) : SV_Target
float2 main_ps(FragTexWide input) : SV_Target
{
float3 rgb_left = image.Sample(def_sampler, input.uuv.xz).rgb;
float3 rgb_right = image.Sample(def_sampler, input.uuv.yz).rgb;
+1 -1
View File
@@ -10,7 +10,7 @@ cbuffer info : register(b0) {
//--------------------------------------------------------------------------------------
// Vertex Shader
//--------------------------------------------------------------------------------------
VertTexPosWide VS(uint vI : SV_VERTEXID)
VertTexPosWide main_vs(uint vI : SV_VERTEXID)
{
float idHigh = float(vI >> 1);
float idLow = float(vI & uint(1));
+1 -7
View File
@@ -1,6 +1,3 @@
//--------------------------------------------------------------------------------------
// YCbCrPS2.hlsl
//--------------------------------------------------------------------------------------
Texture2D image : register(t0);
SamplerState def_sampler : register(s0);
@@ -17,10 +14,7 @@ struct PS_INPUT
float2 tex : TEXCOORD;
};
//--------------------------------------------------------------------------------------
// Pixel Shader
//--------------------------------------------------------------------------------------
float PS(PS_INPUT frag_in) : SV_Target
float main_ps(PS_INPUT frag_in) : SV_Target
{
float3 rgb = image.Sample(def_sampler, frag_in.tex, 0).rgb;
float y = dot(color_vec_y.xyz, rgb) + color_vec_y.w;
+1 -4
View File
@@ -4,10 +4,7 @@ struct PS_INPUT
float2 tex : TEXCOORD;
};
//--------------------------------------------------------------------------------------
// Vertex Shader
//--------------------------------------------------------------------------------------
PS_INPUT VS(uint vI : SV_VERTEXID)
PS_INPUT main_vs(uint vI : SV_VERTEXID)
{
float idHigh = float(vI >> 1);
float idLow = float(vI & uint(1));
+26
View File
@@ -0,0 +1,26 @@
Texture2D image : register(t0);
SamplerState def_sampler : register(s0);
cbuffer ColorMatrix : register(b0) {
float4 color_vec_y;
float4 color_vec_u;
float4 color_vec_v;
};
struct PS_INPUT
{
float4 pos : SV_POSITION;
float2 tex : TEXCOORD;
};
//--------------------------------------------------------------------------------------
// Pixel Shader
//--------------------------------------------------------------------------------------
float4 main_ps(PS_INPUT frag_in) : SV_Target
{
float4 color = image.Sample(def_sampler, frag_in.tex, 0);
clip(color.a < 0.1f ? -1 : 1);
return color;
}