Welcome to mirror list, hosted at ThFree Co, Russian Federation.

sunsky.h « include « intern « render « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 53151ca17ac2e6a95bee4a13848916bbc8616148 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/*
 * ***** 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,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 * Contributor(s): zaghaghi
 *
 * ***** END GPL LICENSE BLOCK *****
 */

/** \file blender/render/intern/include/sunsky.h
 *  \ingroup render
 */

#ifndef __SUNSKY_H__
#define __SUNSKY_H__

// #define SPECTRUM_MAX_COMPONENTS     100

typedef struct SunSky {
	short effect_type, skyblendtype, sky_colorspace;
	float turbidity;
	float theta, phi;

	float toSun[3];

	/*float sunSpectralRaddata[SPECTRUM_MAX_COMPONENTS];*/
	float sunSolidAngle;

	float zenith_Y, zenith_x, zenith_y;

	float perez_Y[5], perez_x[5], perez_y[5];

	/* suggested by glome in patch [#8063] */
	float horizon_brightness;
	float spread;
	float sun_brightness;
	float sun_size;
	float backscattered_light;
	float skyblendfac;
	float sky_exposure;
	
	float atm_HGg;

	float atm_SunIntensity;
	float atm_InscatteringMultiplier;
	float atm_ExtinctionMultiplier;
	float atm_BetaRayMultiplier;
	float atm_BetaMieMultiplier;
	float atm_DistanceMultiplier;

	float atm_BetaRay[3];
	float atm_BetaDashRay[3];
	float atm_BetaMie[3];
	float atm_BetaDashMie[3];
	float atm_BetaRM[3];
} SunSky;

void InitSunSky(struct SunSky *sunsky, float turb, const float toSun[3], float horizon_brightness,
                float spread, float sun_brightness, float sun_size, float back_scatter,
                float skyblendfac, short skyblendtype, float sky_exposure, float sky_colorspace);

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]);
void InitAtmosphere(struct SunSky *sunSky, float sun_intens, float mief, float rayf, float inscattf, float extincf, float disf);
void AtmospherePixleShader(struct SunSky *sunSky, float view[3], float s, float rgb[3]);
void ClipColor(float c[3]);

#endif /*__SUNSKY_H__*/