Good evening twitter
I have raymarched an Orb
This is a record of a twitter thread, originally posted in 2016
Hello everyone
Now I have raymarched The Absence of an Orb
For real though; pick a few colors that look nice together and use those for all your graphics tests. Makes boring experiments look cool
This was supposed to be a fisheye projection but uh
There are some super weird fish though so hey maybe
Don't understand the technique deeply enough to know exactly what causes this/how to fix it but not sure I want to right now
Oh okay I figured it out: To keep a cap on execution time, algo limits to how many steps it'll march before giving up. If a ray passes
super close to a surface but doesn't quite hit it, the step size ends up super tiny and you expend all remaining steps before getting
any significant distance past the surface. So curved surfaces end up with a halo of unresolved pixels around their edges
Cool!
Have seen some stuff on shadertoy that doesn't have this problem so I guess a solution exists
I guess as a last resort temporal filtering could fix it in most cases. Overkill for my purposes though
If nothing else, raymarching bugs are certainly more interesting than vertex shader bugs
Weird thought: Hypothetically, an alien brain could make perfect sense of these images
They contain the same information as a "normal" perspective image; the projection's just totally different from what we're used to
Also added some dither fog which helps a lot with differentiating surfaces
Forgot to do the make-one-pixel-transparent-to-force-twitter-to-use-PNG trick for most of these so jpeg's kinda pooping on the dithering :(
Greetings once again
At last, the image you have waited for: A Vast Profusion of Orbs in Five-Point Perspective
Wait crap I screwed up the gif export it was supposed to have shading but now it already has RTs
It was supposed to look like this
540-DEGREE FIELD OF VIEW
SUCK IT GAMERS
I should point out that this is literally impossible with normal game rendering. Games use a pinhole projection, which is linear
Side effect is you can't render a fov larger than 180 degrees. Even if you set it to 1000 in the ini and post a screenshot on reddit. 180
This is why I get IRRATIONALLY ANGRY when people refer to the distortion from wide fovs in games as "fisheye"
FISHEYE IS A COMPLETELY DIFFE
The distortion in a game with 180 fov is so bad specifically because it's NOT fisheye. Can't curve straight lines so it loses its mind
"loses its mind" is the formal term mathematicians use to describe things that involve the asymptote of the tangent function, btw
(this also means gaming on curved monitors or wraparound multi-monitor rigs is Dumb. You're not fixing the distortion; you're *adding more*)
(if you want to use multiple monitors to view a wider in-game fov they need to be flat on the wall perpendicular to your view to be correct)
(assuming you sit 2 feet away, for a fov of 120 you need about a seven-foot wide monitor wall
160: 23 feet
170: 46 feet
Asymptotes!)
I guess this is too many tweets to be considered parenthetical anymore
In a similar way, fisheye is only distorted on flat displays
A curved monitor and a properly-calibrated fisheye projection would be perfect: All fovs <=360 supported with zero distortion
Problem is all the ways of doing fisheye in games are really complicated and have significant performance considerations
Also nobody makes ring-shaped 360-degree monitors
Ooh stereographic projection does really cool stuff at large angles
(earlier images were using equiangular)
So the term "fisheye" generically refers to any number of curvilinear perspective projections
My aim here has been to figure out a generic camera for raymarching where I can just plug in any old projection and see the result
And I have succeeded!
Currently going off this list:
Would like to find more expressed in that form
https://en.wikipedia.org/wiki/Fisheye_lens#Mapping_function
Fisheye lens - Wikipedia
Will post shadertoy in a bit; gotta make the code at least vaguely readable first
Also "fisheye" is a dumb name; your actual human eyes see curvilinear perspective. Brain just interprets it flawlessly
Stand perpendicular in a hallway some time and stare at the wall. Can see it converge towards both vanishing points in peripheral vision
The part in front of you *looks* straight because Brain Stuff but you can force yourself to notice the curvature if you focus on periphery
Okay, it's done! Code for raymarching using various curvilinear perspective projections:
https://www.shadertoy.com/view/MtV3Dd#
Looking forward to making tweets that aren't part of this three-day-long reply thread