or Creating an IR effect in WorldWind Java
I need to emulate an infrared (IR) view in WorldWind, and I'm not sure about the best way to go about this. I should point out that I do not need to simulate IR (i.e. no heat maps) -- I just need to produce a reasonable facsimile of a black-and-white IR display. I have very limited graphics knowledge and no prior experience with OpenGL, JOGL, or WorldWind.
Based on my research so far, it seems that the best approach is to use a custom shader. However, as far as I can tell, WorldWind provides no high-level shader support.
I found the following relevant threads on a WorldWind forum, but I'm still not sure how to proceed:
- GLSL Shader support that renders tiles correctly
- Updating GLSL support with new JOGL
- Normal mapping (GLSL shader)
- GLSL fragment shader problem
To clarify my question(s):
How do I integrate a GLSL shader into a WorldWind application, if that is in fact the best approach? If not, how should I implement this effect?
This turned out to be fairly straightforward, thanks to the contributions of tve and what_nick in this thread: GLSL Shader support that renders tiles correctly. Specifically, I reused the GLSL class contributed by tve (in shader_support_051308.zip) and modified what_nick's sample code.
I defined a DecoratedLayer class that allows any layer to be "decorated" with a new rendering strategy, then defined a ShadingDecorator that sets up the GLSL shader before delegating to the underlying layer's
render
method:More work is needed to make this fully general, but this should be a reasonable starting point.