This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import argparse | |
import struct | |
import math | |
import operator | |
parser = argparse.ArgumentParser() | |
parser.add_argument('input', metavar="INPUT", type=argparse.FileType('rb'), | |
nargs=1, help='the TMESH file to open') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shader_type canvas_item; | |
uniform mat4 TRANSFORM; | |
uniform vec2 DEPTH; | |
uniform bool REPEAT_X; | |
uniform bool REPEAT_Y; | |
uniform bool FLIP; | |
void fragment() { | |
// Create the matrix. A workaround is used to modify the matrix's W column |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func gen_random_in_cone(theta: float) -> Vector3: | |
var z = rand_range(cos(theta), 1.0) | |
var phi = rand_range(0.0, PI * 2.0) | |
var tmp = sqrt(1 - z*z) | |
return Vector3(tmp * cos(phi), tmp * sin(phi), z) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local function dowobble(cel, data, dataoffset) | |
local img = cel.image:clone() | |
-- local selection = cel.sprite.selection | |
for it in img:pixels() do | |
local nx = it.x | |
local ny = it.y | |
local seed = data.dir == "y" and it.x or it.y | |
-- Frequency is number of pixels it takes to perform full phase | |
local pos = (seed + dataoffset) / data.frequency | |
local offset = math.floor(math.sin(pos * math.pi * 2) * data.amplitude) |