we can write this in one line as a vector in shader code, since there's only one place they differ!
pd = 6a*o.uv*(√(u²+v²)-r)/r³
we can also simplify since √(u²+v²) = d:
pd = 6a*o.uv*(d-r)/r³
so what we have now, is the *slope* of this surface, along u and v, but we don't have the normal
now, whenever you want to convert from a slope to a vector, you insert the slope as components, while the remaining components equal 1
normal = normalize(float3(pd.x, pd.y, 1))
that's it! hell yea normals 💜
d = min( length(o.uv), r )
h = (a(d-r)²(2d+r))/r³
pd = 6a*o.uv*(d-r)/r³
normal = normalize(float3(pd,1))
also, here's an interactive version of this hump (in 2D instead of 3D) if you want to play with sliders 📈 desmos.com/calculator/aoq…
~FAQ~
Q: isn't it easier to just-
A: yes! this is the long way around. very slow to work with as you need to redo the math for every new input, but it's accurate as heck/not an approximation~
Q: what if my shape isn't a plane
A: transform this from tangent space or something idk
• • •
Missing some Tweet in this thread? You can try to
force a refresh
high frequency contrast like this, from pure white to pitch black, of both background elements and foreground elements, gives me art direction failure/school project/asset flip vibes
looking at this scene by highlighting high-frequency noise, can you see how there's no distinction between the player path and the surroundings?
pretty much the only thing that pops is the character, because their design is less noisy, making for a visual oasis
if we look at the values only, there's a slightly stronger distinction - the wide climbable rocks are uniquely horizontal and more uniformly bright, thanks to the notorious yellow paint
ok how the heck do you make a generalized miter join for n planes in 3D space?
I think I've boiled it down to finding some sort of best-fit generalized orthocenter of the spherical polygon convex hull formed by the face normals, but that seems like,, a lot
(thread)
for two normals, hardcoding it is relatively easy (code/math below)
for three normals, you can just find the intersection of the miter plane/point normals, because they converge at a single point (green lines in the .gif above)
long story short, this is for an extrude algorithm
given n faces connected to a vertex V, find a vector offset for V such that offsetting it maintains consistent face distances, as much as possible
if a vertex is only extruding two faces, the miter offset is easy to calculate:
a few of us unity insiders just had a meeting with some of the leadership at Unity
we're under NDA, so I can't share details of what was discussed
but, I got a tiny glimmer of cautious hope restored
I'm happy they were willing to talk frankly, and take the time to listen
I will continue to push on two points:
1. retroactive TOS/monetization changes are completely unacceptable, this is why trust was broken, irreparably for many. Any big changes to monetization should only apply to future versions of unity. not retroactively
2. the monetization scheme has to be something you can run the numbers on, it has to be predictable and workable as a business, using metrics/data we actually have access to, like sales. "installs" as a metric is a chaotic mess with lots of privacy and trust concerns