Skip to content

Instantly share code, notes, and snippets.

Shader "Pristine Grid"
{
Properties
{
[KeywordEnum(MeshUV, WorldX, WorldY, WorldZ)] _UVMode ("UV Mode", Float) = 2.0
_GridScale ("Grid Scale", Float) = 1.0
_LineWidthX ("Line Width X", Range(0,1.0)) = 0.01
_LineWidthY ("Line Width Y", Range(0,1.0)) = 0.01
@slembcke
slembcke / NearlyNearestNeighborFiltering.glsl
Last active December 27, 2020 21:19
Anti-aliased Nearest Neighbor Filtering.
uniform sampler2D texture;
varying vec2 uv;
void main(){
vec2 size = textureSize(texture);
vec2 puv = uv*size;
vec2 hfw = 0.5*fwidth(puv);
vec2 fl = floor(puv - 0.5) + 0.5;