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
I can no longer recommend people apply to @FuturegamesEDU, the school where I've been teaching at, after a number of things have come to light
I talked to several students last night who've described a school in complete disarray and disregard for their students, absolutely unrecognizable from what I remember back when I was a student in 2010
• there have been multiple cases of courses running completely without a teacher, because they couldn't find one in time, or because the teacher asked for too much money
• the animation/vfx students have not had any animation or vfx courses after a whole year. for context, students go to futuregames for about 2 years. but they have learned a little bit of after effects and mocap tech, I guess
• they also didn't get to participate in the cross-disciplinary game projects, which, in my opinion, is one of the most important things you (used to) get to do at futuregames
• when they inquired about all this the animation/vfx students were told the course was for animation and vfx in cinema, not for games, which means they were either lied to before they joined, or while they were there, as there was no indication of this in the marketing material before they joined, nor at the time they were told this
• once the students tried to self-organize into something more useful, asking if they could watch lecture recordings from the other disciplines and classes, they were *denied*, which is absolutely wild to me. as a result, some students have started passing around recordings on their own,, which, what the heck, why do they have to do this??
(on a tangent, this makes me glad I've specifically asked them ahead of time to let me publish my lectures publicly)
back when I was at FG, there were two groups of students, game design and 3D art, about 18 students each, at a single location in Stockholm
but now I'm hearing there's classes with 40 students, with 12 separate educations you can apply to, across 6 locations in sweden alone, and they're apparently now expanding to warsaw as well
I have to wonder why the heck are they expanding when they are stretched so thin they are effectively transparent and have no ability to find or pay teachers
yesterday one of the students told me they don't even have a teacher yet for the upcoming shader course, which is starting tomorrow :)
FutureGames hasn't reached out to me, by the way, so they either lost the people who had contacts within the industry, or lost their record of past teachers, or maybe my $50/h was too expensive for the, now multinational, company
they've clearly shifted gears into trying to grow as much as possible, with a complete disregard for its students, which is such a shame because FG used to be a really really good place, with teachers actively working in the industry, but is now regarded as one of the worst. it's so frustrating
I'll see if I can do something for the shader course next week for the students regardless, they deserve better than this
@FuturegamesEDU ok just heard that they do have a teacher for the shader course next week at least thank god
I've gotten messages from students and teachers since posting this, mostly concurring, but also some contradictory. so mind that all of this is second hand, and I'm not in a position to verify it all
but at the end of the day, there's very real disappointment among students
there's something hauntingly beautiful about using vscode, an electron app, basically a browser, running v8, a js engine, to launch node, a server running v8 as a headless browser with js, which compiles my typescript code into js, for other people to run js in their browsers
it's, deeply cursed, but also, the fact that my IDE, my build step, and my audience, are all running js engines, and so that any js plugin I get or make, could potentially run in all three of these, plus serverside if I wanted to, is pretty neat and/or terrifying
stuff like this makes it pretty easy to move code between my ide vs build vs server vs client, which feels unusually flexible, it's pretty cool that it works