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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'intern/sky/source/sky_nishita.cpp')
-rw-r--r--intern/sky/source/sky_nishita.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/intern/sky/source/sky_nishita.cpp b/intern/sky/source/sky_nishita.cpp
index f36bfcc3d7b..e3b6ca021fe 100644
--- a/intern/sky/source/sky_nishita.cpp
+++ b/intern/sky/source/sky_nishita.cpp
@@ -87,7 +87,7 @@ static float3 geographical_to_direction(float lat, float lon)
return make_float3(cosf(lat) * cosf(lon), cosf(lat) * sinf(lon), sinf(lat));
}
-static float3 spec_to_xyz(float *spectrum)
+static float3 spec_to_xyz(const float *spectrum)
{
float3 xyz = make_float3(0.0f, 0.0f, 0.0f);
for (int i = 0; i < num_wavelengths; i++) {
@@ -112,10 +112,12 @@ static float density_mie(float height)
static float density_ozone(float height)
{
float den = 0.0f;
- if (height >= 10000.0f && height < 25000.0f)
+ if (height >= 10000.0f && height < 25000.0f) {
den = 1.0f / 15000.0f * height - 2.0f / 3.0f;
- else if (height >= 25000 && height < 40000)
+ }
+ else if (height >= 25000 && height < 40000) {
den = -(1.0f / 15000.0f * height - 8.0f / 3.0f);
+ }
return den;
}
@@ -133,15 +135,16 @@ static float phase_mie(float mu)
/* Intersection helpers */
static bool surface_intersection(float3 pos, float3 dir)
{
- if (dir.z >= 0)
+ if (dir.z >= 0) {
return false;
+ }
float b = -2.0f * dot(dir, -pos);
float c = len_squared(pos) - sqr(earth_radius);
float t = b * b - 4.0f * c;
- if (t >= 0.0f)
+ if (t >= 0.0f) {
return true;
- else
- return false;
+ }
+ return false;
}
static float3 atmosphere_intersection(float3 pos, float3 dir)