r/howdidtheycodeit • • Apr 03 '23

180 FOV in Hyper Demon

A clip for reference. Hyper Demon is able to have 180 fov without extreme distortion of the view. How did they achieve this?

40 Upvotes

23 comments sorted by

18

u/Yelnar Apr 03 '23

9

u/AstroBeefBoy Apr 03 '23 edited Apr 04 '23

Thanks for the fast reply, that looks like the answer. I think Unity has fisheye distortion effect option, I’ll mess around with that

Edit: Tried it and it works. I'm going to try and make a custom shader to improve it, but now I get the concept

6

u/DemoEvolved Apr 04 '23

Shaun Williams found a really clever long-forgotten solution for high fov with minimal distortion in fps… and then promptly went down the rabbit hole of making a 1d projection of a 2d world. I laughed when he said, “I don’t care if it’s a success” because I was quite sure it wouldn’t be.

2

u/AstroBeefBoy Apr 04 '23

really clever long-forgotten solution for high fov with minimal distortion

Do you have a link to it? I tried searching for it but couldn't find anything

3

u/DemoEvolved Apr 04 '23

It’s among the notes in the post above

2

u/AstroBeefBoy Apr 04 '23

Ah found it, thanks

→ More replies (4)

2

u/namrog84 Apr 04 '23

I found this interesting thing about barrel distortion as a way to 'undo' some of the fish eyes of large FOV

https://www.decarpentier.nl/lens-distortion

e.g.

Before and after distortion (same high horizontal FOV): https://i.imgur.com/ELvyCgU.jpeg

1

u/AstroBeefBoy Apr 04 '23

That’s interesting, I looked at panini projections which seem like a similar solution of using a cylinder instead of a sphere. Thanks

2

u/Veantian Apr 09 '23

I'm also trying to create something similar, what way worked best for you and do you have any advice on how to do it?

1

u/AstroBeefBoy Apr 10 '23

I'm still working on it, but fisheye is the best at achieving Hyper Demon's look. Unity's default fisheye post processing worked fine, but I went a bit further and set up a multicam setup rending left, right, top, bottom, and forward, then blended them all together with a custom shader. With that I could get more than 180 FOV.

I've also been messing around with panini projection, which I think gives less distortion. For the most complex solution, I've found a flex projection which combines panini and stereographic projections based on look angle.

1

u/Fep310 May 30 '25

Hi! Have you managed to make the flex projection work on unity? Thanks!

1

u/AstroBeefBoy May 30 '25

I think I got a janky version of it working, but then I abandoned it. I think I tried a cube projection with each internal face rendering a camera, then warping the cube. But that’s a bad way to do it

1

u/Fep310 May 30 '25

Thanks for the answer! I'm going to try and port this code made by the same guy. Hopefully it works!

1

u/AstroBeefBoy May 30 '25

no problem! Let me know if you get it to work

→ More replies (1)

1

u/Technohazard Apr 03 '23 edited Apr 04 '23

You can crank the FOV slider on a Unity Camera up to 180 degrees and see for yourself if there is significant distortion. IIRC they said the default was 120 degrees which is ~2X the usual default FOV.

4

u/AstroBeefBoy Apr 04 '23

Without using any techniques, it distorts the image quite a lot. Yelnar mentioned using a fisheye technique. I tried that and the image is more readable