Methods for drawing the sky

Started by
16 comments, last by Lightness1024 11 years ago

I'm working on drawing the sky in an outdoor FPS/RPG type title.

Needless to say, like everyone, i want it to look more real than reality itself, and take zero clock cycles to draw! <g>.

But seriously, i'm looking for a method or combo of methods that will yield beautiful sky texture like results, but be animated and particle based, driven by a weather simulation engine, AND be low overhead.

here's where i'm at right now:

For daytime, the screen is cleared to a uniform shade of blue based on time of day. the sun is alpha blended in. a skybox is used for night. the sun and skybox can be whipped into shape easily enough, its just tweaking textures and meshes. Clouds and sky color seem to be the real challenge.

for clouds, i'm currently using a system of 20 particles. each particle is an almost flat octahedron mesh. the texture is alpha tested with 2 clouds on a texture, and the texture repeated twice over the mesh, for a total of 4 clouds per mesh, and 80 clouds for all 20 particles. Clouds are at 3 different altitudes, and their altitude is sloped towards the horizon, so they are not drawn in 3 planes above the ground, but more like in 3 concentric shallow domes above the ground. This squeezes them into a far clip plane of 1000 while appearing to be further off. the effect is OK, but reminds me of road runner cartoons for some reason. : P

I'm thinking i need to do a gradient from darker at the horizon to lighter straight up for the sky color, and alpha blend the clouds, but i'm concerned with possible performance issues.

any suggestions for possible candidate techniques or approaches?

Norm Barrows

Rockland Software Productions

"Building PC games since 1989"

rocklandsoftware.net

PLAY CAVEMAN NOW!

http://rocklandsoftware.net/beta.php

Advertisement
You can do much better than a simple gradient for the sky. Atmospheric scattering in real time has been around for over a decade. For cloud rendering, there are lots of approaches.
">Game Programming Gems 5 had a pretty decent article based on using a height field for clouds. There are particle based approaches as well. Yann L had some great posts of cloud rendering here many years ago. I've found vterraing.org to be a great resource for these kinds of things. Lots of papers on the subject.

EDIT: Having a hell of a time with the editor here! sad.png

Also there are libraries like SilverLining and Triton.

they are based on the old method from Dobashi et al. (dynamic simulation and rendering of clouds)

there is the classic mark harris, and above all there are the methods from Antoine Bouthors, like the 2008 paper Multiple scattering in clouds.

Also Lumion has impressive clouds (lumion free is downloadable to experience that).

there are many true volumetric methods that are making their way through recently.

there is a method for scattering using LPV that is pretty serious:

http://www.cse.chalmers.se/~uffe/multi_scatter.pdf

Also I'm pretty sure there is a future of voxel tracing for cloud rendering.

to make it simple you can also just skid some photos.

for the sky, well the shader is provided directly in the Neyret/Crassin paper so there is no blah blah possible on that.

How does atmospheric scattering work in a convincing way for flat worlds? I'm about to implement a sample of it, but it's in a basic setup- a square grid for the surface and a stationary sky dome, not a planetary sky sphere. It works and looks good enough close to the surface, but since the sky dome does not move in relation to the camera it starts to look odd the farther up you go.

I guess, as it is, this will have to do for now. I'm not setting out to do a full earth simulator but if it would be nice if the skydome looks like you can actually reach it, in high altitude settings.

New game in progress: Project SeedWorld

My development blog: Electronic Meteor

I've found vterraing.org to be a great resource for these kinds of things.

Yeah, found that one yesterday, lots of good stuff there.

Also there are libraries like SilverLining

Took a look at that yesterday too. Probably too expensive. : (

But that is the kind of thing i need.

Also I'm pretty sure there is a future of voxel tracing for cloud rendering.

yeah, voxels are point cloud data. raytraced voxels or point cloud data will probably be the ultimate evolution of how to draw clouds.

have you seen that team in Australia who has a point cloud rendering engine with insanely high resolution and unlimited scene complexity?

one important thing i forgot to mention:

the game is a fps title, not a flight sim, so the player can't fly through the clouds, just look up at them. So they don't need the full volumetric effect.

is there a popular solution commonly used ? or is everyone sort of doing whatever method(s) or using whatever library to draw clouds?

Norm Barrows

Rockland Software Productions

"Building PC games since 1989"

rocklandsoftware.net

PLAY CAVEMAN NOW!

http://rocklandsoftware.net/beta.php

http://reset-game.net/?p=284

Might not be much help to you but... NICE!

have you seen that team in Australia who has a point cloud rendering engine with insanely high resolution and unlimited scene complexity?

The one that's been in development over for 14 years by a questionable man with a severe victim complex? Don't get your hopes up.

have you seen that team in Australia who has a point cloud rendering engine with insanely high resolution and unlimited scene complexity?

The one that's been in development over for 14 years by a questionable man with a severe victim complex? Don't get your hopes up.

Yep, that's the one.

This was a scientific data processing company that specialized in point cloud data from stuff like underground radar geological surveys, etc.

apparently they came up with a search algo that allows one to quickly determine which points to draw. the resolution is insanely high since its based on scientific apps (something like 25 or 100 or more points per INCH), and they're drawing entire Aztec type CITIES in real time. Unfortunately being a scientific company, they don't seem to really know what to do with this and make it work for games. I suspect that ram requirements for scene data are high. also, its probably only good for static scenes. Last I heard, they spent a YEAR writing a tool that converts a poly model to a point cloud model that they can then search with their algo.

Based on what i saw and read, it looked like it was yet another case of academia or science thinking they has something useful for games, when they have no clue about what games need.

what is it with people from other industries thinking they know how to do our jobs better than we do?

Norm Barrows

Rockland Software Productions

"Building PC games since 1989"

rocklandsoftware.net

PLAY CAVEMAN NOW!

http://rocklandsoftware.net/beta.php

well I have done real time clouds in my time as well. its not yet out in the product so its kind of a serious leak, i'm trying to take the dullest image i have and take off all the products giveaways so I can still kind-of post it here...

its working with fractal marching.

vivienclouds.jpg

well I have done real time clouds in my time as well. its not yet out in the product so its kind of a serious leak, i'm trying to take the dullest image i have and take off all the products giveaways so I can still kind-of post it here...
its working with fractal marching.

Very nice! I appreciate the extra effort you went to to show us that.

When i was looking over the resources at vterraing.org i noticed a lot of algos based on fractals.

Any idea what kind of drawing times your looking at?

Right now, i'm only using 20 particles and 20 drawcalls of 8 tri's each with no alphablend. I suspect I don't have a lot more clock cycles to spend on clouds.

I assume the clouds can move in real time based on wind speed and direction info from a weather engine, correct?

what about red sky at night? does your system do that as well?

so far it looks like atmospherics and maybe a fractal based cloud system may be the answer.

Norm Barrows

Rockland Software Productions

"Building PC games since 1989"

rocklandsoftware.net

PLAY CAVEMAN NOW!

http://rocklandsoftware.net/beta.php

This topic is closed to new replies.

Advertisement