Sure. Simple:
float4 Main(in float4 vpos : SV_POSITION, in float2 texcoord : TEXCOORD) : SV_TARGET
{
const float2 overlay_pos = float2(10, 10); // Position in pixels from top left on the screen.
const float2 overlay_size = float2(200, 200); // Size of the overlay texture in pixels on the screen.
if (vpos.x > overlay_pos.x && vpos.x < (overlay_pos.x + overlay_size.x) &&
vpos.y > overlay_pos.y && vpos.y < (overlay_pos.y + overlay_size.y))
{
return tex2D(overlay_texture, (vpos.xy - overlay_pos) / overlay_size);
}
else
{
return tex2D(ReShade::BackBuffer, texcoord);
}
}
Instead of "vpos", you can also use "texcoord" and do the same in texture coordinate space (between 0 and 1), rather than screen space (between 0 and screen width/height in pixels).