Set brightness / darkness of skybox

I am sure there is an easy way of doing this (at least, I hope there is): How can I change the brightness of the skybox to simulate day and night cycles without the need of loading new textures?

The skybox is created as follows:
private void addSkybox()
[java] {
String dir = “Textures/Sky/skybox/”;
Texture north =assetManager.loadTexture(dir + “1.jpg”);
Texture south = assetManager.loadTexture(dir + “3.jpg”);
Texture east = assetManager.loadTexture(dir + “2.jpg”);
Texture west = assetManager.loadTexture(dir + “4.jpg”);
Texture up = assetManager.loadTexture(dir + “6.jpg”);
Texture down = assetManager.loadTexture(dir + “5.jpg”);

    Spatial sky = SkyFactory.createSky(assetManager, west, east, north, south, up, down);
    //sky.scale(30000f);
    
    sceneNode.attachChild(sky);
    rootNode.attachChild(sceneNode);        
}[/java]

I have tried to change the textures I am loading, but as far as I can see, the ‘Texture.setBlendColor(ColorRGBA color)’ is not applicable anymore. What is the best approach to darken and lighten the skybox?

Thanks

The thing is you don’t want to just change the brightness…you want to change the colour pallet, provide a sunset, switch day sky to night stars, etc.

Really it calls for a custom shader of some sort…

Would simply using an ambient light work?

Nevermind… ambient lights probably don’t affect the skybox.

@husky said: I am sure there is an easy way of doing this (at least, I hope there is): How can I change the brightness of the skybox to simulate day and night cycles without the need of loading new textures?

The skybox is created as follows:
private void addSkybox()
[java] {
String dir = “Textures/Sky/skybox/”;
Texture north =assetManager.loadTexture(dir + “1.jpg”);
Texture south = assetManager.loadTexture(dir + “3.jpg”);
Texture east = assetManager.loadTexture(dir + “2.jpg”);
Texture west = assetManager.loadTexture(dir + “4.jpg”);
Texture up = assetManager.loadTexture(dir + “6.jpg”);
Texture down = assetManager.loadTexture(dir + “5.jpg”);

    Spatial sky = SkyFactory.createSky(assetManager, west, east, north, south, up, down);
    //sky.scale(30000f);
    
    sceneNode.attachChild(sky);
    rootNode.attachChild(sceneNode);        
}[/java]

I have tried to change the textures I am loading, but as far as I can see, the ‘Texture.setBlendColor(ColorRGBA color)’ is not applicable anymore. What is the best approach to darken and lighten the skybox?

Thanks

You will need to change skybox shader for this.

Okay, I will check it out. Thanks.