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 'source/blender/draw/engines/eevee_next/eevee_sampling.cc')
-rw-r--r--source/blender/draw/engines/eevee_next/eevee_sampling.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/draw/engines/eevee_next/eevee_sampling.cc b/source/blender/draw/engines/eevee_next/eevee_sampling.cc
index 76a0e98638b..521b6d603df 100644
--- a/source/blender/draw/engines/eevee_next/eevee_sampling.cc
+++ b/source/blender/draw/engines/eevee_next/eevee_sampling.cc
@@ -215,8 +215,8 @@ void Sampling::dof_disk_sample_get(float *r_radius, float *r_theta) const
samples_passed += ring_sample_count;
}
- *r_radius = ring / (float)dof_ring_count_;
- *r_theta = 2.0f * M_PI * ring_sample / (float)ring_sample_count;
+ *r_radius = ring / float(dof_ring_count_);
+ *r_theta = 2.0f * M_PI * ring_sample / float(ring_sample_count);
}
/** \} */
@@ -233,7 +233,7 @@ void Sampling::cdf_from_curvemapping(const CurveMapping &curve, Vector<float> &c
cdf[0] = 0.0f;
/* Actual CDF evaluation. */
for (int u : IndexRange(cdf.size() - 1)) {
- float x = (float)(u + 1) / (float)(cdf.size() - 1);
+ float x = float(u + 1) / float(cdf.size() - 1);
cdf[u + 1] = cdf[u] + BKE_curvemapping_evaluateF(&curve, 0, x);
}
/* Normalize the CDF. */
@@ -249,14 +249,14 @@ void Sampling::cdf_from_curvemapping(const CurveMapping &curve, Vector<float> &c
void Sampling::cdf_invert(Vector<float> &cdf, Vector<float> &inverted_cdf)
{
for (int u : inverted_cdf.index_range()) {
- float x = (float)u / (float)(inverted_cdf.size() - 1);
+ float x = float(u) / float(inverted_cdf.size() - 1);
for (int i : cdf.index_range()) {
if (i == cdf.size() - 1) {
inverted_cdf[u] = 1.0f;
}
else if (cdf[i] >= x) {
float t = (x - cdf[i]) / (cdf[i + 1] - cdf[i]);
- inverted_cdf[u] = ((float)i + t) / (float)(cdf.size() - 1);
+ inverted_cdf[u] = (float(i) + t) / float(cdf.size() - 1);
break;
}
}