Skip to content

Instantly share code, notes, and snippets.

@williamchange
williamchange / tri_voronoi.osl
Created February 19, 2023 05:38
Triangle Voronoi Blender OSL
/*
OSL Triangle Voronoi Borders
Based on a shadertoy by Thomas Hooper(tdhooper):
https://www.shadertoy.com/view/ss3fW4
*/
vector fract(vector v) { return mod(v*.5,.5)*2.; }
vector vstep(vector a, vector b) {
@williamchange
williamchange / tri_voronoi.hlsl
Last active February 21, 2023 15:51
Triangle Voronoi Borders HLSL UE (Custom Node)
// Based on "Triangle Voronoi Borders" by Thomas Hooper (@tdhooper)
// https://www.shadertoy.com/view/ss3fW4
struct Functions
{
float3 sdTriEdges(float2 p) {
return float3(
dot(p, float2(0.,-1.)),
dot(p, float2(.866025, .5)),
dot(p, float2(-.866025, .5))
);
@williamchange
williamchange / themegen.py
Created March 10, 2023 11:06
Simple Theme Generator (Add-on)
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@williamchange
williamchange / view_offset_toggle.py
Created March 27, 2024 08:56
Bring back 'View Offset' toggle in node editors for Blender 4.0+
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTIBILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
@williamchange
williamchange / AddSubPathNumber.py
Last active May 13, 2024 00:11
Add two buttons to - / + file number in the output panel (output properties)
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTIBILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#