I’m currently working on a 360 immersive project in a dome. My content comes from large point clouds, that i draw as points or wireframe meshes (using vboMeshes). I chosed to work on windows so i can use a NVidia GeForce 10 series, that gives me better perfs (in terms of FPS).
Best solution i found for now is ofxDomeMaster (from @charlesveasey)
in a few words, the addon works this way:
- it instantiates 6 cameras, each one facing a given direction
- every camera render to a fbo (so we get a cubeMap)
- the fbos are then used as textures on meshes reproducing the inverse of a dome (to cancel the deformation due to the projection on the non-flat surface)
For now my project runs in 1080x1080. But when i project my contents on the dome, i have resolution (or aliasing, not really sure?) problems :
I tried several things :
- forcing antialiasing, with a OFGLFWWindowSetting parameter’s numSamples set to 4,8 and 16
- double the resolution of the entire project to 2160x2160
But the result is still not suitable :
My intuition is that the problem comes from the FBOs used in the addon to render the cubeMap, causing some sort of aliasing when mapped to the « inverse dome » meshes ; because when i try to run my project with a single ofCamera the result looks a bit better :
I searched for kind of a 360° ofCamera but didn’t found anything…
Does anybody tried to work on an immersive project with this addon and faced the same problem… ?
Any idea, advice or tricks would be really appreciated !
This is because of warping of cube map I guess.
It works okay for most of cases but if you want to work with fine lines and small dots, some of them will be erased, because streching texture (warping).
Please try this
It has custom shader which directory convert 3D data into domemaster format, Equidistant Projection.
And if you also work with Cylinder type 360° immersive projection, try this sister addon which works in same principle.
And thank you a lot for your reply, you confirm my guess regarding the texture warping.
I can’t wait to try your ofxEquidistantProjection addon !
I’ll come back to you as soon as i can try it on the machine dedicated to my project !
The project looks awesome! I assume you called ‘resize’ on ofxDomemater? Otherwise the shader approach is also good. Let us know what ends up working for you.
Yes, i tried to resize but i get the aliasing effect even with textures in 4K. I keep you posted as soon as i can try the shader solution. Can’t wait !
I see from the screenshot that you are on mac. I do not know nothing about full dome projection, but, did you setup the antialiasing value in the FBO? Anti-aliasing in OSX not working
Hi @edapx !
I wasn’t aware about that antialiasing flag for FBOs! Does it only work on Mac ?
Screenshots come from my Mac but the final project runs on a Zotac machine.
Coming back to both of you as soon as i find the time to try all this. I really have a lot of work right now, and traveling a lot.
Wow ! It works on windows, too.
And the result is amazing.
The antialiasing “cost” is significant in terms of FPS, but it should be ok on a bigger machine.
My idea is to enable fbos anti-aliasing to be able to play my show in good conditions at short term, and to implement the shader solution from Hiroshi as soon as i find the time to dive into the code again.
@edapx @hrs @charlesveasey thank you so much for those solutions.
You are the reason why i love the OF community that much
Great news! I assume you are adjusting the FBO’s anti-aliasing in ofxDomemaster? I should probably make a setting for that.
ofxDomemaster is optimized in the sense that the distortion is precomputed and uses only five cameras. This particular implementation provides a FOV of 240 degrees. It is possible to optimize further using only four cameras with a FOV of 180 degrees. Let me know if that’s of interest.
I always assumed this approach was the most efficient (trading FOV flexibility), but it would be interesting to compare Hiroshi’s addon.
I remember there’s slight difference on resulted texture image from cube map and shader approach but not sure.
I was thinking to send a PR to ofxDomemaster, because it’s same purpose and better name.
Or we could make an another addon like ofxPlanetarium or ofxDome etc.
Then we can switch cube map mode and shader mode with same 3D scene, it would be super cool!
@charlesveasey absolutely, i changed the call to
in the resize() method.
it’s definitely something that should be exposed as a parameter.
Can you tell me more, concerning the FOV adjustment ?
How do you remove a camera ? Is it still full-dome format ?
@hrs no doubt the shader approach is better in terms of quality, as the geometry is “redrawn” by the shader. I think it’s also better in terms of performance.
Totally agree for building an addon merging the two solutions !
Please let me know if i can be of any help on this.
ofxDomemaster provides max 240 deg fisheye, you can reduce the fov by scaling the mask, etc. Even though most domes are true hemispheres at 180 degrees, it is common to push content with higher fov.
The technique for rendering 180 fisheye with four render passes is outlined here:
In that paper Bourke mentions an approach using vertex shaders using a single pass and it’s limitations. The limitations can be overcome by subdividing using geometry, tesselation shaders. While the multi-pass technique can be limited by aliasing as you saw, the subdivision approach is not, but increasingly costly as you subdivide in order to get straight lines.
I’ll run some performance tests. My guess is that it will be dependent on the scene. I’d welcome PRs.
Exactly negative point of shader approach is subdivision.
So far ofxEquidistantProjection process like below.
- points : no subdivision needed
- lines : subdivide into 100 shorter lines always
- triangles : subdivide into 4 triangles per single triangle always
Obviously it needs better calculation. (like decide subdivision number depends on length of each lines).
I remember I tested it in 8k x 8k resolution and it looks okay so I didn’t fix it but indeed it depends on 3D scene.
Right now I don’t have time but I will prepare PR to ofxDomemaster.
Hi @hrs I looked into https://github.com/charlesveasey/ofxDomemaster , did you had a change to make a PR, or a fork of your changes, I want to try it out in a full dome that will be testing soon.
Thanks for the help
Unfortunately I couldn’t make time for PR.
Please see ofxEquidistantProjection about shader approach in the meantime.
And ofxDomemaster for cubemap approach.