POV-Ray : Newsgroups : povray.binaries.images : Sky simulation : Sky simulation Server Time
30 Jul 2024 00:20:49 EDT (-0400)
  Sky simulation  
From: scott
Date: 7 Jun 2013 03:36:29
Message: <51b18d7d@news.povray.org>
I've created a macro called SkySim (I'll post it in p.b.s-f once I've 
tidied it up and added comments) that creates a realistic looking sky 
pigment in a sky_sphere based on the sun position and the "haziness" of 
the sky.

The algorithm used is from this paper:

www.cs.utah.edu/~shirley/papers/sunsky/sunsky.pdf

It is the same algorithm used by the open-source software Stellarium, so 
I already had a starting point in code for the POV version.

If you also use "sunpos.inc" to get the sun position then you can create 
the correct sky based on just the longitude/latitude and time of day 
(this is how I've done it in the test scene).

The renders below are from the test scene with an isosurface ground and 
fog, however I've patched my version of POV so that the fog colour 
matches the sky_sphere and is not a constant colour. I think this gives 
a realistic perception of depth and renders very quickly.

Obviously in a real scene you may want to add clouds, but I hope it's a 
useful starting point for a realistic looking sky.


Post a reply to this message


Attachments:
Download 'skysimtestground1.png' (351 KB) Download 'skysimtestground2.png' (237 KB) Download 'skysimtestground3.png' (259 KB) Download 'skysimtestground4.png' (262 KB) Download 'skysimtestground5.png' (301 KB) Download 'skysimtestground6.png' (197 KB) Download 'skysimtestground7.png' (173 KB)

Preview of image 'skysimtestground1.png'
skysimtestground1.png

Preview of image 'skysimtestground2.png'
skysimtestground2.png

Preview of image 'skysimtestground3.png'
skysimtestground3.png

Preview of image 'skysimtestground4.png'
skysimtestground4.png

Preview of image 'skysimtestground5.png'
skysimtestground5.png

Preview of image 'skysimtestground6.png'
skysimtestground6.png

Preview of image 'skysimtestground7.png'
skysimtestground7.png


 

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.