Skip to content

Instantly share code, notes, and snippets.

View sevelee's full-sized avatar
🎯
Focusing

sevelee

🎯
Focusing
View GitHub Profile
@sevelee
sevelee / rr_wrap.py
Created September 29, 2018 09:43 — forked from mclavan/rr_wrap.py
Ryan Roberts - Wrap Deformer
'''
Ryan Roberts - Wrap Deformer
rr_wrap.py
Description:
Ryan Robers created a simple function to create a wrap deformer.
The wrap deformer needs a little more than the deform command to get working.
Michael Clavan
I wanted to have the function also return the deformer to the user. So, my contributions are pretty minor.
I converted the wrap deformer into a pynode object type pm.nt.Wrap.
@sevelee
sevelee / LogarithmicBinning.hlsl
Created January 2, 2024 09:52 — forked from avrahamy/LogarithmicBinning.hlsl
Logarithmic Binning shader code to be used in a Custom Function Node in Shader Graph (in Unity). LogBinNoise_float uses Logarithmic Binning to calculate the weights of gradient noise functions with different scales. Implemented according to the description in this GDC talk by Sean Feeley on his work on God of War: https://www.youtube.com/watch?v…
// Taken from GradientNoiseNode.cs from the Shader Graph package.
float2 GradientNoise_Dir_float(float2 p) {
// Permutation and hashing used in webgl-nosie goo.gl/pX7HtC
p = p % 289;
// need full precision, otherwise half overflows when p > 1
float x = float(34 * p.x + 1) * p.x % 289 + p.y;
x = (34 * x + 1) * x % 289;
x = frac(x / 41) * 2 - 1;
return normalize(float2(x - floor(x + 0.5), abs(x) - 0.5));
}