adding gallery

pull/65/head
Patricio Gonzalez Vivo 8 years ago
parent 1b8736ac6f
commit abfa452c0d

@ -1,4 +1,5 @@
// Author @patriciogv - 2015
// Author: Stefan Gustavson
// Title: Cellular noise ("Worley noise")
#ifdef GL_ES
precision mediump float;
@ -24,9 +25,9 @@ vec4 permute(vec4 x) {
// If you need a smooth F2, use the slower 3x3 version.
// F1 is sometimes wrong, too, but OK for most purposes.
vec2 cellular2x2(vec2 P) {
#define K 0.142857142857 // 1/7
#define K2 0.0714285714285 // K/2
#define jitter 0.8 // jitter 1.0 makes F1 wrong more often
#define K 0.142857142857 // 1/7
#define K2 0.0714285714285 // K/2
#define jitter 0.8 // jitter 1.0 makes F1 wrong more often
vec2 Pi = mod(floor(P), 289.0);
vec2 Pf = fract(P);
vec4 Pfx = Pf.x + vec4(-0.5, -1.5, -0.5, -1.5);
@ -58,7 +59,7 @@ vec2 cellular2x2(vec2 P) {
void main(void) {
vec2 st = gl_FragCoord.xy/u_resolution.xy;
vec2 F = cellular2x2(st*20.);
vec2 F = cellular2x2(st*20.+vec2(u_time,0.));
float n = 1.0-1.5*F.x;
gl_FragColor = vec4(n, n, n, 1.0);

@ -1,3 +1,6 @@
// Author: Stefan Gustavson
// Title: Cellular noise ("Worley noise")
#ifdef GL_ES
precision mediump float;
#endif
@ -24,12 +27,12 @@ vec3 permute(vec3 x) {
// F2 is often wrong and has sharp discontinuities.
// If you need a good F2, use the slower 3x3x3 version.
vec2 cellular2x2x2(vec3 P) {
#define K 0.142857142857 // 1/7
#define Ko 0.428571428571 // 1/2-K/2
#define K2 0.020408163265306 // 1/(7*7)
#define Kz 0.166666666667 // 1/6
#define Kzo 0.416666666667 // 1/2-1/6*2
#define jitter 0.8 // smaller jitter gives less errors in F2
#define K 0.142857142857 // 1/7
#define Ko 0.428571428571 // 1/2-K/2
#define K2 0.020408163265306 // 1/(7*7)
#define Kz 0.166666666667 // 1/6
#define Kzo 0.416666666667 // 1/2-1/6*2
#define jitter 0.8 // smaller jitter gives less errors in F2
vec3 Pi = mod(floor(P), 289.0);
vec3 Pf = fract(P);
vec4 Pfx = Pf.x + vec4(0.0, -1.0, 0.0, -1.0);

@ -1,4 +1,5 @@
// Author @patriciogv - 2015
// Author: Stefan Gustavson
// Title: Classic 2D cellular noise
#ifdef GL_ES
precision mediump float;
@ -15,9 +16,9 @@ vec3 permute(vec3 x) {
// Cellular noise, returning F1 and F2 in a vec2.
// Standard 3x3 search window for good F1 and F2 values
vec2 cellular(vec2 P) {
#define K 0.142857142857 // 1/7
#define Ko 0.428571428571 // 3/7
#define jitter 1.0 // Less gives more regular pattern
#define K 0.142857142857 // 1/7
#define Ko 0.428571428571 // 3/7
#define jitter 1.0 // Less gives more regular pattern
vec2 Pi = mod(floor(P), 289.0);
vec2 Pf = fract(P);
vec3 oi = vec3(-1.0, 0.0, 1.0);
@ -58,7 +59,7 @@ vec2 cellular(vec2 P) {
void main(void) {
vec2 st = gl_FragCoord.xy/u_resolution.xy;
st *= 10.;
vec2 F = cellular(st);
vec2 F = cellular(st+vec2(u_time,0.));
float facets = 0.1+(F.y-F.x);
float dots = smoothstep(0.05, 0.1, F.x);
float n = facets * dots;

@ -1,5 +1,5 @@
// Author @patriciogv - 2015
// http://patriciogonzalezvivo.com
// Author: Stefan Gustavson
// Title: Classic 3D cellular noise
#ifdef GL_ES
precision mediump float;
@ -27,12 +27,12 @@ vec3 permute(vec3 x) {
// implementation of Worley noise hands down.
vec2 cellular(vec3 P) {
#define K 0.142857142857 // 1/7
#define Ko 0.428571428571 // 1/2-K/2
#define K2 0.020408163265306 // 1/(7*7)
#define Kz 0.166666666667 // 1/6
#define Kzo 0.416666666667 // 1/2-1/6*2
#define jitter 1.0 // smaller jitter gives more regular pattern
#define K 0.142857142857 // 1/7
#define Ko 0.428571428571 // 1/2-K/2
#define K2 0.020408163265306 // 1/(7*7)
#define Kz 0.166666666667 // 1/6
#define Kzo 0.416666666667 // 1/2-1/6*2
#define jitter 1.0 // smaller jitter gives more regular pattern
vec3 Pi = mod(floor(P), 289.0);
vec3 Pf = fract(P) - 0.5;
@ -188,6 +188,9 @@ void main(void) {
st *= 10.;
vec2 F = cellular(vec3(st,u_time));
float dots = smoothstep(0.05, 0.1, F.x);
float n = F.y-F.x;
n *= dots;
gl_FragColor = vec4(n, n, n, 1.0);
}

@ -273,3 +273,88 @@ code {
.ge_colorpicker_link-button {
color: #333;
}
/* GALLERY */
@charset 'utf-8';
.glslGallery{
-moz-column-width: initial;
-webkit-column-width: initial;
}
.glslGallery_item{
width: 242px;
margin: 8px;
}
.glslGallery_thumb{
max-width: 240px;
border: solid 1px #EEEEEE;
}
.glslGallery_item canvas.glslGallery_canvas{
max-width: 242px;
}
.glslGallery_credits{
position: relative;
left: 0;
bottom: 0;
background: none;
margin: 0;
padding: 0;
}
.glslGallery_label{
color: #333333;
font-family:Helvetica,Arial,sans-serif;
text-decoration:none;
width: 200px;
}
.glslGallery_title{
margin: 0px;
padding-top: 14px;
font-size:12px;
width: 200px;
}
.glslGallery_author{
margin: 0px;
padding-top: 14px;
padding-bottom: 4px;
font-size:12px;
}
.glslGallery_openFrameIcon{
bottom: 0px;
right: 0px;
font-size:14px;
}
.more {
text-align: center;
margin-top: 32px;
margin-bottom: 32px;
}
.more a {
font-size: 14px;
letter-spacing: 0.1em;
font-family:Helvetica,Arial,sans-serif;
font-weight: 600;
border-radius: 2px;
padding: 8px;
border: solid 1px #AAAAAA;
text-transform: uppercase;
}
.more a:hover {
background: #EEEEEE;
}
.gallery_author {
font-size: 16px;
font-style: italic;
text-align: right;
}

@ -1,81 +0,0 @@
@charset 'utf-8';
.glslGallery{
-moz-column-width: initial;
-webkit-column-width: initial;
}
.glslGallery_item{
width: 242px;
margin: 8px;
}
.glslGallery_thumb{
max-width: 240px;
border: solid 1px #EEEEEE;
}
.glslGallery_item canvas.glslGallery_canvas{
max-width: 242px;
}
.glslGallery_credits{
position: relative;
left: 0;
bottom: 0;
background: none;
margin: 0;
padding: 0;
}
.glslGallery_label{
color: #333333;
font-family:Helvetica,Arial,sans-serif;
text-decoration:none;
width: 200px;
}
.glslGallery_title{
margin: 0px;
padding-top: 14px;
font-size:12px;
width: 200px;
}
.glslGallery_author{
margin: 0px;
padding-top: 14px;
padding-bottom: 4px;
font-size:12px;
}
.glslGallery_openFrameIcon{
bottom: 0px;
right: 0px;
font-size:14px;
}
.more {
text-align: center;
margin-top: 32px;
margin-bottom: 32px;
}
.more a {
font-size: 14px;
letter-spacing: 0.1em;
font-family:Helvetica,Arial,sans-serif;
font-weight: 600;
border-radius: 2px;
padding: 8px;
border: solid 1px #AAAAAA;
text-transform: uppercase;
}
.more a:hover {
background: #EEEEEE;
}
.gallery_author {
font-size: 16px;
font-style: italic;
text-align: right;
}

@ -13,7 +13,6 @@
include('../header.php');
include('../chap-header.php');
echo '<link type="text/css" rel="stylesheet" href="gallery.css">';
echo '<div id="content">';
include($path.'/src/parsedown/Parsedown.php');

Loading…
Cancel
Save