Just a note: the pointer setIgnoreTransform() and the pointer to the SkyFactory code are not connected thoughts.
In fact, I thought it was strange that SkyFactory is NOT calling setIgnoreTransform()… and I half remember that sgold had some problems with setIgnoreTransform() and so opted a different solution.
Note also: for a lot of games, the camera does not move in x,z and the scene moves around it (like in 99% of my terrain based games) and in the case the sky already moves with the camera.
And just to round things out, for straight up math-based atmospheric effects I have my SimFX library:
attach a sky state, attach a lighting state… and get sky + sun.
Also with the ability to have atmospheric effects applied to regular Lighting.j3md style objects (graying/bluing with distance, etc.)
It’s what’s used in the sky for pretty much all of my recent demo videos, for example:
Edit: shortened integration example:
public class Main extends SimpleApplication {
static Logger log = LoggerFactory.getLogger(Main.class);
public static void main( String... args ) throws Exception {
Main main = new Main();
AppSettings settings = new AppSettings(true);
// Set some defaults that will get overwritten if
// there were previously saved settings from the last time the user
// ran.
settings.setWidth(1280);
settings.setHeight(720);
settings.setVSync(true);
settings.load("MOSS-Phys Demo");
settings.setTitle("MOSS-Phys Demo");
settings.setUseJoysticks(true);
main.setSettings(settings);
main.start();
}
public Main() {
super(new StatsAppState(), new DebugKeysAppState(), new BasicProfilerState(false),
new DebugHudState(),
new MemoryDebugState(),
new LightingState(),
new SkyState(true),
....
new ScreenshotAppState("", System.currentTimeMillis()));
}
public void simpleInitApp() {
setPauseOnLostFocus(false);
setDisplayFps(false);
setDisplayStatView(false);
....
SkyState sky = stateManager.getState(SkyState.class);
sky.getGroundColor().set(0.3f, 0.5f, 0.1f, 1);
// Set the time of day
LightingState lighting = stateManager.getState(LightingState.class);
float timeOfDay = 0.2f;
lighting.setTimeOfDay(timeOfDay);
lighting.setSunColor(ColorRGBA.White.mult(1.75f));
....
}
}
Key parts are the app states on the super constructor and in simpleInitApp() configuring settings other than the defaults.