cubemap to fulldome / fisheye shader

hello there.
there have been some discussion on this forum about how to do fulldome-ready images but no ready-to-use solution has been presented.

below you’ll find a patch that demonstrates how to stitch a cube-map generated by the render TOP to a fulldome image by means of a very simple glsl shader.

the trick is easy. do cartesian to spherical and back to cartesian. feed the result into textureCube() and voila. i actually had some troubles believing that it’s so easy.

so you need to render a cubemap which is not very fast. there is another solution. one can bend the vertex position with the same technique in a vertex shader. that only needs ONE render but you have to tessalate the geometry a lot which might lead to even longer rendering times.

have fun with this and create astonishing immersive content!
documentation is in the patch.
cube_to_fisheye.toe (9.19 KB)

1 Like

Cool, thanks for sharing!

ohh… nice!!! Love this… Thanx for sharing!!

fabulous, thanks!

Cool shader!

But i found one problem:

When i’m looking on an object with environment map assigned through the fisheye canera, i saw the seams…

Is it possible to solve this problem?

Uploaded with

The seams are visible in the cubemap it seems also though.

yeah, cubemap render looks wrong too.

If i use 4 perspective cameras instead built-in cubemap, and convert them to fisheye in any compositing software - all is OK.

I think there is something with cubemap rendering relative to environment map.

Could the fisheye shader be adapted for truncated domes? Something similar to Paul Bourkes Unity3D system?


can you try to render some geometry with HDR assigned to environment map and look to the cubemap, are the seams of HDR map visible?

Can you post an example Sheff? I’m unable to reproduce your problem. You shouldn’t be able to see seams in the original HDR map though. If you do then they are going to show up in your final render

Could the cubemap to fulldome shader be used to render pre-rendered cubemaps to fisheye masters? Im experimenting with new Corona Renderer in 3DS Max which has no spherical camera yet.

Re: Seams

You can get rid of the seams if you change the vertex shader for the surface you are rendering. The environment map and rim lighting is based on camSpaceNorm in the default PhongMAT.

You can change this snippet to have the envmap and rimlights based on the surface’s worldspace normals:
In vertex main():

vec3 camSpaceNorm = uTDMat.camForNormals * TDDeformNorm(N).xyz;
vVert.norm.stp = camSpaceNorm.stp;

//Instead, for cube map rendering
vVert.norm.stp = TDDeformNorm(N).xyz; // not camSpaceNorm.stp[/code]

my problem is how to take an input of fisheye fulldome images and turn them into a cubemap - i.e. five separate images i can then put through 5 projectors and map/mask them to fit a dome?

Normally you would want to split, warp and blend from fisheye rather than cubemap. Do you plan to send each individual face to projectors?

i don’t understand why i would want to warp to fisheye then unwarp to projectors. there is a lot of distortion and detail lost at the edges of a fulldome image. i’d rather not warp to fisheye at all with 3d content… BUT with video i have captured with my 4.5 sigma lens, i would need to unwarp it to mix with the realtime objects, then use a camera rig of the corresponding projectors.

so to answer your question, yes…

For a start you will be loosing a ton of pixels projecting a square image from each unit but the real issue is how do you set up projectors to replicate cubemap positions? Splitting and warping from fisheye allows you to choose projector placement, geometrically correct and warp and specify what each unit should output, i.e. spanning multiple cubemap faces.

problem with fulldome is you are 1. putting a circle within a rectangle (creating a lot of blank space) and 2. stretching the edge pixels to infinity then unstretching them in the projection.

So I’ve playing with Steve Masons uber cool Evil Space Flame patch for fulldome projection using Bergi’s great cubemap to fisheye file. Occasionally the cubemap faces become visible however. I’ve attached a file if anyone wants to have a look.
cube_to_fisheye 4.toe (12 KB)

This is great JonathanK, thanks for sharing!

I’m trying to recreate this effect but using flat 2D Images onto flat screens in an attempt to do some non-standard image transitions.

I am having trouble sorting this out, can you offer any tips to help out a GLSL-noob?

I’m working with LED screens that are fairly low-res, 512 x 512, to be exact and the images range from standard people pictures to corporate logos.