Print at Oct 16, 2019 4:11:44 AM

Posted by okh at Sep 10, 2018 10:30:59 AM
Re: Light & textures - rendering examples of this and that.
Maybe, it is just me, but it would be a great help if 3D view and rendering were the same.
A matching view between the 3D preview and the rendered image would be great!
And even better if I could understand the projection and manage to make a reasonably accurate template... smile

Tsk tsk tsk... isn't it just a 4 by 1 rectangle projected on a hemisphere? So all we have to do is make an attempt to invert the distortion... right?
Sounds easy... but I know it isn't.
Quite, in theory it is easy, but as you say, making the perfect template is probably not possible. Since last post the (3D) perspective has changed: see
fix in thread 8704 and SF-req 668. @Puybaret: Perfect. THANKS for the fix! The 3D sky now makes more sense.

Thanks for the many hints and alignment/distortions. Yet to find out how to save time with Hugin, but I remembered Stellarium (celestial software) which has customisable horizons and backgrounds and when viewing it is possible to use different projections. Testing default ground image (i.e. horizon panorama) + cylinder projection: a night sky for SH3D with grid match and correctly placed celestial objects (at N46.108° E4.78° at some time I cannot remember).


Using stellarium_horizon.jpg gives this render:


Works for my purposes and suggests that Stellarium could be of help when matching sky imagery, placing sun, but also, I guess for making distorts for alternative rendering perspectives as discussed by Cec above.

I love Cec' beautiful images, but as opposed to Cec' aesthetic approach, mine is simpler and just practical. Say you consider building a lodge in a given position.
- Use a panorama of the skyline (real or with online tool), place in grid template.
- Use some sun calculator to determine how high above the horizon the sun will be during normal holidays.
- Use a satellite calculator to determine the position of you favourite information provider.
- Check out other stuff, like nearby airports.
- Find direction(/distance) to various points, summits for hiking, GSM transmitters for broadband, etc etc.

Place all of the above in the template and use as a Sky texture (starting at 90° in the plan, due East when compass points North). Place terrain, trees, buildings and other close obstacles in the plan. You now can visualise several things. Where to point the dish and broadband antenna. Where to place solar panels. How to orient the plan for sun conditions. Which views you will be able to see from your favourite chair through which windows. Whether the airport flight path could be a problem. In addition to all other stuff, of course: grid/water/road access, meteorological statistics, ground condition etc. Arguably too geeky for most plans, the example is based on a real project. It turned out that it would be near impossible to get decent sun conditions in the winter, we needed a different GSM provider for broadband, terrestrial TV would be difficult, but satellite should be ok, airport might be a problem as afternoon flights would often pass just above. All of this could easily have been discovered without the sky texture, but having the visual while drawing proved very useful: once the lodge was oriented for perfect afternoon sun, it turned out it would be difficult to place solar and dish, and the entire lodge had to be mirrored to avoid getting the entrance blocked by snow in the winter.

A higher resolution of mountain_cabin_texture.jpg renders like this (wide angle virtual visitor gives a distortion, of course):
.

Sunlight simulation is a perfect way of playing with sun conditions at different times. Btw. rendering sunlight seems to consider (the silly concept of) daylight saving, but not equation of time I think. At least I think that is why there appears to be a very slight mismatch (<4°) certain times of the year - or it could just be me. But it makes absolutely no difference for my purposes. I suppose one could also consider elevation of viewpoint / plan and estimate distance to horizon for the template.

Cec' template is probably better and easier to use for most purposes and work with most graphic editors. However, for accuracy and editing I prefer an .svg template to position (and distort) elements on the sky texture. For instance a 360° panorama .svg file with a grid, sky- and ground gradients and with links to other files: skyline, clouds, sun. That way it is relatively easy to place (and transform/distort if need be) each item accurately (with manually/Inkscape). Like Cec, I use a 360×90 template, with a few degrees extra at the bottom to blend with ground texture. Once each item is placed (and grid removed), the image can be saved as .png/.jpg and used as a high resolution sky texture.

sky360_sh3d6.svg, with links to (files placed in same directory):
- sky360.png (skyline with transparent sky from 3D terrain viewer)
- clouds.png (generic clouds)
- sun.png (simple sun created with the Gimp)
- plane.png (plane silhouette)

Same .svg file was used as template for the panoramas, just changing the different backgrounds and elements.

Point of this exercise is 1) to illustrate another way of using sky texture, and 2) to explain an item in the wishlist:

The use described, may be useful but to a few, and not really what the sky texture is intended for. But what would be great, now that the 3D view is more predictable, is if it were possible to set or change the starting point of the sky texture so it can be adjusted with the compass. Just a value in Home.xml would suffice for my purposes.
<environment ...>
<texture attribute='skyTexture' name='sky360_sh3d6' width='360.0' height='90.0' image='1'/>
</environment>

Maybe just startDirection='1.5708' or even startAngle='1.5708' endAngle='1.57079999' ?