Skip to content

Instantly share code, notes, and snippets.

@forestrf
Created February 1, 2023 00:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save forestrf/efbec409bf66271a4dfadde453fdfce9 to your computer and use it in GitHub Desktop.
Save forestrf/efbec409bf66271a4dfadde453fdfce9 to your computer and use it in GitHub Desktop.
aaStep HLSL
// Smooth equivalent to step(a, b) and both a and b can have their value change.
float aaStepFastBoth(float a, float b) {
return saturate((b - a) / max(fwidth(b), fwidth(a)));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment