Skip to content

Instantly share code, notes, and snippets.

@forestrf
Created February 1, 2023 00:14
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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