Skip to content

Instantly share code, notes, and snippets.

View tshirtman's full-sized avatar

Gabriel Pettier tshirtman

View GitHub Profile
$HEADER$
float pi = 3.1415926535;
uniform vec2 resolution;
uniform float time;
vec2 rotate(vec2 pos, float angle, vec2 origin) {
pos -= origin;
pos *= mat2(cos(angle), sin(-angle), sin(angle), cos(angle));
$HEADER$
float PI = 3.1415926535;
uniform vec2 resolution;
uniform float time;
vec2 rotate(vec2 pos, float angle, vec2 center){
pos -= center;
pos *= mat2(cos(angle), sin(-angle), sin(angle), cos(angle));
pos += center;
#!/usr/bin/env python
'''
GLSLiewer
=======
GlslViewer, for KV-Viewer, is a simple tool allowing you to dynamically display
a GLSL file, taking its changes into account (thanks to watchdog).
You can use the script as follows::
@tshirtman
tshirtman / test.glsl
Last active October 3, 2021 13:18
glsl vjaying experiment
$HEADER$
float PI = 3.1415926535;
uniform vec2 resolution;
uniform float time;
vec2 rotate(vec2 pos, float angle, vec2 center){
pos -= center;
pos *= mat2(cos(angle), sin(-angle), sin(angle), cos(angle));
pos += center;
'''
'''
from kivy.app import App
from kivy.lang import Builder
from kivy.animation import Animation
KV = '''
FloatLayout:
Button:
@tshirtman
tshirtman / Overworld.png
Last active January 5, 2024 22:38
a tilemap implementation in kivy using a shader
Overworld.png
‰PNG
x26
IHDR
x02€
x02@x08x06
@tshirtman
tshirtman / dock.py
Created April 17, 2021 10:52
using a shader to build a bottom dock for buttons with a circle opening in it
'''
'''
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.widget import Widget
from kivy.core.window import Window
from kivy.graphics import RenderContext
from kivy import properties as P
'''
'''
from kivy.app import App
from kivy.lang import Builder
from kivy.clock import Clock
import kivy.properties as P
KV = '''
#:import Animation kivy.animation.Animation
'''
'''
import random
from uuid import uuid4
from string import ascii_lowercase
from kivy.app import App
from kivy.lang import Builder
from kivy.properties import ListProperty, StringProperty