Planetary code
Moderators: ghoulsblade2, strook
Re: Planetary code
Just a quick status update. Looking for atmosphere and terrain shading I checked Sean O'Neal's stuff and decided to reuse some of the code (shaders, texture updates), started isolating/porting the code.
I think even his mesh gen method could be an interesting alternative to the OgrePlanet mesher. Atm it is way too slow, draws a bazillion of tiny meshes and is not threaded.
The minimum target is to use his shaders at least.
Some pics(not in VS yet):
I think even his mesh gen method could be an interesting alternative to the OgrePlanet mesher. Atm it is way too slow, draws a bazillion of tiny meshes and is not threaded.
The minimum target is to use his shaders at least.
Some pics(not in VS yet):
-
- Elite
- Posts: 1567
- Joined: Tue Jan 26, 2010 2:03 am
Re: Planetary code
Have you looked to see if any of the other codebases use any type of grey scale height maps? I know several different games (notably Warzone2100 and SimCity 4) can import greyscale bitmaps to create the terrain used in those games. Im wondering if we will need to use something like that to create how we want the planets to look. Not sure how many we would need to keep from having all the planets look the same though.
Because of YOU Arbiter, MY kids? can't get enough gas. OR NIPPLE! How does that mkae you feeeel? ~ Halo
Re: Planetary code
You would need a few GB of height data(nasa blue marble) to get the details at planetary scale. OgrePlanet and O'Neal's code are using fractal noise. You define the height generator by linking different noise modules and providing a set of parameters. The height values are generated on the fly depending on your current position.
Re: Planetary code
A planet creator/editor where you can play with the noise modules with interactive preview would be cool I think. But need to finish the planet code first.
Something like this: http://lithosphere.codeflow.org/screenshots.html
Something like this: http://lithosphere.codeflow.org/screenshots.html
-
- Elite
- Posts: 1567
- Joined: Tue Jan 26, 2010 2:03 am
Re: Planetary code
If we can have height maps in sections we could have a good number and just reuse some of them. Have a struct/class to hold the values of what maps could or should be used with what type of planet to put the whole world together rather than one giant map. Using fractal noise how do we handle adding in vegetation, rivers, cities, etc?
Because of YOU Arbiter, MY kids? can't get enough gas. OR NIPPLE! How does that mkae you feeeel? ~ Halo
Re: Planetary code
The fractal stuff is just a dynamically generated(loaded) height map. You can see it as a compression method. The problem about using pregenerated height maps is the data amount. For a one km^2 resolution heightmap of the earth surface you would need about 500MB data for one byte height(80m height resolution?).Using fractal noise how do we handle adding in vegetation, rivers, cities, etc?
Update:
I've got O'Neals scattering shaders running. The only blocker right now is the blending(sky mesh). It is stupid simple in OpenGL, but I have problems to get it right in Ogre3D.
-
- Elite Mercenary
- Posts: 1329
- Joined: Thu Mar 27, 2003 11:51 pm
- Location: Manchester, UK
- Contact:
Re: Planetary code
Awesome work log0, can't wait to see screenshots. May try to compile it in a few days - is this work being done in the vegaogre repo? No commits for 2 weeks there.
Free Gamer - free software games compendium and commentary!
FreeGameDev forum - open source game development community
FreeGameDev forum - open source game development community
-
- Expert Mercenary
- Posts: 893
- Joined: Thu Jul 08, 2010 11:43 pm
- Location: Sol III North American Continent
Re: Planetary code
Some questions:
- Any idea when this might have an already compiled version posted?
- Is the sun positioning derived from the actual position of the local star(s)?
- Any plans of adding lens flairs with Ogre?
- What is the possibility of including both the Ogre and the VS in-house engines with a line in the config (and possibly a toggle in setup) and switching between the two?
-
- Elite
- Posts: 7243
- Joined: Mon Apr 18, 2005 2:40 pm
- Location: LS87, Buenos Aires, República Argentina
Re: Planetary code
They would have to be equivalent for that to work. Even same API.travists wrote:What is the possibility of including both the Ogre and the VS in-house engines with a line in the config (and possibly a toggle in setup) and switching between the two?
Are they?
I doubt.
A compile-time flag might be easier.
Re: Planetary code
The code is in the vegastrike experimental branch.
The scattering/atmosphere patch is blocked by the blending issue.
Light direction(sun position in the sky) is the vector from central star to planet, depends on planet position, rotation.
Enabling ogre planet rendering can be done at runtime(vs start). I think BEZ meant he had implemented it for his gravity work.
Next targets are:
Implement normal/color texture cache(per vertex normals look ugly).
Fix the camera issue(move vessel drawing into ogre).
Implement a few different planet types(config file per planet type?).
Port the sun/star shader to glsl, experiment with it.
The scattering/atmosphere patch is blocked by the blending issue.
Light direction(sun position in the sky) is the vector from central star to planet, depends on planet position, rotation.
Enabling ogre planet rendering can be done at runtime(vs start). I think BEZ meant he had implemented it for his gravity work.
Next targets are:
Implement normal/color texture cache(per vertex normals look ugly).
Fix the camera issue(move vessel drawing into ogre).
Implement a few different planet types(config file per planet type?).
Port the sun/star shader to glsl, experiment with it.
-
- Bounty Hunter
- Posts: 153
- Joined: Sat Oct 22, 2011 9:17 am
Re: Planetary code
how is terrain generating going to be handled? will we be able to use images to generate the terrain? i am not too worried about map height, but with earth, for example, it would be good to have all the countries. I know size would be an issue for a detailed map, but what about a 10km^2 map, should detect almost every island on earth, and the size shouldn't be too big.
Or could it be possible to have it load a few seperate images of the land masses, and fill in the rest with water, would reduce images sizes by about half i would assume, with 70% of earth being water
Or could it be possible to have it load a few seperate images of the land masses, and fill in the rest with water, would reduce images sizes by about half i would assume, with 70% of earth being water
-
- Expert Mercenary
- Posts: 893
- Joined: Thu Jul 08, 2010 11:43 pm
- Location: Sol III North American Continent
Re: Planetary code
Honestly, I think both methods (height map & fractal) are needed. In Sol: Mars, Luna (Earth's Moon), and Earth it's self all have detailed maps available, and are fairly well known. As such if planetary flight is used, people will expect accuracy, there are also other key planets that specific maps would be nice I'm sure. Conversely, to map every planet would take a huge amount of data and is thus impractical even if there where the artists available to create the content. The only logical solution is to use both methods as appropriate.
-
- Elite
- Posts: 7243
- Joined: Mon Apr 18, 2005 2:40 pm
- Location: LS87, Buenos Aires, República Argentina
Re: Planetary code
Not only that.
One might want to craft some planets in a certain specific way, but not necessarily in full detail. Combining height map data with fractals seems like the best bet: gross shape given by height map, details by fractal.
One might want to craft some planets in a certain specific way, but not necessarily in full detail. Combining height map data with fractals seems like the best bet: gross shape given by height map, details by fractal.
-
- Bounty Hunter
- Posts: 153
- Joined: Sat Oct 22, 2011 9:17 am
Re: Planetary code
wonder if this can be tied into the game, http://en.wikipedia.org/wiki/Celestia for some more realistic simulation of the solar system, and some nice textures
-
- Elite
- Posts: 7243
- Joined: Mon Apr 18, 2005 2:40 pm
- Location: LS87, Buenos Aires, República Argentina
Re: Planetary code
VS is already using textures from celestia whenever possible (ie: allowed by their license)
Re: Planetary code
Atmosphere shader patch is here(source+data): https://sourceforge.net/tracker/?func=d ... tid=319507
It has got a few bugs to be adressed, but runs at least(ATI card). Would be great to get some feedback if it runs on other GPUs.
It has got a few bugs to be adressed, but runs at least(ATI card). Would be great to get some feedback if it runs on other GPUs.
Re: Planetary code
New clips:
http://www.youtube.com/watch?v=abb5ZwLmfjQ
http://www.youtube.com/watch?v=W1upvzYYLc0
Unfortunately the blue sky is not really visible due to blending with the bright background skybox.
http://www.youtube.com/watch?v=abb5ZwLmfjQ
http://www.youtube.com/watch?v=W1upvzYYLc0
Unfortunately the blue sky is not really visible due to blending with the bright background skybox.
Last edited by log0 on Mon Jan 16, 2012 6:33 pm, edited 1 time in total.
-
- Expert Mercenary
- Posts: 893
- Joined: Thu Jul 08, 2010 11:43 pm
- Location: Sol III North American Continent
Re: Planetary code
Atmospheric glow is great, but should stars be visible on the day side like that? does not look like you're flying high enough for that anyway. Atlantis will be eventually mostly water not desert right?
Re: Planetary code
Here a pic with black background(screaming for some hdr processing lol):
-
- Expert Mercenary
- Posts: 893
- Joined: Thu Jul 08, 2010 11:43 pm
- Location: Sol III North American Continent
Re: Planetary code
Quite good! Can the volumetrics be used to further blot out the background, or would it be better to use a black sphere that is only visible from the under side?
Re: Planetary code
To fix the sky issue one would need backgrounds with somewhat realistic light intensities(not the current cartoonish ones) and hdr rendering maybe.
Or just ditch the backgrounds(I know ain't gonna happen).
Or just ditch the backgrounds(I know ain't gonna happen).
-
- Elite
- Posts: 7243
- Joined: Mon Apr 18, 2005 2:40 pm
- Location: LS87, Buenos Aires, República Argentina
Re: Planetary code
I was actually thinking about ditching backgrounds in a number of systems.
In fact, I was thinking of adding nebulae entries to galaxy.xml, that would be used in the system generator to decide which sky to use: black when far from nebulae, some nice and consistent background when close or inside them.
Would anyone help me there? (we could use specially crafted backgrounds for that).
In fact, I was thinking of adding nebulae entries to galaxy.xml, that would be used in the system generator to decide which sky to use: black when far from nebulae, some nice and consistent background when close or inside them.
Would anyone help me there? (we could use specially crafted backgrounds for that).
-
- Expert Mercenary
- Posts: 893
- Joined: Thu Jul 08, 2010 11:43 pm
- Location: Sol III North American Continent
Re: Planetary code
There was an idea floated about where the stars make their own background. Will Nebulae be of realistic size (I.E. light-years across) where they could be done the same?
-
- Elite
- Posts: 7243
- Joined: Mon Apr 18, 2005 2:40 pm
- Location: LS87, Buenos Aires, República Argentina
Re: Planetary code
Yes, but we need lots of new features and content to pull that off.
However, just modifying the way the system generator picks backgrounds is easier.
We could go for the better option entirely anyway. Which is defining light-years-across nebulae in galaxy.xml, define meshes for them, and render them on the background instead of merely a skybox. That will take time, though.
However, just modifying the way the system generator picks backgrounds is easier.
We could go for the better option entirely anyway. Which is defining light-years-across nebulae in galaxy.xml, define meshes for them, and render them on the background instead of merely a skybox. That will take time, though.