Skip to content

Instantly share code, notes, and snippets.

View shinmai's full-sized avatar
😫
coping admirably

Shi Saaristo shinmai

😫
coping admirably
View GitHub Profile
@shinmai
shinmai / sdfexample.glsl
Created November 13, 2017 21:37 — forked from kchapelier/sdfexample.glsl
hg_sdf + antialiase raymarch by iq + ashima noise
////////////////////////////////////////////////////////////////
//
// HG_SDF
//
// GLSL LIBRARY FOR BUILDING SIGNED DISTANCE BOUNDS
//
// version 2015-12-15 (initial release)
//
// Check http://mercury.sexy/hg_sdf for updates
// and usage examples. Send feedback to [email protected].
//http://iquilezles.org/www/articles/distfunctions/distfunctions.htm
// -- Distant functions
float sdPlane( vec3 p ) {return p.y+0.2;}
float sdSphere( vec3 p, float s ) {return length(p)-s;}
float sdCylinder( vec3 p, vec3 c ){ return length(p.xz-c.xy)-c.z; }
float udRoundBox( vec3 p, vec3 b, float r ){return length(max(abs(p)-b,0.0))-r;}
float udRoundBoxInf( vec3 p, vec2 b, float r ){return length(max(vec3(abs(p.xz)-b,0.0),0.0))-r;}
float maxcomp( vec3 p ) {return max(p.x,max(p.y,p.z));}
@shinmai
shinmai / Curved.shader
Created October 17, 2017 12:58 — forked from grimmdev/Curved.shader
Subway Surfer like Curved World Shader for Unity
Shader "Custom/Curved" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
_QOffset ("Offset", Vector) = (0,0,0,0)
_Dist ("Distance", Float) = 100.0
}
SubShader {
Tags { "RenderType"="Opaque" }
Pass
{