Day and Night Help

Hello everyone :slight_smile:

I am new to the jMonkey engine and I’m trying my best to create my first FPS game :smiley:
I would like some help in how to make my sky, change from day to night and the opposite:)

I have found some skies created in blender which look like a ball but I haven’t been able to place them in my scene in jMonkey.

Thanks in advance :slight_smile:

Have you looked at How to add a Sky to your Scene ?

I have seen this tutorial and I have successfully added a SkyDome in my scene. I cannot figure out how to make this SkyDome turn into night from inside the code. I must find another SkyDome which is night? Or can I lower the brightness of the current SkyDome, to make it look like night?

Some people have a series of images and exchange it. Others modify the image.
Ways to modify the image, from least to most technically challenging:

  • Have Java modify the pixels. There’s a JME plugin (well, library actually) that you can use for that, it’s pretty optimized (I forgot the name unfortunately but it’s linked from the plugins section here on the site).
  • Use a palette image. This typically reduces the number of available colors to 256, which tends to create visible artifacts on images with smooth color changes, and most (not all) skybox images have that. So it’s rare that people do that, but color manipulation is faster because you touch only the palette data. The image still needs to be uploaded to the GPU so the speedup isn’t THAT large, and I haven’t seen this done in practice.
  • Use a fragment shader with a parameter that gives the time of day, and let the shader transform the skybox colors. Lots of design options with that one.

Then there is also the way of calcualting your entire skydome in the shader based on a few paramters, i think someone was doing that. Eg use noise for clouds ect from the very lowest basics completly procedual