Michaël Lemaire
a50b0a25c2
git-svn-id: https://subversion.assembla.com/svn/thunderk/paysages@486 b1fd45b6-86a6-48da-8261-f70d1f35bdcc
57 lines
1.9 KiB
C
57 lines
1.9 KiB
C
#include "private.h"
|
|
|
|
/*
|
|
* Atmosphere presets.
|
|
*/
|
|
|
|
void atmosphereAutoPreset(AtmosphereDefinition* definition, AtmospherePreset preset)
|
|
{
|
|
definition->sun_color.r = 1.0;
|
|
definition->sun_color.g = 0.95;
|
|
definition->sun_color.b = 0.9;
|
|
definition->sun_color.a = 1.0;
|
|
definition->sun_radius = 0.02;
|
|
definition->sun_halo_size = 0.3;
|
|
curveClear(definition->sun_halo_profile);
|
|
curveQuickAddPoint(definition->sun_halo_profile, 0.0, 1.0);
|
|
curveQuickAddPoint(definition->sun_halo_profile, 0.1, 0.2);
|
|
curveQuickAddPoint(definition->sun_halo_profile, 1.0, 0.0);
|
|
definition->humidity = 0.1;
|
|
|
|
switch (preset)
|
|
{
|
|
case ATMOSPHERE_PRESET_CLEAR_DAY:
|
|
definition->model = ATMOSPHERE_MODEL_BRUNETON;
|
|
definition->daytime = 0.4;
|
|
definition->dome_lighting = 0.6;
|
|
break;
|
|
case ATMOSPHERE_PRESET_CLEAR_SUNSET:
|
|
definition->model = ATMOSPHERE_MODEL_BRUNETON;
|
|
definition->daytime = 0.74;
|
|
definition->dome_lighting = 0.8;
|
|
definition->sun_radius = 0.03;
|
|
break;
|
|
case ATMOSPHERE_PRESET_HAZY_MORNING:
|
|
definition->model = ATMOSPHERE_MODEL_PREETHAM;
|
|
definition->daytime = 0.3;
|
|
definition->dome_lighting = 0.5;
|
|
definition->humidity = 0.3;
|
|
break;
|
|
case ATMOSPHERE_PRESET_FOGGY:
|
|
definition->model = ATMOSPHERE_MODEL_PREETHAM;
|
|
definition->daytime = 0.4;
|
|
definition->dome_lighting = 0.7;
|
|
definition->humidity = 0.6;
|
|
break;
|
|
case ATMOSPHERE_PRESET_STORMY:
|
|
definition->model = ATMOSPHERE_MODEL_PREETHAM;
|
|
definition->daytime = 0.4;
|
|
definition->dome_lighting = 0.3;
|
|
definition->humidity = 0.9;
|
|
break;
|
|
default:
|
|
;
|
|
}
|
|
|
|
AtmosphereDefinitionClass.validate(definition);
|
|
}
|