Space

1. What is a RAR file

RAR is the native format of WinRAR archiver. Like other archives, RAR files are data containers, they store one or several files in the compressed form. After you downloaded RAR file from Internet, you need to unpack its contents in order to use it.

http://www.rarlab.com/rar_file.htm

;D

Whow… i expected everyone to know.
Well, next update i will use the .zip format.

HOLY FSM Someone doesn’t know what RAR is?

You must be part of that new younger generation everyone is scared of :persecutioncomplex:

If I recall you didn’t know what the command line was either… :persecutioncomplex:
How did you get past the registration filter? May be time to make it more difficult…

Well it’s not particularly hard to copy-paste a java sample and run it in Eclipse :stuck_out_tongue:

true enough

hehem
LOL!
You’re something like 18/19, aren’t you?!?

17 :persecutioncomplex:

Hey at least I know what the command line and RAR is :slight_smile:

I have picked up this project again, i have been doing some work on the planet generation algorithm (rewrote it).
Using 2 noise generators i can render planets with an 512 * 1024 texture within 600ms.

Preview:

Number 1 is supposed to be some sort of water planet with a few random islands.
Number 2 is some kind of carbon based planet close to the sun (lava planet).

So got any improvements for these planets?

Which method are you using to fit the texture fit the planet? I’m not seeing any obvious distortions, so I’m interested.

JME has this awesome class:


// Some textures
		ProceduralTextureGenerator pt = new ProceduralTextureGenerator(
		        heightMap);
		    pt.addTexture(new ImageIcon(TestTerrain.class.getClassLoader()
		                                .getResource("jmetest/data/texture/grassb.png")),
		                  -128, 0, 128);
		    pt.addTexture(new ImageIcon(TestTerrain.class.getClassLoader()
		                                .getResource("jmetest/data/texture/dirt.jpg")),
		                  0, 128, 255);
		    pt.addTexture(new ImageIcon(TestTerrain.class.getClassLoader()
		                                .getResource("jmetest/data/texture/highest.jpg")),
		                  128, 255,
		                  384);

		    pt.createTexture(256);

Basically, if you created your landscape image into greyscale (instead of your colour blend), loaded it as a heightmap in jme, then used that, it blends your terrain textures into the appropriate terrain levels… So instead of using a colour range, it would be more detailed. You could also use the greyscale map as a bumpmap, or use the same method to make a spec map (shiny oceans). As an addition, you could also use your same technique for planets to create a transparent cloud image and draw that sphere outside your current one for atmosphere [EDIT: see you already have, nice one!].

If you post the texture from your planet generation algorithm, I can dump it into the program for you, see what you think?

Thank you for your reply.
Very nice ideas, im going to read about them :slight_smile:

Im creating an (spherical) heightmap with this function:


    protected void GeneratePerlinTerrain(){
        int hloc;
        float s, t, nx, ny, nz, sinv, pi_s, pi_t;
        
        for(int y = 0; y < height; y++){
            hloc = y*width;
            t = (float)y/width;
            pi_t = t * SimpleMath.PI2f;
            sinv = SimpleMath.sinf(pi_t);
            nz=SimpleMath.cosf(pi_t);
                
            for(int x = 0; x < width; x++){
                s = (float)x/width;
                pi_s = s * SimpleMath.PI2f;

                nx=SimpleMath.cosf(pi_s)*sinv;
                ny=SimpleMath.sinf(pi_s)*sinv;
                
                renderPixel(hloc+x, nx, ny, nz);
            }
        }
    }

The rendered sphere was just an UVSphere, but now i am working at an IcoSphere, so i can transform the globe nicely.
Im still thinking about how to render the terrain (especially when zooming in).
My main concern would be the level of detail when fully zoomed out:

Im not using images to create the texture, everything goes straight towards the texture buffer.
But i have made it possible to export the data to an image, so here you go, i am curious how it would look:

Grayscale:

Heres what I got as output:

And heres a render using that texture:

And I tried inverting the original map and using that as a spec map, but I didnt understand the settings so it overexposed most times, got this nice shot though:

Uh, the image export was in an odd size, sorry about that!

It looks better then expected, i guess i need to look into texturing then.
Would also be an much nicer transition when zooming into the planet.
Thanks for the help + info.

I have added some of the specular stuff you was talking about:

It looks very good, however i think messed somethign up, the reflection does not come so close to the shadow in real life.
Starting to realize my shader code is total nonsence :stuck_out_tongue_winking_eye:

Specular light comes from the brightness of the light source, so it should be pointing towards the light source, right? ???

Its an combination of viewing angle and light source, but i think i got it now:
I also tryd to take in account water reflects alot, and land almost does not reflect at all.

Next step: heightmap, bumbmap, and “glowmap” or something for planets on fire.
Any comments are welcome :slight_smile:

Looking good. Looking forward to pictures with the things you mentioned :slight_smile:

Me to =)

I have added an function to distort the planet (just added random noise, to achieve an exaggerated effect):
Note: the normals are not updated with this noise, i need to figure out how to create some nice normals for this effect.

Looks kinda cool, and can be nice if i scale the effect down.
I guess im at an fork now: cartoonish or realistic…

Version with some normals:

pls add gamma to your shader, otherwise the lighting looks so wrong :smiley:
just change the last line to


   gl_FragColor = pow(color, 1. / 2.2);

update: did a quick search about what BRDF one should use for planets :slight_smile: found a nice thesis with excatly this problem: http://www.frc.ri.cmu.edu/~uyw/pubs/uyw_thesis_final.pdf

The finding was this:
Considering only the four “traditional” graphics models: limestone, granite and Spectralon are
Lambertian; coal, sandstone, JSC-1A, and CMU-1 are Torrance and gunite is an Oren-Nayar material. [J]ust three BRDFs –
Lambertian, Oren-Nayar, and Torrance – are sufficient to span the reflective space of the domain.

update2:
to get realistic specular reflection of water on a planet you should use lean mapping:http://www.csee.umbc.edu/~olano/papers/lean/