Commit f93e2a11 authored by milanjaros's avatar milanjaros
Browse files

fix right eye for multigpu

parent 93bd90b6
......@@ -3267,6 +3267,8 @@ void cuda_path_trace_internal(int numDevice,
if (devices_left_eye < 1)
devices_left_eye = 1;
//devices_left_eye = 0;
int devices_right_eye = devices_size - devices_left_eye;
if (devices_right_eye < 1)
devices_right_eye = 1;
......@@ -3367,6 +3369,12 @@ void cuda_path_trace_internal(int numDevice,
wtile.y = tile_y_dev;
wtile.h = tile_h_dev;
const char *env_tiles = getenv("CLIENT_TILES");
if (env_tiles) {
wtile.y = util_get_int_from_env_array(env_tiles, 2 * id_vr + 0);
wtile.h = util_get_int_from_env_array(env_tiles, 2 * id_vr + 1);
}
# else
int tile_step_dev = (int)((float)tile_h / (float)devices_size);
......@@ -3598,7 +3606,7 @@ void cuda_path_trace_internal(int numDevice,
// pixels_node = pixels_node;
}
else {
pixels_node = (char *)pixels_node + total_work_size * pix_type_size;
pixels_node = (char *)pixels_node + w * h * pix_type_size;
}
# endif
/////////////////////////////////////////////////////////////////////////////////////////////
......
......@@ -22,7 +22,7 @@ constexpr const int BUFFERS = 2;
#define REQUIRED_SHM_VERSION 8
#define UG_CUDA_IPC_HANDLE_SIZE 64
#define RENDER_PACKET_FROM_FILE
//#define RENDER_PACKET_FROM_FILE
#if defined WITH_CLIENT_CUDA
static_assert(UG_CUDA_IPC_HANDLE_SIZE == CUDA_IPC_HANDLE_SIZE,
......@@ -249,55 +249,62 @@ void cesnet_set_camera_data(cyclesphi::cyclesphi_data *cdata)
{
// printf("get_camera_matrices\n");
g_cdata.step_samples = 1;
g_cdata.width = 512;
g_cdata.height = 512;
// g_cdata.cam.transform_inverse_view_matrix[0] = -0.437973917;
// g_cdata.cam.transform_inverse_view_matrix[1] = -0.267504632;
// g_cdata.cam.transform_inverse_view_matrix[2] = 0.858265936;
// g_cdata.cam.transform_inverse_view_matrix[3] = 1.29672277;
// g_cdata.cam.transform_inverse_view_matrix[4] = 0.874406159;
// g_cdata.cam.transform_inverse_view_matrix[5] = 0.0949685797;
// g_cdata.cam.transform_inverse_view_matrix[6] = 0.475810111;
// g_cdata.cam.transform_inverse_view_matrix[7] = 1.42842984;
// g_cdata.cam.transform_inverse_view_matrix[8] = -0.208789662;
// g_cdata.cam.transform_inverse_view_matrix[9] = 0.958865106;
// g_cdata.cam.transform_inverse_view_matrix[10] = 0.192313895;
// g_cdata.cam.transform_inverse_view_matrix[11] = 1.09617722;
// g_cdata.cam.lens = 14.0577269f;
g_cdata.width = 7680 / 2;
g_cdata.height = 2160;
#ifndef RENDER_PACKET_FROM_FILE
g_cdata.cam.transform_inverse_view_matrix[0] = -0.437973917;
g_cdata.cam.transform_inverse_view_matrix[1] = -0.267504632;
g_cdata.cam.transform_inverse_view_matrix[2] = 0.858265936;
g_cdata.cam.transform_inverse_view_matrix[3] = 1.29672277;
g_cdata.cam.transform_inverse_view_matrix[4] = 0.874406159;
g_cdata.cam.transform_inverse_view_matrix[5] = 0.0949685797;
g_cdata.cam.transform_inverse_view_matrix[6] = 0.475810111;
g_cdata.cam.transform_inverse_view_matrix[7] = 1.42842984;
g_cdata.cam.transform_inverse_view_matrix[8] = -0.208789662;
g_cdata.cam.transform_inverse_view_matrix[9] = 0.958865106;
g_cdata.cam.transform_inverse_view_matrix[10] = 0.192313895;
g_cdata.cam.transform_inverse_view_matrix[11] = 1.09617722;
g_cdata.cam.lens = 14.0577269f;
g_cdata.cam.shift_x = -0.0295778885f;
g_cdata.cam.shift_y = 0.0f;
#endif
g_cdata.cam.clip_start = 0.1f;
g_cdata.cam.clip_end = 1000.0f;
g_cdata.cam.sensor_width = g_sensor_width;
g_cdata.cam.sensor_fit = 0;
// g_cdata.cam.shift_x = -0.0295778885f;
// g_cdata.cam.shift_y = 0.0f;
g_cdata.cam.view_camera_zoom = 1.0f;
g_cdata.cam.view_camera_offset[0] = 0;
g_cdata.cam.view_camera_offset[1] = 0;
g_cdata.cam.use_view_camera = 1;
// g_cdata.cam_right.transform_inverse_view_matrix[0] = -0.437973917;
// g_cdata.cam_right.transform_inverse_view_matrix[1] = -0.267504632;
// g_cdata.cam_right.transform_inverse_view_matrix[2] = 0.858265936;
// g_cdata.cam_right.transform_inverse_view_matrix[3] = 1.26781642;
// g_cdata.cam_right.transform_inverse_view_matrix[4] = 0.874406159;
// g_cdata.cam_right.transform_inverse_view_matrix[5] = 0.0949685797;
// g_cdata.cam_right.transform_inverse_view_matrix[6] = 0.475810111;
// g_cdata.cam_right.transform_inverse_view_matrix[7] = 1.48614061;
// g_cdata.cam_right.transform_inverse_view_matrix[8] = -0.208789662;
// g_cdata.cam_right.transform_inverse_view_matrix[9] = 0.958865106;
// g_cdata.cam_right.transform_inverse_view_matrix[10] = 0.192313895;
// g_cdata.cam_right.transform_inverse_view_matrix[11] = 1.08239710;
// g_cdata.cam_right.transform_inverse_view_matrix;
// g_cdata.cam_right.lens = 14.0856476;
#ifndef RENDER_PACKET_FROM_FILE
g_cdata.cam_right.transform_inverse_view_matrix[0] = -0.437973917;
g_cdata.cam_right.transform_inverse_view_matrix[1] = -0.267504632;
g_cdata.cam_right.transform_inverse_view_matrix[2] = 0.858265936;
g_cdata.cam_right.transform_inverse_view_matrix[3] = 1.26781642;
g_cdata.cam_right.transform_inverse_view_matrix[4] = 0.874406159;
g_cdata.cam_right.transform_inverse_view_matrix[5] = 0.0949685797;
g_cdata.cam_right.transform_inverse_view_matrix[6] = 0.475810111;
g_cdata.cam_right.transform_inverse_view_matrix[7] = 1.48614061;
g_cdata.cam_right.transform_inverse_view_matrix[8] = -0.208789662;
g_cdata.cam_right.transform_inverse_view_matrix[9] = 0.958865106;
g_cdata.cam_right.transform_inverse_view_matrix[10] = 0.192313895;
g_cdata.cam_right.transform_inverse_view_matrix[11] = 1.08239710;
g_cdata.cam_right.lens = 14.0856476;
g_cdata.cam_right.shift_x = 0.0284842327;
g_cdata.cam_right.shift_y = 0.0f;
#endif
g_cdata.cam_right.clip_start = 0.1f;
g_cdata.cam_right.clip_end = 1000.0f;
g_cdata.cam_right.sensor_width = g_sensor_width;
g_cdata.cam_right.sensor_fit = 0;
// g_cdata.cam_right.shift_x = 0.0284842327;
// g_cdata.cam_right.shift_y = 0.0f;
g_cdata.cam_right.view_camera_zoom = 1.0f;
g_cdata.cam_right.view_camera_offset[0] = 0;
g_cdata.cam_right.view_camera_offset[1] = 0;
......@@ -583,7 +590,7 @@ static void convert_render_pkt_to_view_matrix(struct RenderPacket *pkt,
dump_render_pkt(pkt);
#endif
#if 1
#ifdef RENDER_PACKET_FROM_FILE
cdata->cam.lens = g_sensor_width /
(fabs(pkt->left_projection_fov.left) + fabs(pkt->left_projection_fov.right));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment