[Solved] Create earth with clouds and a atmosphere; Problems with materials

Hey ho,



i am trying to create a earth in space.



I have 3 sphere´s:

The first is for the earthmap.

The second is for the clouds.

The third is for the atmosphere.



This my code:



[java]//Earth

world = assetManager.loadModel("Models/World/World.j3o");

world.rotate(0, 90, 0);

world.setLocalTranslation(0, -200, 0);

world.scale(0.97f);



Material mat_w = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");

mat_w.setTexture("DiffuseMap", assetManager.loadTexture("Models/World/earth.jpg"));

//mat_w.setTexture("NormalMap", assetManager.loadTexture("Models/World/EarthSpec.png"));

world.setMaterial(mat_w);





//Clouds

world_clouds = assetManager.loadModel("Models/World/World.j3o");

world_clouds.rotate(0, 90, 0);

world_clouds.setLocalTranslation(0, -200, 0);



Material mat_c = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");

mat_c.setTexture("AlphaMap", assetManager.loadTexture("Models/World/cloud.jpg"));

mat_c.setBoolean("UseAlpha", true);

mat_c.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);



world_clouds.setQueueBucket(Bucket.Translucent);

world_clouds.setQueueBucket(Bucket.Transparent);

world_clouds.setMaterial(mat_c);





//Atmoshpere

Spatial world_at =assetManager.loadModel("Models/World/World.j3o");

world_at.scale(1.1f);

world_at.setLocalTranslation(0, -200, 0);



FilterPostProcessor fpp = new FilterPostProcessor(assetManager);

BloomFilter bloom = new BloomFilter(BloomFilter.GlowMode.SceneAndObjects);

bloom.setBloomIntensity(.08f);

bloom.setBlurScale(.2f);

bloom.setExposurePower(10f);

fpp.addFilter(bloom);

viewPort.addProcessor(fpp);



Material mat_at = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");

mat_at.setTexture("AlphaMap", assetManager.loadTexture("Models/World/default.jpg"));

mat_at.setBoolean("UseAlpha", true);

mat_at.setColor("GlowColor", ColorRGBA.Blue);



mat_at.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);

world_at.setQueueBucket(Bucket.Translucent);

world_at.setQueueBucket(Bucket.Transparent);

world_at.setMaterial(mat_at);





rotateNode.attachChild(world_clouds);

rotateNode.attachChild(world);

rotateNode.attachChild(world_at);[/java]



I have two different problems:

  1. If i activate load the bumpMap i dont have any shadows on the first sphere.

    [java]//mat_w.setTexture("NormalMap", assetManager.loadTexture("Models/World/EarthSpec.png"));[/java]
  2. My atmosphere sphere overwrites my clouds(no clouds visible).

    [java] world_at.scale(1.0f);[/java] Clouds invisible

    [java] world_at.scale(1.5f);[/java] Clouds visible, but the atmosphere is to far away
  1. Problem solved!



    instead of using the assetManager.loadModel(“Models/World/World.j3o”); i create a geom!

That’s awesome dude!
I was thinking about similar too.

Could you please upload you project somewhere or just send the full sources with textures to: sergpank [somewhere at] gmail.com

Thanks in advance!