Hard Light Productions Forums
Off-Topic Discussion => Programming => Topic started 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)
-
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...
-
/me wonders if the program will be released.
-
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)
-
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?
-
It's a bit bland.
No, strike that, it's very bland.
-
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.
-
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?
-
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)
-
The terminator is very, very sharp on these latest ones. The previous images were better at that.
-
Hm, you're right. I'm not sure what changed that could be causing that, though.
-
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)
-
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.
-
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.
-
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
-
thats bs, look at pictures of gas giants :D
-
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?
-
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.
-
Like Terragen?
-
(http://img30.imageshack.us/img30/3866/2010511231912471.png)
I think this version of the first planet was better than the final product.
-
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
-
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.
-
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)
-
can it make... you know, continents? seas? or just really bland planets in different shades of brown? :blah:
-
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.
-
OH! I thought it was a procedural texture generator AND renderer. My bad.