diff options
Diffstat (limited to 'source/blender/nodes/shader')
6 files changed, 13 insertions, 13 deletions
diff --git a/source/blender/nodes/shader/node_shader_tree.cc b/source/blender/nodes/shader/node_shader_tree.cc index cb9fbc8407c..2edcd160345 100644 --- a/source/blender/nodes/shader/node_shader_tree.cc +++ b/source/blender/nodes/shader/node_shader_tree.cc @@ -300,7 +300,7 @@ static bool ntree_shader_expand_socket_default(bNodeTree *localtree, BLI_assert(value_socket != nullptr); src_int = static_cast<bNodeSocketValueInt *>(socket->default_value); dst_float = static_cast<bNodeSocketValueFloat *>(value_socket->default_value); - dst_float->value = (float)(src_int->value); + dst_float->value = float(src_int->value); break; case SOCK_FLOAT: value_node = nodeAddStaticNode(nullptr, localtree, SH_NODE_VALUE); diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_hair_principled.cc b/source/blender/nodes/shader/nodes/node_shader_bsdf_hair_principled.cc index a0579372a15..766c926916a 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_hair_principled.cc +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_hair_principled.cc @@ -44,7 +44,7 @@ static void node_declare(NodeDeclarationBuilder &b) .subtype(PROP_FACTOR); b.add_input<decl::Float>(N_("IOR")).default_value(1.55f).min(0.0f).max(1000.0f); b.add_input<decl::Float>(N_("Offset")) - .default_value(2.0f * ((float)M_PI) / 180.0f) + .default_value(2.0f * float(M_PI) / 180.0f) .min(-M_PI_2) .max(M_PI_2) .subtype(PROP_ANGLE); diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_brick.cc b/source/blender/nodes/shader/nodes/node_shader_tex_brick.cc index a1c51a440d0..9b5b7677b5d 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_brick.cc +++ b/source/blender/nodes/shader/nodes/node_shader_tex_brick.cc @@ -147,7 +147,7 @@ class BrickFunction : public fn::MultiFunction { n = (n + 1013) & 0x7fffffff; n = (n >> 13) ^ n; const uint nn = (n * (n * n * 60493 + 19990303) + 1376312589) & 0x7fffffff; - return 0.5f * ((float)nn / 1073741824.0f); + return 0.5f * (float(nn) / 1073741824.0f); } static float smoothstepf(const float f) @@ -169,14 +169,14 @@ class BrickFunction : public fn::MultiFunction { { float offset = 0.0f; - const int rownum = (int)floorf(p.y / row_height); + const int rownum = int(floorf(p.y / row_height)); if (offset_frequency && squash_frequency) { brick_width *= (rownum % squash_frequency) ? 1.0f : squash_amount; offset = (rownum % offset_frequency) ? 0.0f : (brick_width * offset_amount); } - const int bricknum = (int)floorf((p.x + offset) / brick_width); + const int bricknum = int(floorf((p.x + offset) / brick_width)); const float x = (p.x + offset) - brick_width * bricknum; const float y = p.y - row_height * rownum; diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_checker.cc b/source/blender/nodes/shader/nodes/node_shader_tex_checker.cc index b0e5639c893..a78103c0f94 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_checker.cc +++ b/source/blender/nodes/shader/nodes/node_shader_tex_checker.cc @@ -77,9 +77,9 @@ class NodeTexChecker : public fn::MultiFunction { /* Avoid precision issues on unit coordinates. */ const float3 p = (vector[i] * scale[i] + 0.000001f) * 0.999999f; - const int xi = abs((int)(floorf(p.x))); - const int yi = abs((int)(floorf(p.y))); - const int zi = abs((int)(floorf(p.z))); + const int xi = abs(int(floorf(p.x))); + const int yi = abs(int(floorf(p.y))); + const int zi = abs(int(floorf(p.z))); r_fac[i] = ((xi % 2 == yi % 2) == (zi % 2)) ? 1.0f : 0.0f; } diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_sky.cc b/source/blender/nodes/shader/nodes/node_shader_tex_sky.cc index 97b7f2616ae..23fb4052c7e 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_sky.cc +++ b/source/blender/nodes/shader/nodes/node_shader_tex_sky.cc @@ -189,12 +189,12 @@ static int node_shader_gpu_tex_sky(GPUMaterial *mat, /* Pass sky_state->configs[3][9] as 3*(vec4+vec4)+vec3 */ float config_x07[8], config_y07[8], config_z07[8], config_xyz8[3]; for (int i = 0; i < 8; ++i) { - config_x07[i] = (float)sky_state->configs[0][i]; - config_y07[i] = (float)sky_state->configs[1][i]; - config_z07[i] = (float)sky_state->configs[2][i]; + config_x07[i] = float(sky_state->configs[0][i]); + config_y07[i] = float(sky_state->configs[1][i]); + config_z07[i] = float(sky_state->configs[2][i]); } for (int i = 0; i < 3; ++i) { - config_xyz8[i] = (float)sky_state->configs[i][8]; + config_xyz8[i] = float(sky_state->configs[i][8]); } float radiance[3]; for (int i = 0; i < 3; i++) { diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_white_noise.cc b/source/blender/nodes/shader/nodes/node_shader_tex_white_noise.cc index 64075a903ab..b738dff413e 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_white_noise.cc +++ b/source/blender/nodes/shader/nodes/node_shader_tex_white_noise.cc @@ -177,7 +177,7 @@ class WhiteNoiseFunction : public fn::MultiFunction { static void sh_node_noise_build_multi_function(NodeMultiFunctionBuilder &builder) { const bNode &node = builder.node(); - builder.construct_and_set_matching_fn<WhiteNoiseFunction>((int)node.custom1); + builder.construct_and_set_matching_fn<WhiteNoiseFunction>(int(node.custom1)); } } // namespace blender::nodes::node_shader_tex_white_noise_cc |