Fisheye/dome projection

Hi guys,

I want to use a jMonkey application in a dome/planetarium installation. Has anyone successfully implemented a projection for this, or know of some tools which could help?


If your dome is the whole screen then a simple “postprocess” Filter’s fragment shader should do the trick, no ?

EDIT: Ok if I understand you correctly you just want to project the whole screen on a dome. I would do that in a Filter’s fragment yes.
The maths are not that scary neither : Computer Generated Angular Fisheye Projections
That shouldn’t be more than a couple of GLSL lines.

1 Like

Yeah thanks a lot, I was checking out the Paul Bourke stuff as well so good to know I’m on the right track. I just want to have a dome projection on the desktop flat screen. There is another program which will project this correctly to the dome. I’m fairly new to shaders so I’m still a bit confused about the process even after reading the documentation. I just want to clarify a couple of things.

  1. I have to make a Filters fragment shader. Is there an existing template to use that I can modify?
  2. I then should make a materials definition file that specifies the fragment shader. Does this material have to apply to every object in the scene?

Sorry if these are dumb questions.

No problem it’s not dumb.
If not done yet you should read the JME’s wiki page about shaders.

(1) Yes it’s a good idea to start from a simple example. You could start from ShaderBlow.Filter.GrayScale from ShaderBlow’s plugin for example. By looking at the code you’ll understand a lot in no time.

(2) No no no it’s much more simpler than that. You don’t want to touch your materials for what you are trying to achieve. Your materials are already doing their job so just leave them alone. This is where the use of JME’s postprocess filtering system will help you : it just passes to your shader the “screen output” (“screen image”) as a texture. You then do whatever you want with that texture, like applying the projection. Just open a couple of filters from ShaderBlow and you’ll understand.

EDIT: I’m a curious person :slight_smile: Please tell me more about your project ! Is it some kind of star wars simulator that you’ll play in a planetarium ? I want to be in !

1 Like

Thanks a lot! I’ll definitely check out the ShaderBlow stuff, seems it’s exactly what I’m looking for. The project is for a university thing. Basically we’ve got a giant dome and we’re looking to use it as an interaction environment. For example, we’ve got Kinect and some other sensors inside it so users can run around in the virtual world using their bodies.

My CS courses would have been much more interesting with a giant dome !
Have fun with your project :slight_smile: