OpenStreetMap logo OpenStreetMap

Layout Managers and Trigonometry

Posted by Zabot on 30 May 2016 in English.

Dialog Boxes

I’ve spent the week sparing with Java layout managers and Swing components, but at least I have something to show for it. Here are two of the finished dialog boxes, fairly simple as far as purpose, the first one is where most of the meat of what I’m doing is. This dialog will allow users to specify settings for what I’m adding, with different settings for Image exporting and previewing in the viewer. Shader Configuration This dialog is pretty self explanatory, it leads into the next thing I did this week… Date and Time

Sunlight!

day After talking with Tordanik and Basti I decided to flip my first two goals around, tackling the lighting first. It was a good decision, I was able to do all of the work without diving too far into the shader code. The gif above is 23 separate renders all taken an hour apart. There are still some colors I want to tweak, and right now the color of the lighting is a hard cut off between day, sunset, and night. I want to implement a gentler transition, mostly likely just by adding more steps to the lookup table. If I find some time, I may come back and try and implement some sun effects with shaders (atmospheric scattering, glare/lens flare) but for now a fixed color transition provides the effect I was aiming for.

The direction of the shadows is actually calculated based on the latitude and longitude of the location. The calculations follow the wikipedia page, its a bit of a fun exercise in trigonometry.

Discussion

Comment from imagico on 3 June 2016 at 10:34

For consistent visual appearance the most important thing and where osm2world currently lacks most is radiometric consistency. For the overall impression this is much more important that sophisticated stuff like reflections.

Comment from Zabot on 7 June 2016 at 20:53

How so, do you mean something like Radiosity? I’ve been playing around with atmospheric rendering and I stumbled onto it. I might try and play around with it a bit if I have time.

Comment from !i! on 11 June 2016 at 09:57

Looks interesting :)

Comment from RicoElectrico on 11 June 2016 at 12:40

@Zabot: I think he means things like right colors, gamma correction etc.

Comment from imagico on 17 June 2016 at 20:31

I was referring to the consistency in colors. On a very precise level this would require calculating diffuse radiative transfer but on a more basic level this is only about direct lighting. Since everything - at least in a daylight situation - is illuminated by the same light source, the sun, there are certain constraints on how surfaces can appear relative to each other. In typical osm2world renders surfaces frequently appear under different lighting conditions and relative to each other in ways that would be clearly impossible for a real world material. I don’t know the osm2world internals so i am not sure if this is just the material definitions being off or if there is something wrong on a more basic level in the rendering pipeline (like in converting the calculated radiances into pixel colors of the final image).

Log in to leave a comment