SimpleWater surface on Sphere

I am trying to animate Sun in Solar System simulation and, was wondering if i can apply water on sphere. So far, all i have is that surface of the sphere i properly moving, and waving but problem is that, it is black with reflections from skybox. But i want to change the material that i got from waterprocessor, and apply texture what i want, not skybox reflection, and add some glow to it. Here is the code i have so far:


Sphere sphere = new Sphere(32, 32, 5.0f);

Geometry star = new Geometry(“Sun”, sphere);


SimpleWaterProcessor waterProcessor = new SimpleWaterProcessor(assetManager);





Material mat = waterProcessor.getMaterial();




I have tried modifying the material like this:

mat.setTexture(“water_reflection”, assetManager.loadTexture(“Textures/Sun.png”)); //sun texture which i have found somewhere

But with no results. I have tried looking into source code of SimpleWaterProcessor and SimpleWater.j3md and figured out that nearly everything is going on in shaders, but I dont understand how, or what can I change to get desired effects. Thanks

You could try adding another skybox as the reflection node to the processor. The trick is not to add this skybox to the rootnode or any other subnode that is going to be on the scene-graph.

the structure could look like this:


→ skybox (starfield or something else)

reflectionnode (not added to the scene graph. Instead set as reflection node on the processor)

→ red shiny skybox

Just a theory.^^

btw. If the reflection is black try adding an ambient light to the reflection node. I don’t know if the skybox needs a light to appear.

Hm actually a quite intresting approach to do the sun, could look quite nice. If you get this to work correctly, could you share some pictures?

The issue is that the reflection is expected to be a plane. To get “surround” reflections the reflection cam would have to have extreme (360°) frustum settings.

what about 2 cams with 180° wouldn’t that be possible?

Yeah sure, you’d have to combine the images in the shader or before though. Also theres gonna be distortions on the borders possibly.