Skip to content

Commit

Permalink
[2D] - Added sampler property to displacement effect to smooth out di…
Browse files Browse the repository at this point in the history
…stortions.
  • Loading branch information
Tape-Worm committed Aug 16, 2021
1 parent df81fe3 commit 7adf8b3
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@ public float Strength
_isUpdated = true;
}
}

/// <summary>
/// Property to set or return the sampler state to use when displacing texture data.
/// </summary>
public GorgonSamplerState DisplacementSampler
{
get;
set;
} = GorgonSamplerState.Default;
#endregion

#region Methods.
Expand Down Expand Up @@ -318,7 +327,7 @@ public void Render(GorgonTexture2DView texture, GorgonRenderTarget2DView target)
EndPass(0, _displacementTarget);

BeginPass(1, _workerTarget);
Renderer.DrawFilledRectangle(new DX.RectangleF(0, 0, target.Width, target.Height), GorgonColor.White, target.GetShaderResourceView(), new DX.RectangleF(0, 0, 1, 1));
Renderer.DrawFilledRectangle(new DX.RectangleF(0, 0, target.Width, target.Height), GorgonColor.White, target.GetShaderResourceView(), new DX.RectangleF(0, 0, 1, 1), textureSampler: DisplacementSampler);
EndPass(1, _workerTarget);
EndRender(target);
}
Expand Down

0 comments on commit 7adf8b3

Please sign in to comment.