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:
authorCampbell Barton <ideasman42@gmail.com>2013-08-07 03:34:47 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-08-07 03:34:47 +0400
commitd58a38508469f336a4aef9632b182722758aa29b (patch)
treeb20d6b9bd23405b2b47b59f8e01f3a190c6dc70a
parent3c8cdb8c6813c8ef9655054948419fb51c7af09f (diff)
minor edits to float/double conversion suggested by DingTo
-rw-r--r--intern/cycles/kernel/kernel_types.h10
-rw-r--r--intern/cycles/kernel/svm/svm_blackbody.h6
-rw-r--r--intern/cycles/render/blackbody.cpp8
3 files changed, 12 insertions, 12 deletions
diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h
index 8f7062c75ae..99f3724afb5 100644
--- a/intern/cycles/kernel/kernel_types.h
+++ b/intern/cycles/kernel/kernel_types.h
@@ -44,11 +44,11 @@ CCL_NAMESPACE_BEGIN
#define BSSRDF_MIN_RADIUS 1e-8f
#define BSSRDF_MAX_ATTEMPTS 8
-#define BB_DRAPPER 800.0
-#define BB_MAX_TABLE_RANGE 12000.0
-#define BB_TABLE_XPOWER 1.5
-#define BB_TABLE_YPOWER 5.0
-#define BB_TABLE_SPACING 2.0
+#define BB_DRAPPER 800.0f
+#define BB_MAX_TABLE_RANGE 12000.0f
+#define BB_TABLE_XPOWER 1.5f
+#define BB_TABLE_YPOWER 5.0f
+#define BB_TABLE_SPACING 2.0f
#define TEX_NUM_FLOAT_IMAGES 5
diff --git a/intern/cycles/kernel/svm/svm_blackbody.h b/intern/cycles/kernel/svm/svm_blackbody.h
index c3987f378a4..2fc2c770a83 100644
--- a/intern/cycles/kernel/svm/svm_blackbody.h
+++ b/intern/cycles/kernel/svm/svm_blackbody.h
@@ -42,18 +42,18 @@ __device void svm_node_blackbody(KernelGlobals *kg, ShaderData *sd, float *stack
/* Input */
float temperature = stack_load_float(stack, temperature_offset);
- if (temperature < (float)BB_DRAPPER) {
+ if (temperature < BB_DRAPPER) {
/* just return very very dim red */
color_rgb = make_float3(1.0e-6f,0.0f,0.0f);
}
- else if (temperature <= (float)BB_MAX_TABLE_RANGE) {
+ else if (temperature <= BB_MAX_TABLE_RANGE) {
/* This is the overall size of the table */
const int lookuptablesize = 956;
const float lookuptablenormalize = 1.0f/956.0f;
/* reconstruct a proper index for the table lookup, compared to OSL we don't look up two colors
just one (the OSL-lerp is also automatically done for us by "lookup_table_read") */
- float t = powf((temperature - (float)BB_DRAPPER) * (float)(1.0 / BB_TABLE_SPACING), (float)(1.0 / BB_TABLE_XPOWER));
+ float t = powf((temperature - BB_DRAPPER) * (1.0f / BB_TABLE_SPACING), (1.0f / BB_TABLE_XPOWER));
int blackbody_table_offset = kernel_data.blackbody.table_offset;
diff --git a/intern/cycles/render/blackbody.cpp b/intern/cycles/render/blackbody.cpp
index 72e3e5d938d..6782df10006 100644
--- a/intern/cycles/render/blackbody.cpp
+++ b/intern/cycles/render/blackbody.cpp
@@ -100,7 +100,7 @@ vector<float> blackbody_table()
/* ToDo: bring this back to what OSL does with the lastTemperature limit ? */
for (int i = 0; i <= 317; ++i) {
- double Temperature = pow((double)i, BB_TABLE_XPOWER) * BB_TABLE_SPACING + BB_DRAPPER;
+ double Temperature = pow((double)i, BB_TABLE_XPOWER) * (double)BB_TABLE_SPACING + (double)BB_DRAPPER;
X = 0;
Y = 0;
Z = 0;
@@ -125,9 +125,9 @@ vector<float> blackbody_table()
/* Clamp to zero if values are smaller */
col = max(col, make_float3(0.0f, 0.0f, 0.0f));
- col.x = powf(col.x, 1.0 / BB_TABLE_YPOWER);
- col.y = powf(col.y, 1.0 / BB_TABLE_YPOWER);
- col.z = powf(col.z, 1.0 / BB_TABLE_YPOWER);
+ col.x = powf(col.x, 1.0f / BB_TABLE_YPOWER);
+ col.y = powf(col.y, 1.0f / BB_TABLE_YPOWER);
+ col.z = powf(col.z, 1.0f / BB_TABLE_YPOWER);
/* Store in table in RRRGGGBBB format */
blackbody_table[i] = col.x;