2011-02-23 23:22:25 +00:00
|
|
|
/*
|
2008-07-03 10:38:35 +00:00
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2008-07-03 10:38:35 +00:00
|
|
|
*
|
|
|
|
|
* Contributor(s): zaghaghi
|
|
|
|
|
*
|
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
|
*/
|
2011-02-27 19:31:27 +00:00
|
|
|
|
|
|
|
|
/** \file blender/render/intern/include/sunsky.h
|
|
|
|
|
* \ingroup render
|
|
|
|
|
*/
|
|
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#ifndef __SUNSKY_H__
|
|
|
|
|
#define __SUNSKY_H__
|
2008-07-03 10:38:35 +00:00
|
|
|
|
2012-09-06 00:33:59 +00:00
|
|
|
// #define SPECTRUM_MAX_COMPONENTS 100
|
2008-07-03 10:38:35 +00:00
|
|
|
|
2012-06-06 22:38:39 +00:00
|
|
|
typedef struct SunSky {
|
2010-03-22 09:30:00 +00:00
|
|
|
short effect_type, skyblendtype, sky_colorspace;
|
|
|
|
|
float turbidity;
|
|
|
|
|
float theta, phi;
|
2012-03-09 00:41:09 +00:00
|
|
|
|
2010-03-22 09:30:00 +00:00
|
|
|
float toSun[3];
|
2008-07-03 10:38:35 +00:00
|
|
|
|
2010-03-22 09:30:00 +00:00
|
|
|
/*float sunSpectralRaddata[SPECTRUM_MAX_COMPONENTS];*/
|
|
|
|
|
float sunSolidAngle;
|
2008-07-03 10:38:35 +00:00
|
|
|
|
2010-03-22 09:30:00 +00:00
|
|
|
float zenith_Y, zenith_x, zenith_y;
|
2012-03-09 00:41:09 +00:00
|
|
|
|
2010-03-22 09:30:00 +00:00
|
|
|
float perez_Y[5], perez_x[5], perez_y[5];
|
2008-07-03 10:38:35 +00:00
|
|
|
|
2012-10-27 01:46:47 +00:00
|
|
|
/* suggested by glome in patch [#8063] */
|
2010-03-22 09:30:00 +00:00
|
|
|
float horizon_brightness;
|
|
|
|
|
float spread;
|
|
|
|
|
float sun_brightness;
|
|
|
|
|
float sun_size;
|
|
|
|
|
float backscattered_light;
|
|
|
|
|
float skyblendfac;
|
2008-09-29 17:03:24 +00:00
|
|
|
float sky_exposure;
|
2008-09-21 16:04:33 +00:00
|
|
|
|
2010-03-22 09:30:00 +00:00
|
|
|
float atm_HGg;
|
2008-07-03 10:38:35 +00:00
|
|
|
|
2010-03-22 09:30:00 +00:00
|
|
|
float atm_SunIntensity;
|
|
|
|
|
float atm_InscatteringMultiplier;
|
|
|
|
|
float atm_ExtinctionMultiplier;
|
|
|
|
|
float atm_BetaRayMultiplier;
|
|
|
|
|
float atm_BetaMieMultiplier;
|
|
|
|
|
float atm_DistanceMultiplier;
|
2008-07-03 10:38:35 +00:00
|
|
|
|
2010-03-22 09:30:00 +00:00
|
|
|
float atm_BetaRay[3];
|
|
|
|
|
float atm_BetaDashRay[3];
|
|
|
|
|
float atm_BetaMie[3];
|
|
|
|
|
float atm_BetaDashMie[3];
|
|
|
|
|
float atm_BetaRM[3];
|
2012-03-09 00:41:09 +00:00
|
|
|
} SunSky;
|
2008-07-03 10:38:35 +00:00
|
|
|
|
2012-10-15 09:11:17 +00:00
|
|
|
void InitSunSky(struct SunSky *sunsky, float turb, const float toSun[3], float horizon_brightness,
|
2012-04-29 15:47:02 +00:00
|
|
|
float spread, float sun_brightness, float sun_size, float back_scatter,
|
2012-03-09 00:41:09 +00:00
|
|
|
float skyblendfac, short skyblendtype, float sky_exposure, float sky_colorspace);
|
2008-07-03 10:38:35 +00:00
|
|
|
|
2012-03-09 00:41:09 +00:00
|
|
|
void GetSkyXYZRadiance(struct SunSky *sunsky, float theta, float phi, float color_out[3]);
|
|
|
|
|
void GetSkyXYZRadiancef(struct SunSky *sunsky, const float varg[3], float color_out[3]);
|
2008-07-03 10:38:35 +00:00
|
|
|
void InitAtmosphere(struct SunSky *sunSky, float sun_intens, float mief, float rayf, float inscattf, float extincf, float disf);
|
2012-03-11 19:09:01 +00:00
|
|
|
void AtmospherePixleShader(struct SunSky *sunSky, float view[3], float s, float rgb[3]);
|
2008-07-03 10:38:35 +00:00
|
|
|
void ClipColor(float c[3]);
|
|
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#endif /*__SUNSKY_H__*/
|