Skip to content

Instantly share code, notes, and snippets.

@Donnotron666
Created September 24, 2023 17:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Donnotron666/e6841dbc7742938b1101a7e2544d5a29 to your computer and use it in GitHub Desktop.
Save Donnotron666/e6841dbc7742938b1101a7e2544d5a29 to your computer and use it in GitHub Desktop.
Consume Edge Maps on the GPU
void getSpriteEdges_float(UnityTexture2D edgeMap, UnitySamplerState ss, float2 uv, out float top, out float right, out float left, out float bot) {
//MY COUNTERPART IS EdgeMapUtils.GetEdge
float4 color = edgeMap.Sample(ss, uv);
top = color.r;
right = color.g;
left = color.b;
bot = color.a;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment