Skip to content

Instantly share code, notes, and snippets.

View CharStiles's full-sized avatar

Char CharStiles

View GitHub Profile
from sys import argv
import os
import math
def dist(x1,y1,x2,y2):
dist = math.sqrt((x2 - x1)**2 + (y2 - y1)**2)
return dist
def notLight(li):
Shader "GlitchRayMarchingNoise" {
Properties {
_Size ("Size", Vector) = (1,1,1,1)
_Height ("Height", Float) = 1
_Rotate ("Rotate", Vector) = (0,0,0,0)
[Header(GBuffer)]
_MainTex ("Albedo Map", 2D) = "white" {}
// _NoiseTex("Noise Texture", 2D) = "white" {}
#! /usr/bin/python
import zmq
import numpy as np
from PIL import Image
import os
port = "8080"
context = zmq.Context()
socket = context.socket(zmq.REQ)
socket.connect("tcp://IP:%s" % port)
'''
based off of test.py from https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix
Thanks to Aman Tiwari for the help.
to run:
python ServerToProcessFaceSketch.py --dataroot ./darta --name face_pix2pix --model pix2pix --which_model_netG unet_256 --which_direction AtoB --dataset_mode aligned --norm batch
'''
import os
import io
import time
import zmq
# my fork of https://gist.github.com/SlexAxton/4989674
gifify() {
if [[ -n "$1" ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
if [[ $2 == '--small' ]]; then
a=$(ls out-static* | wc -l)
for p in $(ls -r out-static*);
do
out=$(printf "out-static-%05d.png" $a)
#version 150
uniform float time;
uniform vec2 resolution;
uniform vec2 mouse;
uniform vec3 spectrum;
uniform sampler2D texture0;
uniform sampler2D shared1;
uniform sampler2D texture2;
var tree
var pad = 10
class Node{
constructor(v){ // v is a string
this.val = v;
}
}
class Tree{
#version 150
uniform float time;
uniform vec2 resolution;
uniform vec2 mouse;
uniform vec3 spectrum;
uniform sampler2D noise2;
uniform sampler2D noise1;
uniform sampler2D texture0;
/*{
"DESCRIPTION": "",
"CREDIT": "",
"ISFVSN": "2",
"CATEGORIES": [
"XXX"
],
"INPUTS": [
{
"NAME": "inputImage",
#version 150
// All of the uniform variables are declared in the side control panel
uniform float time;
uniform vec2 resolution;
uniform sampler2D texture0;
uniform sampler2D prevFrame;