Fix #103918: Cycles point cloud motion blur artifacts on the GPU
Change storage to consistently put xyz + radius in the motion blur attribute. Pull Request: https://projects.blender.org/blender/blender/pulls/109830
This commit is contained in:
committed by
Brecht Van Lommel
parent
8ad4a24287
commit
7e55dfcf27
@@ -618,7 +618,7 @@ hiprtGeometryBuildInput HIPRTDevice::prepare_point_blas(BVHHIPRT *bvh, PointClou
|
||||
const float3 *points_data = pointcloud->get_points().data();
|
||||
const float *radius_data = pointcloud->get_radius().data();
|
||||
const size_t num_points = pointcloud->num_points();
|
||||
const float3 *motion_data = (point_attr_mP) ? point_attr_mP->data_float3() : NULL;
|
||||
const float4 *motion_data = (point_attr_mP) ? point_attr_mP->data_float4() : NULL;
|
||||
const size_t num_steps = pointcloud->get_motion_steps();
|
||||
|
||||
int num_bounds = 0;
|
||||
@@ -646,7 +646,7 @@ hiprtGeometryBuildInput HIPRTDevice::prepare_point_blas(BVHHIPRT *bvh, PointClou
|
||||
BoundBox bounds = BoundBox::empty;
|
||||
point.bounds_grow(points_data, radius_data, bounds);
|
||||
for (size_t step = 0; step < num_steps - 1; step++) {
|
||||
point.bounds_grow(motion_data + step * num_points, radius_data, bounds);
|
||||
point.bounds_grow(motion_data[step * num_points + j], bounds);
|
||||
}
|
||||
if (bounds.valid()) {
|
||||
bvh->custom_primitive_bound[num_bounds] = bounds;
|
||||
@@ -666,7 +666,7 @@ hiprtGeometryBuildInput HIPRTDevice::prepare_point_blas(BVHHIPRT *bvh, PointClou
|
||||
for (uint j = 0; j < num_points; j++) {
|
||||
const PointCloud::Point point = pointcloud->get_point(j);
|
||||
const size_t num_steps = pointcloud->get_motion_steps();
|
||||
const float3 *point_steps = point_attr_mP->data_float3();
|
||||
const float4 *point_steps = point_attr_mP->data_float4();
|
||||
|
||||
float4 prev_key = point.motion_key(
|
||||
points_data, radius_data, point_steps, num_points, num_steps, 0.0f, j);
|
||||
|
||||
Reference in New Issue
Block a user