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
path: root/intern
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2022-09-05 16:07:47 +0300
committerBrecht Van Lommel <brecht@blender.org>2022-09-05 16:07:47 +0300
commit404e75c16564d473aa164812355bda1ceebbfb16 (patch)
treea8e15b038fa0c171788a6f5ffebd913bee7d286a /intern
parent38508f511023c60c6c16016f8825bb2ad9fad79f (diff)
parent1b216fc237073ad9090e94b840867d35ec958eb8 (diff)
Merge branch 'blender-v3.3-release'
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/blender/curves.cpp4
-rw-r--r--intern/cycles/kernel/light/light.h8
2 files changed, 8 insertions, 4 deletions
diff --git a/intern/cycles/blender/curves.cpp b/intern/cycles/blender/curves.cpp
index 59e630eef63..6158ed78598 100644
--- a/intern/cycles/blender/curves.cpp
+++ b/intern/cycles/blender/curves.cpp
@@ -843,7 +843,7 @@ static float4 hair_point_as_float4(BL::FloatVectorAttribute b_attr_position,
const int index)
{
float4 mP = float3_to_float4(get_float3(b_attr_position.data[index].vector()));
- mP.w = b_attr_radius ? b_attr_radius->data[index].value() : 0.0f;
+ mP.w = b_attr_radius ? b_attr_radius->data[index].value() : 0.005f;
return mP;
}
@@ -910,7 +910,7 @@ static void export_hair_curves(Scene *scene,
for (int j = 0; j < num_points; j++) {
const int point_offset = first_point_index + j;
const float3 co = get_float3(b_attr_position.data[point_offset].vector());
- const float radius = b_attr_radius ? b_attr_radius->data[point_offset].value() : 0.0f;
+ const float radius = b_attr_radius ? b_attr_radius->data[point_offset].value() : 0.005f;
curve_keys[point_offset] = co;
curve_radius[point_offset] = radius;
diff --git a/intern/cycles/kernel/light/light.h b/intern/cycles/kernel/light/light.h
index 85478cd09c5..12a6f21b58d 100644
--- a/intern/cycles/kernel/light/light.h
+++ b/intern/cycles/kernel/light/light.h
@@ -200,8 +200,12 @@ ccl_device_inline bool light_sample(KernelGlobals kg,
inplane = ls->P - inplane;
}
- ls->u = dot(inplane, axisu) * (1.0f / dot(axisu, axisu)) + 0.5f;
- ls->v = dot(inplane, axisv) * (1.0f / dot(axisv, axisv)) + 0.5f;
+ const float light_u = dot(inplane, axisu) * (1.0f / dot(axisu, axisu));
+ const float light_v = dot(inplane, axisv) * (1.0f / dot(axisv, axisv));
+
+ /* NOTE: Return barycentric coordinates in the same notation as Embree and OptiX. */
+ ls->u = light_v + 0.5f;
+ ls->v = -light_u - light_v;
ls->Ng = Ng;
ls->D = normalize_len(ls->P - P, &ls->t);