I’m currently using UE4 for indie-game development in my spare time, but also for fulldome planetarium use in my day job.
One of the standards for real-time 3D in the dome is the use of a spherical fish-eye camera, with a FOV of 180 degrees x 360 degrees - the dome is a hemisphere.
I have seen this type of setup in Unity working on the dome but I’m an UE guy through and through, so I’m looking for a UE4 solution.
Does anyone have any idea how to go about this in UE4?
The standard camera only has a max FOV of 170 and its just super wide, not true spherical fish-eye.
You may want to try looking at the Content Examples project and open the Post Processing Map. Look at example 1.16. You might be able to use this as a beginning to develop a post process effect to simulate a fish eye effect.
It is a very interesting idea. I would love to see how it turns out,
The problem I see with the post process approach, is as it’s a post processing effect then surely you’re not getting the 1:1 mapping you’re after - it’s one thing to distort the camera with a post processing effect, and it’s another entirely to render the scene out as a fisheye in the first place, to map onto a physical dome.
Paul Bourke’s approach in Unity was to create a cubemap with multiple cameras - something you should be able to do in UE4 with a Cubemap Camera (fairly sure that’s a thing - at the least there’s a TextureRenderTargetCube class in Source/Runtime/Engine/Private/TextureRenderTargetCube.cpp).
From there, you could do the same thing of projecting that cubemap onto a mesh with the appropriate distortion, and point an orthographic camera at that mesh. The ortho camera should then give you the right fisheye for the projection.
Now, that’s not very efficient because you’re rendering the cubemap, putting it to a texture, then rendering that lot with an ortho camera, which is a little ridiculous. The other alternative is to try and render a pure fisheye effect by diving deep into the camera code, and writing something similar to the guys at Fisheye Quake - the source is freely available too, but the part you’re interested in is mostly lurking in r_misc.c after R_SetupFrame.
One of the big pluses with Fisheye Quake’s code is they support different distortion lens types by lua scripts, which is quite fancy.
I have a real need for this. Specifically, I need a truly accurate version, which can only be obtained using Paul Bourke’s cubemap approach. Every other approach is either visibly incorrect (e.g., setting FOV to 180), or has problems with level of detail as you move away from the center (e.g., using a vertex shader). While it’s true that the cubemap approache requires four complete renders and some post-processing for each frame, there’s simply no getting around it. Only ray tracing (etc.) can produce higher quality results, but it’ll eat your CPU/GPU alive. You have to pay the piper one way or another.
So who’s going to build it? More to the point, why isn’t a spherical lens already built in to UE4? It seems like an obvious oversight, and a big win for those of us who’d rather use UE4 than Unity.
HI all,
as I am also looking for this type of solution (rendering a real 180deg panorama, not a 180 field of view distortion) I was wondering if any of you have new solutions or pointers since you posted here?