Skip to content

Commit

Permalink
Update cOpticalFlow.fx
Browse files Browse the repository at this point in the history
  • Loading branch information
papadanku committed Dec 24, 2023
1 parent 3977ddd commit 6cf0d07
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions shaders/cOpticalFlow.fx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ namespace cOpticalFlow
#define VERTEX_SPACING 10
#endif


#ifndef RENDER_OVER_BUFFER
#define RENDER_OVER_BUFFER 1
#endif

#define LINES_X uint(BUFFER_WIDTH / VERTEX_SPACING)
#define LINES_Y uint(BUFFER_HEIGHT / VERTEX_SPACING)
#define NUM_LINES (LINES_X * LINES_Y)
Expand All @@ -68,7 +73,6 @@ namespace cOpticalFlow

CREATE_SAMPLER(SampleTempTex1, TempTex1_RG8, LINEAR, MIRROR)
CREATE_SAMPLER(SampleTempTex2b, TempTex2b_RG16F, LINEAR, MIRROR)
CREATE_SAMPLER(SampleTempTex0, TempTex0_RGB10A2, LINEAR, CLAMP)

struct VS2PS_Streaming
{
Expand Down Expand Up @@ -218,11 +222,6 @@ namespace cOpticalFlow
return float4(Display, 1.0);
}

float4 PS_Composite(VS2PS_Quad Input) : SV_TARGET0
{
return tex2D(SampleTempTex0, Input.Tex0);
}

#define CREATE_PASS(VERTEX_SHADER, PIXEL_SHADER, RENDER_TARGET) \
pass \
{ \
Expand Down Expand Up @@ -280,19 +279,14 @@ namespace cOpticalFlow
VertexCount = NUM_LINES * 2;
VertexShader = VS_Streaming;
PixelShader = PS_Streaming;
ClearRenderTargets = TRUE;
ClearRenderTargets = bool(1 - RENDER_OVER_BUFFER);
BlendEnable = TRUE;
BlendOp = ADD;
SrcBlend = SRCALPHA;
DestBlend = INVSRCALPHA;
RenderTarget0 = TempTex0_RGB10A2;
}

pass
{
VertexShader = VS_Quad;
PixelShader = PS_Composite;
}

#else
pass
{
Expand Down

0 comments on commit 6cf0d07

Please sign in to comment.