Hi all,
I have a grid shader using frac for each line drawing like that :
float StepDistance = LineWidth / StepDistance;
if( frac( PosWSCenter.x / GridParams.x ) <= StepDistance )
{
return LineColor;
} I do an alpha based on the distance of the line to smooth transition of each line :
float Alpha = smoothstep( 1.0f, 0.75f, abs( 2.0f * ( LineFrac / StepDistance ) - 1.0f ) ); All works fine but one important problem is there : aliasing.That causes moire effect.
I read ddx and ddy could be used to remove aliasing but I don't know how does that.
How change this little stuff to be anti-aliased using ddx/ddy or something else ?
Thanks for the help