Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

In Maxwell Render the sky can be defined though one of the following sky types:

...


The environment is defined using the following Cmaxwell member functions:

Physical sky

Code Block
byte  setPhysicalSkyGeometry( real longitude, real latitude, int sm, dword dayOfYear, real timeOfDay, real basisRotation );

// Longitude: from -180.0 to 180.0; default = your city
// Latitude: from -90.0 to 90.0; default = your city
// Sm: from -12 to 12; default 0;
// dayOfYear: from 1 to 365; default 100;
// timeOfDay: from 0.0 to 24.0; default 17;
// basisRotation: from 0 to 2PI radians (it is in radians)

byte    setPhysicalSkySunAngles( real zenith, real azimuth );

// It is an alternative way to set the sun position based on spheric angles
// Call this function after setPhysicalSkyGeometry and longitude and latitude parameters will be overriden


byte    setPhysicalSkySunDirection( Cvector dir );

// It is an alternative way to set the sun position based on a direction
// Call this function after setPhysicalSkyGeometry and longitude and latitude parameters will be overriden

byte    setPhysicalSkySun( byte sunActive, real sunTemperature, real sunPowerScaleFactor, real planetReflectance );

// SunActive: 0 or 1, by default sun is enabled (1)
// sunTemperature: in kelvins.
// Default 5777. Range: 100 - 1000000
// sunPowerScaleFactor: total power refered to the Earth's sun.
// For example a value of 0.8 would mean a sun emititng 0.8 times less energy than ours.
// Default: 1.0. Range: Is allowed any value greater than 0.
// planetReflectance: from 0 to 1


byte    setPhysicalSkyAtmosphere( real ozone, real water, real angstromTurbidity, real wavelengthTurbidity, real aerosolAlbedo, real asymmetryFactor );

// ozone: ( cms ) Default: 0.4 Range: Any value greated than 0 (usually between 0 and 1)
// water: water vapor ( cms ) Default: 2.0 Range: Any value greated than 0
// angstrom turbidity: coefficient Default: 0.04 Range: Any value greated than 0
// wavelength turbidity exponent Default: 1.2 Range: Any value greated than 0
// aerosolAlbedo: aerosol albedo Default: 0.8 Range: (0-1)
// asimmetryFactor: "anisotropy" of aerosol. Default: 0.7. Range (-0.99999, 0.99999);

...

Code Block
byte getSunDirection( Cvector &dir );
byte getSkyColor( Crgb8 &rgb, Cvector &dir );
void getSundirection ( Cvector& dir );
void getSundirection ( Crgb8 &rgb, Cvector& dir );

Constant sky

Code Block
void setSkyConstant ( Crgb &color,       // sky color
                      real radiance,     // Default = 5.0, range
                      byte useSun = 0 ); // Radiance: from 0.0 to 1000000. Default = 50.0.

...

Info

Always check that the RGB colors are in float precision. RGB colors in the 0-255 range should be normalized diving them by 255.0 before passing them to Maxwell

Image based environment

To enable the image based environment, all that is needed is to call this function setting the parameter “isEnabled” to true:

...