Merge branch 'blender-v3.1-release'
This commit is contained in:
commit
d29a079cb6
Notes:
blender-bot
2023-02-14 03:03:03 +01:00
Referenced by issue #95284, Viewport "World" Cavity Type Doesn't Render Anything
|
@ -282,18 +282,20 @@ static void copy_uniform_sample_point_attributes(const Span<SplinePtr> splines,
|
|||
}
|
||||
|
||||
if (!data.tangents.is_empty()) {
|
||||
spline.sample_with_index_factors<float3>(
|
||||
spline.evaluated_tangents(), uniform_samples, data.tangents.slice(offset, size));
|
||||
for (float3 &tangent : data.tangents) {
|
||||
tangent = math::normalize(tangent);
|
||||
Span<float3> src_tangents = spline.evaluated_tangents();
|
||||
MutableSpan<float3> sampled_tangents = data.tangents.slice(offset, size);
|
||||
spline.sample_with_index_factors<float3>(src_tangents, uniform_samples, sampled_tangents);
|
||||
for (float3 &vector : sampled_tangents) {
|
||||
vector = math::normalize(vector);
|
||||
}
|
||||
}
|
||||
|
||||
if (!data.normals.is_empty()) {
|
||||
spline.sample_with_index_factors<float3>(
|
||||
spline.evaluated_normals(), uniform_samples, data.normals.slice(offset, size));
|
||||
for (float3 &normals : data.normals) {
|
||||
normals = math::normalize(normals);
|
||||
Span<float3> src_normals = spline.evaluated_normals();
|
||||
MutableSpan<float3> sampled_normals = data.normals.slice(offset, size);
|
||||
spline.sample_with_index_factors<float3>(src_normals, uniform_samples, sampled_normals);
|
||||
for (float3 &vector : sampled_normals) {
|
||||
vector = math::normalize(vector);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue