Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / SkySphere - Realistic Day/Night Gradient !!! Help !!!

Author
Message
TinTin
19
Years of Service
User Offline
Joined: 16th May 2006
Location: BORG Drone Ship - Being Assimilated near Roda Beta (28)
Posted: 2nd Feb 2007 02:02
Looking for help in creating a realistic Day/Night colour gradient to store in an array(360), I could probably work out one that looks Ok, but I'd like to be as realistic as possible.

I've created a 5x5 curved mesh, I'm going to assign a colour from an array(360) to each of the vertices. The offset into the array will be shifted respective of time of day, 0=midday 180=midnight

I see the f#ck-up fairy has struck again..
Dared1111
18
Years of Service
User Offline
Joined: 25th Oct 2006
Location:
Posted: 4th Feb 2007 10:35
the simple solution would be in the paint package to mess round with noise and whatever.

Who wants a Lemon?

I love lemons... and cats
Roxas
19
Years of Service
User Offline
Joined: 11th Nov 2005
Location: http://forum.thegamecreators.com
Posted: 4th Feb 2007 10:46
Jeff Miller
20
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: New Jersey, USA
Posted: 4th Feb 2007 13:19
Also, the Extends add-on sold by TGC contains a real time sky system that specifically includes the feature you are looking for, as well as an awesome treatment of cloud movement, and other goodies like a sun and moon.
TinTin
19
Years of Service
User Offline
Joined: 16th May 2006
Location: BORG Drone Ship - Being Assimilated near Roda Beta (28)
Posted: 5th Feb 2007 15:32
@Dared1111 tried this, it just dont look good enough when scrolling from day to night. Thanks.

@TFMC Thanks, I'd already came accross this example, but it also just isn't quite what I'm looking for.

@Jeff I'd like to try programming my own Sky and clouds. DBP has the ability to do what I want although using the plugins would save loads of time, I can hardly say created by Me... Thanks anyway.

I think that the array colours would have to be dynamicaly updated depending on time of day, and as the sun reaches the horison, it sould change colour as well as generate the red sky effect. I could use this to modify the Sunlight/Moonlight and Ambient values.

I'm also working on a procedural cloud effect that will change colour as a result of the sun/moon position.

I see the f#ck-up fairy has struck again..
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 5th Feb 2007 17:20
Perhaps using skyspheres is an idea, like have 3 skysphere textures, 1 bright sunny day, one night sky, one red sky for sunsets. Then you would position the main light at the suns position, maybe show it and the moon as simple textured plains orientated with the camera, then set the alpha level of each skysphere to suit the time of day. Perhaps you could convert the time of day to a 360 degree angle, and use SIN to balance the day and night cycle, and add in shorter red sky cycles too, like full dark at 12pm, full daylight at 12am, and full red sky at 6am and 8pm.

I recently did this as a backdrop effect, like split an image into different colour groups (cyan, magenta, and yellow), and offset each one to give a kinda microscope effect, or old fashioned 3D goggle pictures. Just remember to set the transparency mode and disable object zwrite on the skyspheres.

''Stick that in your text and scroll it!.''
TinTin
19
Years of Service
User Offline
Joined: 16th May 2006
Location: BORG Drone Ship - Being Assimilated near Roda Beta (28)
Posted: 6th Feb 2007 12:04
The Sky texture method (Van B) won't work with what I'm attempting (Well it would work, it's still not what I'm trying to do)

I've managed to generate a skydome using real world values (Scaled)
like a 10x10 mesh thats slightly curved and a disc as the ocean (with bumpmaping and reflection mapping).

I intend modifying the vertex colour and alpha to generate the background sky gradients (hence the reason I'm looking for the proper calculations),this dome will be made of several meshes, on for the Starmap (which I intend to scroll), one for the Skycolour (the calculation) and one/two for the clouds (scrolling bumpmapped Perin Noise)

The Sun/Moon will be orientated plains tied to light sources, these will squash slightly as they reach the horizon to emulate the real world efects caused by refraction.

All in All the overall effect will be used as a timelapse animation between levels similar to the Blade movies.

I see the f#ck-up fairy has struck again..
Jeff Miller
20
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: New Jersey, USA
Posted: 6th Feb 2007 12:24
This is starting to sound quite interesting and well thought-out. The squash near the horizon is an excellent idea. To further the realism, there is another effect you might be able to pull off as the sun and moon approach the horizon called "augmentation". It is the tendency of humans to perceive the sun and moon as having a larger angular size near the horizon than they do higher in the sky. I don't experience this optical illusion with sky systems on screen, although I do when viewing the sun or moon in the real sky. You might simulate it by moving the sun/moon planes closer as they approach the horizon, or scaling them larger as they approach.
TinTin
19
Years of Service
User Offline
Joined: 16th May 2006
Location: BORG Drone Ship - Being Assimilated near Roda Beta (28)
Posted: 6th Feb 2007 13:35
Already done Jeff, I'm using the Sin(angle) to Scale the Sun/Moon by a specific (still tweaking) value, zero degrees is directly overhead, I've even managed to control the Sun/Moon's traverse across the sky using the relative orbits depending on Longitude/latitude (This will be sync'd to the players home location). I'm also intending to use the sky colour calculation to change the colours of these and there respective light source more red as they approach the horizon.

Who knows? if I ever get this bit finished, I may post it as an example.

I see the f#ck-up fairy has struck again..
Jeff Miller
20
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: New Jersey, USA
Posted: 6th Feb 2007 16:22
That home location feature will be a welcome relief! I've been using that concept to orient a star-sphere I've been working on (which uses the 9000 star coordinates and visual magnitudes from the Bright Star Catalog). A problem with sun systems I've seen, including Extends, is that the sun always rises vertically, which only happens at the equator and - for that matter - only on the equinoxes.
TinTin
19
Years of Service
User Offline
Joined: 16th May 2006
Location: BORG Drone Ship - Being Assimilated near Roda Beta (28)
Posted: 6th Feb 2007 19:30
Yeah Jeff

I'd thought about doing that also, using a slightly larger dome like I'm building for the sky instead of a sphere, then mapping a section of long bitmap onto it. This could be loaded to calculate the section required grabed and unloaded before the level as the starmap isn't going to change that much in one session. i.e 20 to 30 degree's not a full 360 rotation.

I've managed to get my main dome constructed, but due to scaleing, it suffers from clipping and missing polygons. I don't know why the camera range is set from 0 to twice the maximum radius.

I've also used a sweet little function to do a gradient on the dome giving a rather nice pink Nadir effect.


My temporary Sea plain is also fighting for Z-Order at the corners. I'll fix this with a circular plain as planned.

I see the f#ck-up fairy has struck again..

Login to post a reply

Server time is: 2025-05-18 08:05:09
Your offset time is: 2025-05-18 08:05:09