Sha256: 782b69b9e55851a31e5f77c6f3fdafd4ce95802d4c68d9a00dcbce1936e73642

Contents?: true

Size: 1.24 KB

Versions: 21

Compression:

Stored size: 1.24 KB

Contents

#version 330 core

#ifdef GL_ES
precision mediump float;
#endif
// http://glslsandbox.com/e#30671.1
#extension GL_OES_standard_derivatives : enable

uniform float time;
uniform vec2 mouse;
uniform vec2 resolution;
out vec4 color_out;

float snoise(vec3 uv, float res)
{
	const vec3 s = vec3(1e0, 1e2, 1e3);
	
	uv *= res;
	
	vec3 uv0 = floor(mod(uv, res))*s;
	vec3 uv1 = floor(mod(uv+vec3(1.), res))*s;
	
	vec3 f = fract(uv); f = f*f*(3.0-2.0*f);

	vec4 v = vec4(uv0.x+uv0.y+uv0.z, uv1.x+uv0.y+uv0.z,
		      	  uv0.x+uv1.y+uv0.z, uv1.x+uv1.y+uv0.z);

	vec4 r = fract(sin(v*1e-1)*1e3);
	float r0 = mix(mix(r.x, r.y, f.x), mix(r.z, r.w, f.x), f.y);
	
	r = fract(sin((v + uv1.z - uv0.z)*1e-1)*1e3);
	float r1 = mix(mix(r.x, r.y, f.x), mix(r.z, r.w, f.x), f.y);
	
	return mix(r0, r1, f.z)*2.-1.;
}


void main( void ) {	
	vec2 p = -0.5+( gl_FragCoord.xy / resolution.xy );
	p.x*=resolution.x/resolution.y;			
			  	
	float color = 3.0 - (6.*length(p));		
	
		
	
	vec3 coord = vec3(atan(p.x,p.y)/6.2832, length(p)*0.4, .5);
	
	
	for(int i = 1; i <= 7; i++){
		float power = pow(2.0, float(i));
		color += (1.5 / power) * snoise(coord + vec3(0.,-time*.05, time*.01), power*16.);
	}
	
	color_out = vec4( color, pow(max(color,0.),2.)*0.4, pow(max(color,0.),3.)*0.15 , 1.0);
	
}

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
pixo-0.4.5 ext/pixo/patterns/fire.glsl
pixo-0.4.4 ext/pixo/patterns/fire.glsl
pixo-0.4.3 ext/pixo/patterns/fire.glsl
pixo-0.4.2 ext/pixo/patterns/fire.glsl
pixo-0.4.1 ext/pixo/patterns/fire.glsl
pixo-0.4.0 ext/pixo/patterns/fire.glsl
pixo-0.3.2 ext/pixo/patterns/fire.glsl
pixo-0.3.1 ext/pixo/patterns/fire.glsl
pixo-0.3.0 ext/pixo/patterns/fire.glsl
pixo-0.2.6 ext/pixo/patterns/fire.glsl
pixo-0.2.5 ext/pixo/patterns/fire.glsl
pixo-0.2.4 ext/pixo/patterns/fire.glsl
pixo-0.2.3 ext/pixo/patterns/fire.glsl
pixo-0.2.2 ext/pixo/patterns/fire.glsl
pixo-0.2.1 ext/pixo/patterns/fire.glsl
pixo-0.2.0 ext/pixo/patterns/fire.glsl
pixo-0.1.4 ext/pixo/patterns/fire.glsl
pixo-0.1.3 ext/pixo/patterns/fire.glsl
pixo-0.1.2 ext/pixo/patterns/fire.glsl
pixo-0.1.1 ext/pixo/patterns/fire.glsl