Fix T95977: Point Info node radius wrong under rotation
This commit is contained in:
@@ -141,9 +141,10 @@ ccl_device float point_radius(KernelGlobals kg, ccl_private const ShaderData *sd
|
||||
return r;
|
||||
}
|
||||
else {
|
||||
float3 dir = make_float3(r, r, r);
|
||||
const float normalized_r = r * (1.0f / M_SQRT3_F);
|
||||
float3 dir = make_float3(normalized_r, normalized_r, normalized_r);
|
||||
object_dir_transform(kg, sd, &dir);
|
||||
return average(dir);
|
||||
return len(dir);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -80,6 +80,9 @@ CCL_NAMESPACE_BEGIN
|
||||
#ifndef M_SQRT2_F
|
||||
# define M_SQRT2_F (1.4142135623730950f) /* sqrt(2) */
|
||||
#endif
|
||||
#ifndef M_SQRT3_F
|
||||
# define M_SQRT3_F (1.7320508075688772f) /* sqrt(3) */
|
||||
#endif
|
||||
#ifndef M_LN2_F
|
||||
# define M_LN2_F (0.6931471805599453f) /* ln(2) */
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user