Skip to content

Instantly share code, notes, and snippets.

@pmark
Last active December 30, 2020 14:45
Show Gist options
  • Save pmark/80133734b732a0d92ad4dbece4611da3 to your computer and use it in GitHub Desktop.
Save pmark/80133734b732a0d92ad4dbece4611da3 to your computer and use it in GitHub Desktop.
Surface shader modifier: grid effect
float u = _surface.diffuseTexcoord.x;
float v = _surface.diffuseTexcoord.y;
int u100 = int(u * 100.0);
int v100 = int(v * 100.0);
if (u100 % 2 == 1 || v100 % 2 == 1) {
// do nothing
} else {
discard_fragment();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment