Skip to content

Instantly share code, notes, and snippets.

View solsarratea's full-sized avatar
:octocat:
miau

solsarratea

:octocat:
miau
View GitHub Profile
@solsarratea
solsarratea / vivo.frag
Last active November 29, 2021 14:11
LIVECODING AND CHILL
/* LIVECODING AND CHILL : bu3namigue con Pablito Labarta y Sol Sarratea
Para aprender más sobre shaders:
- Book of Shaders https://thebookofshaders.com/
- Curso introductorio https://curso.solquemal.com/
- Shaders + Caos (curso en proceso) https://wikicaos.solquemal.com/
El siguiente código corre en The Force, editor online de GLSL creado por Shawn Lawson
Link: https://shawnlawson.github.io/The_Force/
@solsarratea
solsarratea / dct.frag
Last active July 3, 2021 14:47
GLSL viewer for cosine frequencies
// Copy following code at: https://thebookofshaders.com/edit.php
// Author: sol sarratea
// Title: DCT exploration
#ifdef GL_ES
precision mediump float;
#endif
uniform vec2 u_resolution;
@solsarratea
solsarratea / keybase.md
Created May 24, 2021 15:47
keybase.md

Keybase proof

I hereby claim:

  • I am solsarratea on github.
  • I am solquemal (https://keybase.io/solquemal) on keybase.
  • I have a public key whose fingerprint is 6E92 AEA9 7DE1 C2C8 637C 4C5D 146F 9FE5 80BB 0E46

To claim this, I am signing this object:

@solsarratea
solsarratea / bmp-r5g6b5.md
Last active April 30, 2022 15:26
Using GIMP to convert an image into .BMP with subtype R5G6B5

Open image in GIMP editor:

  1. File -> Export As
  2. Change extension format to .bmp
  3. Click Export
  4. Click + Advance Options
  5. Select under section 16 bits, option R5 G6 B5
  6. Click Export

ready :)

@solsarratea
solsarratea / rd.frag
Created August 31, 2020 14:37
reaction diffusion
// REACCCION DIFUSION
// adaptacion a The Force
// shader creado por Keijiro
// https://github.com/keijiro/ShaderSketches/blob/master/Fragment/ReactDiffuse.glsl
float rand2(vec2 p)
{
return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453);
}
@solsarratea
solsarratea / galaxy.frag
Created August 31, 2020 14:18
2D galaxy
float r21 (vec2 p) {
p = fract(p*vec2(233.34,851.79));
p += dot(p,p+23.34);
return fract(p.x*p.y);
}
vec2 r22 (vec2 p) {
float n = r21(p);
return vec2(n,r21(p+n));
}
//Repeticiones en el espacio
// Funciones sacadas http://mercury.sexy/hg_sdf/
// Rota alrededor de un eje
void pR(inout vec2 p, float a) {
p = cos(a)*p + sin(a)*vec2(p.y, -p.x);
}
// Repite en 3D
vec3 pMod3(inout vec3 p, vec3 size) {
vec3 cosPalette(float t){
vec3 a = vec3(0.5,0.5,0.25);
vec3 b = vec3(0.3,0.4,0.4);
vec3 c = vec3(2.,1.,3.);
vec3 d = vec3(0.,0.3,0.6);
return a + b*cos( 6.28318*(c*t+d));
}
const int iterations = 120;
float smallNumber = 0.01;
float scene(vec3 p){
vec3 q = fract(p) *4. -1.;
float sphere = length(p)-abs(sin(time*0.1)*2.);
float planeDist =p.y +2.;
vec3 cosPalette(float t){
vec3 a = vec3(0.6,0.5,0.25);
vec3 b = vec3(0.5,0.5,0.4);
vec3 c = vec3(.2,.3,1.);
vec3 d = vec3(.2,0.3,0.32);
return a + b*cos( 6.28318*(c*t+d));
}
void pMod3(inout vec3 p, vec3 size) {