Hard Light Productions Forums

Off-Topic Discussion => Programming => Topic started by: Aardwolf on May 12, 2010, 02:19:32 pm

Title: PlanetMaker Program
Post by: Aardwolf on May 12, 2010, 02:19:32 pm
Originally shown in the Celestial Objects Thread (http://www.hard-light.net/forums/index.php?topic=41939.msg1371388), I decided this was starting to be kind of a thread-hog (especially considering that between the different versions there isn't all that much changed).

I've added quasi-adaptive multi-sample antialiasing. Basically, it goes through and figures out how many samples to use for each texel, based on how close the ray through the center of that texel comes to the edge of the planet. Closer to the edge means more samples. Then it goes through the texture (i.e. the result) again, and for each texel it does that many samples, averages the colors of each sample in that texel, and converts the result to the pixel format (4 unsigned bytes).

Sample result:

(http://img245.imageshack.us/img245/8623/2010512151628415.png)
Title: Re: PlanetMaker Program
Post by: Enigmatic Entity on May 12, 2010, 08:34:04 pm
Is it easier to use this than draw it in GIMP? I have no idea how to use GIMP properly at the moment, and the planet tutorials are long...
Title: Re: PlanetMaker Program
Post by: BloodEagle on May 12, 2010, 11:13:57 pm
/me wonders if the program will be released.
Title: Re: PlanetMaker Program
Post by: Aardwolf on May 13, 2010, 12:20:32 am
I'm still experimenting with a lot of things.

Speaking of which, here's an experimental sickly-greenish planet:

(http://i93.photobucket.com/albums/l77/Aardwolf001/Planets/2010-5-13-1-14-51-571.png)
Title: Re: PlanetMaker Program
Post by: Enigmatic Entity on May 13, 2010, 07:41:26 am
That is a disgusting planet - imagine what species you'd find on that! :tongue: - Actually, I haven't seen a planet like that in FS2 or similar, it would make for an interesting campaign, perhaps?
Title: Re: PlanetMaker Program
Post by: The E on May 13, 2010, 08:02:37 am
It's a bit bland.

No, strike that, it's very bland.
Title: Re: PlanetMaker Program
Post by: Aardwolf on May 13, 2010, 12:06:11 pm
Hm yeah, needs some more detail. I changed the texture mapping so that the u axis now corresponds to longitude and the v axis corresponds to latitude. That said, it's very hard to edit a 2D texture and have the scale, proportions, etc. match the 3d sphere properly.
Title: Re: PlanetMaker Program
Post by: Retsof on May 13, 2010, 03:10:52 pm
Quote
it's very hard to edit a 2D texture and have the scale, proportions, etc. match the 3d sphere properly.
Mabe something that imitates the polar coordinates filter in GIMP?
Title: Re: PlanetMaker Program
Post by: Aardwolf on May 13, 2010, 07:10:54 pm
Problem is I would need to somehow transform the brushes/filters/stuff... Using a round brush in an area where the texture is stretched, for example, would make an oppositely stretched shape on the planet. And that's no good.

Also, another big render of that green thing.

http://img269.imageshack.us/img269/8601/2010513201104.png crummy version

I haven't made any significant changes to the appearance, but I've been working on the code a bunch. I'm noticing some weird vertical lines, though... originally I thought that there was something wrong with my texture filtering, but now I'm thinking it's just the limitation of 256 possible height values not playing nicely with the lighting. :blah:

Edit: GTFO, ugly image! A good render's ready:

(http://img191.imageshack.us/img191/5651/201051402112691.png)
Title: Re: PlanetMaker Program
Post by: FreeSpaceFreak on May 14, 2010, 01:51:43 am
The terminator is very, very sharp on these latest ones. The previous images were better at that.
Title: Re: PlanetMaker Program
Post by: Aardwolf on May 14, 2010, 11:08:10 am
Hm, you're right. I'm not sure what changed that could be causing that, though.
Title: Re: PlanetMaker Program
Post by: BloodEagle on May 14, 2010, 03:10:57 pm
Is this rendering an actual 3d object? Or is it an extension/expansion/rewrite/etc. of the planet-making script for GIMP?

Is it possible to have the light hit it at a less steep angle? (E.g., slightly off-center)
Title: Re: PlanetMaker Program
Post by: Aardwolf on May 14, 2010, 07:01:26 pm
I'm not sure what you're asking, but... it's a raytracing of a perfect sphere (i.e. defined by an equation rather than polygons), using a cubemap (now, earlier I had other schemes for texturing it) for the textures. It has nothing to do with GIMP.

And I don't know what you mean with that second part.
Title: Re: PlanetMaker Program
Post by: Nuke on May 17, 2010, 07:32:54 pm
im gonna have to burst youre bubble by telling you that planets usually arent perfect spheres  :D

you should also consider using fractals to generate youre bumpmapping data, it could generate more natural looking terrain.
Title: Re: PlanetMaker Program
Post by: FreeSpaceFreak on May 18, 2010, 01:37:06 am
im gonna have to burst youre bubble by telling you that planets usually arent perfect spheres  :D
Yeah, but that difference ain't visible to the human eye :P
Title: Re: PlanetMaker Program
Post by: Nuke on May 18, 2010, 10:17:13 am
thats bs, look at pictures of gas giants :D
Title: Re: PlanetMaker Program
Post by: watsisname on May 19, 2010, 08:27:00 pm
Bah, that's just oblateness, nobody gives a **** about that. :P
It should all be about the smoothness/roughness.  Fractal terrain heightmap would be nice, but how would you go about matching that to the surface texture without it looking stupid?
Title: Re: PlanetMaker Program
Post by: LordMelvin on May 19, 2010, 08:44:36 pm
Fractal terrain heightmap would be nice, but how would you go about matching that to the surface texture without it looking stupid?

you semi-procedurally generate the surface texture from the fractal heightmap, based on the absolute height and rate of change (slope). High points are color x, say, ffffff, low points are color y, say blue, median points are a blend of, say, greens and browns, based on a different fractal form. Tweak the procedural processes for artistry, et voila, bluemarble, just add clouds.
Title: Re: PlanetMaker Program
Post by: Aardwolf on May 20, 2010, 11:56:07 pm
Like Terragen?
Title: Re: PlanetMaker Program
Post by: Snail on June 02, 2010, 02:45:00 pm
(http://img30.imageshack.us/img30/3866/2010511231912471.png)

I think this version of the first planet was better than the final product.
Title: Re: PlanetMaker Program
Post by: watsisname on June 09, 2010, 02:41:29 pm
I agree with Snail, it's the best looking rendition thus far put forth in my opinion.  
Me want see moar be done this with.  :D

Also, Aard, I want to reiterate my desire to see you try this out with a Mars texture. /me makes suggestive gestures  ;7
Title: Re: PlanetMaker Program
Post by: qazwsx on June 15, 2010, 05:42:01 am
Like Terragen?
Terragen 2 is completely procedural IIRC...

Actually, you could probably knock up a renderman shader without too much hassle, micropolygon rendering+displacement FTW

Will experiment.
Title: Re: PlanetMaker Program
Post by: Aardwolf on June 30, 2010, 09:11:30 pm
Here's a screenshot from a realtime thing I made using GLSL... crummier atmosphere, and a funky outline. And no AA. Hm bleh.

(http://i93.photobucket.com/albums/l77/Aardwolf001/Planets/sicklycoloredplanetoomph.png)

And also the cubemap for that ugly thing.

(http://img19.imageshack.us/img19/4605/derpyderpucubemapoomph.png)
Title: Re: PlanetMaker Program
Post by: redsniper on July 06, 2010, 03:40:47 pm
can it make... you know, continents? seas? or just really bland planets in different shades of brown? :blah:
Title: Re: PlanetMaker Program
Post by: Aardwolf on July 06, 2010, 05:50:04 pm
It can't make continents, seas, or bland planets in different shades of brown. It's not making the texture, it's rendering the planet. I made the texture myself... although I did add a few utility functions to make it easier to modify cubemap textures without introducing significant distortion.
Title: Re: PlanetMaker Program
Post by: redsniper on July 07, 2010, 12:24:54 pm
OH! I thought it was a procedural texture generator AND renderer. My bad.