Class ScenePresets
Complete looks: a sun, the sky's light, fog, tone mapping, post effects
and a matching Sky dome, tuned to work together. Start from one and
adjust; every part is an ordinary object you can change.
import com.codename1.gpu.*;
import com.codename1.gpu.shaders.ScenePresets;
void frame(GraphicsDevice device, int w, int h) {
ScenePresets.Preset look = ScenePresets.harbourDusk();
look.apply(device);
Material dome = new Material(Material.Type.UNLIT).setShader(look.getSky()).setFogged(false);
// per frame, after drawing the scene:
device.beginPostProcess(look.getPost(), w, h);
}
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA light, environment, post chain and sky dome that belong together. -
Method Summary
Modifier and TypeMethodDescriptionstatic ScenePresets.Presetarctic()Arctic: a low pale sun, blue-white snow light from everywhere, cold grade.static ScenePresets.PresetBright midday: a high white sun, blue sky light, crisp shadows.static ScenePresets.Presetdesert()Desert: a harsh white sun, hot sand bouncing light into the shadows, heat haze on the horizon.static ScenePresets.PresetGolden hour by the sea: a low warm sun across the water, a deep blue sky lighting the shadows, light haze, and a soft bloom on the highlights.static ScenePresets.Presetnight()Night: cold moonlight, deep blue shadows, strong bloom for lamps and emissive surfaces.static ScenePresets.Presetovercast()Overcast: no hard shadows to speak of, flat grey light, thick haze.
-
Method Details
-
harbourDusk
Golden hour by the sea: a low warm sun across the water, a deep blue sky lighting the shadows, light haze, and a soft bloom on the highlights.
Returns
a new preset
-
clearNoon
Bright midday: a high white sun, blue sky light, crisp shadows.
Returns
a new preset
-
overcast
Overcast: no hard shadows to speak of, flat grey light, thick haze.
Returns
a new preset
-
night
Night: cold moonlight, deep blue shadows, strong bloom for lamps and emissive surfaces.
Returns
a new preset
-
desert
Desert: a harsh white sun, hot sand bouncing light into the shadows, heat haze on the horizon.
Returns
a new preset
-
arctic
Arctic: a low pale sun, blue-white snow light from everywhere, cold grade.
Returns
a new preset
-