I realized sampling multiple octaves of noise per step is way too computationally intensive so I gotta first cache my perlin noise by unwrapping the 3D perlin noise that lies on the spherical surface into a cylindrical 2D map I can sample while raymarching 🤔 https://twitter.com/Enichan/status/1342747094168309761
I dunno quite what the best thing to do with the Y axis is while unwrapping a spherical map into a cylindrical map. Anyone got any thoughts on that?
hey look i unwrapped a spherical normal map into a cylinder :D
nice

i dunno if this is actually right, but it /looks/ convincing and it was a lot easier than i thought it would be
oh hey i bet i can stick the heightmap and the normal map into a single texture by putting height into the alpha component, NEAT!
ah damn now im at the raymarching/sdf stage and my brain broke :(
maybe i will do a first attempt by just rendering a quad and tracing orthographically so i can't botch it by messing up my view angles and such
holy crap it took me all day to get the normals from the cylindrical map lined up with actual sphere normals but i did it! now i can go from sphere->map, and from position->map, which is key for the raymarching lookups
Obviously I won't keep the normals in the cylindrical map the same as a sphere, thats just for testing, I'm going to replace them with the normals of the deformed geometry

... but thats a lot of math I dont wanna do right now
okay well this is going all kinds of wrong so i guess i'll have to cave and use cube maps, bleh
trying again, though i still refuse to use cubemaps :)
ok well :| i wish i knew this existed yesterday. this is perfect and i already have it working thanks to stack overflow https://twitter.com/tom_forsyth/status/1343294132198858753
okay cool we're back in business! heck yeah!

i did have to switch to a glsl implementation of simplex noise because in true 3D my "fake 3D" perlin noise had some uhh, banding issues >_>
look ma, i made it bumpy! :D
so turns out there's an easy way to compute tangent space normals for a spherical heightmap, offset the position along each axis by a fixed increment, get the height value at the normalized position, then add twice the original normal times the offset, then normalize
not gonna lie i was stuck on that for a while :D
okay break time. next step is actually doing some raymarching to get the shape
i did it! not sure what the banding on the lighting is all about tho
if i decrease the number of ray steps, the banding increases
fixed it thanks to some help from @antumbral and @tom_forsyth (for certain values of "fixed")
this looks neat!
asteroid generator! \\😲/
tbh i'm not sure raymarching is even actually worth it, if you zoom in the step count has to go up or this happens

might be better to just throw some marching cube tessellation at the shape? ¯\\_(ツ)_/¯
You can follow @Enichan.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled:

By continuing to use the site, you are consenting to the use of cookies as explained in our Cookie Policy to improve your experience.