diff --git a/CHANGELOG.md b/CHANGELOG.md index 94b94ce..febad39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +# clara-viz 0.3.2 (November 27 2023) + +## Features + +* Support camera pose for non-stereo cases as well + +## Bug Fixes + +* Fix cmake warnings and consolidate cmake_minimum_required() usage +* Fix compile warning in NvEnvService.cpp + # clara-viz 0.3.1 (July 12 2023) ## Bug Fixes diff --git a/CMakeLists.txt b/CMakeLists.txt index 698176b..f12b4f5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.24...3.26) # Options option(CLARA_VIZ_CUDA_PROFILING "Enable CUDA profiling" OFF) @@ -25,7 +25,7 @@ include(ExternalProject) project(ClaraViz DESCRIPTION "ClaraViz" - VERSION 0.3.1 + VERSION 0.3.2 LANGUAGES CXX ) diff --git a/Dockerfile.claravizrenderserver b/Dockerfile.claravizrenderserver index 1d5e606..fff6f30 100644 --- a/Dockerfile.claravizrenderserver +++ b/Dockerfile.claravizrenderserver @@ -13,7 +13,7 @@ # limitations under the License. ARG DOCKER_HUB -FROM ${DOCKER_HUB}nvidia/cuda:11.2.0-base-ubuntu18.04 +FROM ${DOCKER_HUB}nvidia/cuda:11.2.2-base-ubuntu18.04 WORKDIR /app diff --git a/Dockerfile_aarch64.build b/Dockerfile_aarch64.build index 09f816e..46a1a69 100644 --- a/Dockerfile_aarch64.build +++ b/Dockerfile_aarch64.build @@ -13,7 +13,7 @@ # limitations under the License. ARG DOCKER_HUB -FROM ${DOCKER_HUB}nvidia/cuda:11.2.0-devel-ubuntu18.04 +FROM ${DOCKER_HUB}nvidia/cuda:11.2.2-devel-ubuntu18.04 # install dependencies # * wget, ca-certificates: to download packages @@ -44,7 +44,7 @@ RUN mkdir /tmp/git-lfs \ && rm -rf /tmp/git-lfs # Install cmake -ARG CMAKE_VERSION="3.21.0" +ARG CMAKE_VERSION="3.24.0" RUN mkdir /tmp/cmake \ && cd /tmp/cmake \ && ARCH=$(uname -m) \ diff --git a/bin/aarch64/ClaraVizRenderServer b/bin/aarch64/ClaraVizRenderServer index 45d6cfb..ba396f9 100755 Binary files a/bin/aarch64/ClaraVizRenderServer and b/bin/aarch64/ClaraVizRenderServer differ diff --git a/bin/x86_64/ClaraVizRenderServer b/bin/x86_64/ClaraVizRenderServer index 69366de..410e801 100755 Binary files a/bin/x86_64/ClaraVizRenderServer and b/bin/x86_64/ClaraVizRenderServer differ diff --git a/cmake/Project.cmake b/cmake/Project.cmake index 9008824..d28e088 100644 --- a/cmake/Project.cmake +++ b/cmake/Project.cmake @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.12) - macro(setup_project) # avoid 'Up-to-date' install messages set(CMAKE_INSTALL_MESSAGE LAZY) diff --git a/cmake/Tools.cmake b/cmake/Tools.cmake index 8155410..e7e0bb8 100644 --- a/cmake/Tools.cmake +++ b/cmake/Tools.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. +# Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.12) - include(CMakeParseArguments) # Add custom commands to process ``.proto`` files to C++:: diff --git a/cmake/clara_viz_rendererConfig.cmake b/cmake/clara_viz_rendererConfig.cmake index 2af2fbc..86a3c81 100644 --- a/cmake/clara_viz_rendererConfig.cmake +++ b/cmake/clara_viz_rendererConfig.cmake @@ -107,12 +107,12 @@ endif() # Import target "clara::viz::renderer" for configuration "Release" set_property(TARGET clara::viz::renderer APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) set_target_properties(clara::viz::renderer PROPERTIES - IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/${CMAKE_SYSTEM_PROCESSOR}/libclara_viz_renderer.so.0.3.1" + IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/${CMAKE_SYSTEM_PROCESSOR}/libclara_viz_renderer.so.0.3.2" IMPORTED_SONAME_RELEASE "libclara_viz_renderer.so.0" ) list(APPEND _cmake_import_check_targets clara::viz::renderer ) -list(APPEND _cmake_import_check_files_for_clara::viz::renderer "${_IMPORT_PREFIX}/lib/${CMAKE_SYSTEM_PROCESSOR}/libclara_viz_renderer.so.0.3.1" ) +list(APPEND _cmake_import_check_files_for_clara::viz::renderer "${_IMPORT_PREFIX}/lib/${CMAKE_SYSTEM_PROCESSOR}/libclara_viz_renderer.so.0.3.2" ) # Cleanup temporary variables. set(_IMPORT_PREFIX) diff --git a/cmake/clara_viz_rendererConfigVersion.cmake b/cmake/clara_viz_rendererConfigVersion.cmake index c4a2747..4b5ca15 100644 --- a/cmake/clara_viz_rendererConfigVersion.cmake +++ b/cmake/clara_viz_rendererConfigVersion.cmake @@ -9,19 +9,19 @@ # The variable CVF_VERSION must be set before calling configure_file(). -set(PACKAGE_VERSION "0.3.1") +set(PACKAGE_VERSION "0.3.2") if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) set(PACKAGE_VERSION_COMPATIBLE FALSE) else() - if("0.3.1" MATCHES "^([0-9]+)\\.") + if("0.3.2" MATCHES "^([0-9]+)\\.") set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}") if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0) string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}") endif() else() - set(CVF_VERSION_MAJOR "0.3.1") + set(CVF_VERSION_MAJOR "0.3.2") endif() if(PACKAGE_FIND_VERSION_RANGE) diff --git a/lib/aarch64/libclara_viz_renderer.so.0 b/lib/aarch64/libclara_viz_renderer.so.0 index 298bd85..bf761e8 120000 --- a/lib/aarch64/libclara_viz_renderer.so.0 +++ b/lib/aarch64/libclara_viz_renderer.so.0 @@ -1 +1 @@ -libclara_viz_renderer.so.0.3.1 \ No newline at end of file +libclara_viz_renderer.so.0.3.2 \ No newline at end of file diff --git a/lib/aarch64/libclara_viz_renderer.so.0.3.1 b/lib/aarch64/libclara_viz_renderer.so.0.3.2 similarity index 89% rename from lib/aarch64/libclara_viz_renderer.so.0.3.1 rename to lib/aarch64/libclara_viz_renderer.so.0.3.2 index 5d61ec7..072c345 100644 Binary files a/lib/aarch64/libclara_viz_renderer.so.0.3.1 and b/lib/aarch64/libclara_viz_renderer.so.0.3.2 differ diff --git a/lib/x86_64/libclara_viz_renderer.so.0 b/lib/x86_64/libclara_viz_renderer.so.0 index 298bd85..bf761e8 120000 --- a/lib/x86_64/libclara_viz_renderer.so.0 +++ b/lib/x86_64/libclara_viz_renderer.so.0 @@ -1 +1 @@ -libclara_viz_renderer.so.0.3.1 \ No newline at end of file +libclara_viz_renderer.so.0.3.2 \ No newline at end of file diff --git a/lib/x86_64/libclara_viz_renderer.so.0.3.1 b/lib/x86_64/libclara_viz_renderer.so.0.3.2 similarity index 88% rename from lib/x86_64/libclara_viz_renderer.so.0.3.1 rename to lib/x86_64/libclara_viz_renderer.so.0.3.2 index 0b8dc60..5d89df2 100755 Binary files a/lib/x86_64/libclara_viz_renderer.so.0.3.1 and b/lib/x86_64/libclara_viz_renderer.so.0.3.2 differ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a42f589..1406fd1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -12,11 +12,16 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.24...3.26) + +# set CMP0148 policy to OLD to allow FindCUDA +if(POLICY CMP0146) + cmake_policy(SET CMP0146 OLD) +endif() project(ClaraVizServer DESCRIPTION "ClaraVizServer" - VERSION 0.3.1 + VERSION 0.3.2 LANGUAGES CXX ) diff --git a/src/claraviz/CMakeLists.txt b/src/claraviz/CMakeLists.txt index f25715e..24ad8e3 100644 --- a/src/claraviz/CMakeLists.txt +++ b/src/claraviz/CMakeLists.txt @@ -11,7 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.12) ###################### # core diff --git a/src/claraviz/hardware/nvenc/NvEncService.cpp b/src/claraviz/hardware/nvenc/NvEncService.cpp index daa794f..fcd3464 100644 --- a/src/claraviz/hardware/nvenc/NvEncService.cpp +++ b/src/claraviz/hardware/nvenc/NvEncService.cpp @@ -260,7 +260,10 @@ struct NvEncService::Impl { ~Impl() = default; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wignored-attributes" UniqueObj nvenc_lib; ///< NvEnc lib handle +#pragma GCC diagnostic pop NV_ENCODE_API_FUNCTION_LIST nvenc; ///< NvEnc API }; diff --git a/src/claraviz/interface/CameraInterface.cpp b/src/claraviz/interface/CameraInterface.cpp index a267037..df59693 100644 --- a/src/claraviz/interface/CameraInterface.cpp +++ b/src/claraviz/interface/CameraInterface.cpp @@ -16,6 +16,8 @@ #include "claraviz/interface/CameraInterface.h" +#include + #include "claraviz/util/Validator.h" namespace clara::viz @@ -26,7 +28,8 @@ DEFINE_CLASS_MESSAGEID(CameraInterface::Message); template<> CameraInterface::DataIn::Camera::Camera() - : eye(Vector3f(0.f, 0.f, -1.f), + : enable_pose(false) + , eye(Vector3f(0.f, 0.f, -1.f), [this](const Vector3f &value) { ValidatorDifferent(value, look_at.Get(), "Eye position and look at point"); }) , look_at(Vector3f(0.f, 0.f, 0.f), [this](const Vector3f &value) { ValidatorDifferent(value, eye.Get(), "Look at point and eye position"); }) @@ -149,10 +152,12 @@ CameraInterface::DataOut CameraInterface::Get() CameraInterface::DataOut::Camera &camera_out = data_out.cameras.back(); camera_out.name = camera_in.name; + camera_out.enable_pose = camera_in.enable_pose; camera_out.eye = camera_in.eye.Get(); camera_out.look_at = camera_in.look_at.Get(); camera_out.up = camera_in.up.Get(); camera_out.field_of_view = camera_in.field_of_view.Get(); + camera_out.pose = camera_in.pose; camera_out.pixel_aspect_ratio = camera_in.pixel_aspect_ratio.Get(); camera_out.enable_stereo = camera_in.enable_stereo; camera_out.left_eye_pose = camera_in.left_eye_pose; diff --git a/src/claraviz/interface/CameraInterface.h b/src/claraviz/interface/CameraInterface.h index c9476d9..beda0cf 100644 --- a/src/claraviz/interface/CameraInterface.h +++ b/src/claraviz/interface/CameraInterface.h @@ -30,15 +30,20 @@ namespace clara::viz * Camera interface data definition. * * Defines the 3D viewing transformation. - * The the head pose is set by the 'eye', 'look_at' and 'up' parameters. + * + * If 'enable_pose' is 'false', the head pose is set by the 'eye', 'look_at' and 'up' parameters. Else + * if 'enable_pose' is 'true' the head pose is set by the 'pose' parameter. + * * The ViewInterfaceData::stereo_mode setting determines the camera setup. - * If stereo mode is 'OFF' then the image is rendered from the head pose and field of view is set using 'field_of_view'. - * If stereo mode is 'LEFT' or 'RIGHT' then the the left or right eye image is rendered as set by 'left_eye_pose' + * + * - If stereo mode is 'OFF' then the image is rendered from the head pose and field of view is set using 'field_of_view'. + * - If stereo mode is 'LEFT' or 'RIGHT' then the the left or right eye image is rendered as set by 'left_eye_pose' * or 'right_eye_pose'. - * If stereo mode is 'TOP_BOTTOM' then he left eye is rendered to the top half of the image and the right eye to the + * - If stereo mode is 'TOP_BOTTOM' then he left eye is rendered to the top half of the image and the right eye to the * bottom half of the image. - * If stereo mode is 'LEFT', 'RIGHT' or TOP_BOTTOM', the field of view is set using 'left_tangent_x', 'left_tangent_y', + * - If stereo mode is 'LEFT', 'RIGHT' or TOP_BOTTOM', the field of view is set using 'left_tangent_x', 'left_tangent_y', * 'right_tangent_x' and 'right_tangent_y'. The 'field_of_view` parameter is ignored. + * * Also when stereo rendering is enabled, `left_gaze_direction` and `right_gaze_direction` are used the determine * the position of the high resolution area when using warped rendering. @sa RenderSettingsInterfaceData::enable_warp. */ @@ -62,28 +67,42 @@ struct CameraInterfaceData std::string name; /** - * Position of the eye point, has to be different from 'look_at' + * Enable use of 'pose' parameter instead of 'eye', 'look_at' and 'up'. + * + * Default: false + */ + bool enable_pose; + + /** + * Position of the eye point, has to be different from 'look_at'. Used when 'enable_pose' is 'false'. * * Default: (0.0, 0.0, -1.0) */ V eye; /** - * Position of the reference point, has to be different from 'eye' + * Position of the reference point, has to be different from 'eye'. Used when 'enable_pose' is 'false'. * * Default: (0.0, 0.0, 0.0) */ V look_at; /** - * Direction of the up vector, has to be a unit vector + * Direction of the up vector, has to be a unit vector. Used when 'enable_pose' is 'false'. * * Default: (0.0, 1.0, 0.0) */ V up; /** - * Field of view angle in degrees, in x direction + * Camera pose. Used when 'enable_pose' is 'true'. + * + * Default: identity matrix + */ + Matrix4x4 pose; + + /** + * Field of view angle in degrees, in x direction. * * Default: 30.0 * diff --git a/src/claraviz/interface/JsonInterface.cpp b/src/claraviz/interface/JsonInterface.cpp index 985c2f6..1f3420d 100644 --- a/src/claraviz/interface/JsonInterface.cpp +++ b/src/claraviz/interface/JsonInterface.cpp @@ -190,9 +190,11 @@ void to_json(nlohmann::json &j, const CameraInterface::DataIn::Camera &camera) { j = nlohmann::json{ {"name", camera.name}, + {"enablePose", camera.enable_pose}, {"eye", camera.eye.Get()}, {"lookAt", camera.look_at.Get()}, {"up", camera.up.Get()}, + {"pose", camera.pose}, {"fieldOfView", camera.field_of_view.Get()}, {"pixelAspectRatio", camera.pixel_aspect_ratio.Get()}, {"enableStereo", camera.enable_stereo}, @@ -213,10 +215,12 @@ void to_json(nlohmann::json &j, const CameraInterface::DataIn::Camera &camera) void from_json(const nlohmann::json &j, CameraInterface::DataIn::Camera &camera) { - camera.name = j.value("name", camera.name); + camera.name = j.value("name", camera.name); + camera.enable_pose = j.value("enablePose", camera.enable_pose); camera.eye.Set(j.value("eye", camera.eye.Get())); camera.look_at.Set(j.value("lookAt", camera.look_at.Get())); camera.up.Set(j.value("up", camera.up.Get())); + camera.pose = j.value("leftEyePose", camera.pose); camera.field_of_view.Set(j.value("fieldOfView", camera.field_of_view.Get())); camera.pixel_aspect_ratio.Set(j.value("pixelAspectRatio", camera.pixel_aspect_ratio.Get())); camera.enable_stereo = j.value("enableStereo", camera.enable_stereo); diff --git a/src/claraviz/rpc/CameraRPC.cpp b/src/claraviz/rpc/CameraRPC.cpp index 3f4c0f9..fd75652 100644 --- a/src/claraviz/rpc/CameraRPC.cpp +++ b/src/claraviz/rpc/CameraRPC.cpp @@ -30,6 +30,16 @@ void CameraContext::ExecuteRPC(nvidia::claraviz::core::CameraRequest &request, CameraInterface::DataIn::Camera *camera = access->GetOrAddCamera(request.name()); + switch (request.enable_pose()) + { + case nvidia::claraviz::core::SWITCH_ENABLE: + camera->enable_pose = true; + break; + case nvidia::claraviz::core::SWITCH_DISABLE: + camera->enable_pose = false; + break; + } + if (request.has_eye()) { camera->eye.Set(MakeVector3f(request.eye())); @@ -43,6 +53,11 @@ void CameraContext::ExecuteRPC(nvidia::claraviz::core::CameraRequest &request, camera->up.Set(MakeVector3f(request.up())); } + if (request.has_pose()) + { + camera->pose = MakeMatrix4x4(request.pose()); + } + if (request.field_of_view() != 0.f) { camera->field_of_view.Set(request.field_of_view()); diff --git a/src/examples/CMakeLists.txt b/src/examples/CMakeLists.txt index 1cc4f3b..91346ac 100644 --- a/src/examples/CMakeLists.txt +++ b/src/examples/CMakeLists.txt @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.12) - add_subdirectory(claravizrenderer-ui) if (CLARA_VIZ_WITH_GRPC) diff --git a/src/examples/claravizrenderer-ui/CMakeLists.txt b/src/examples/claravizrenderer-ui/CMakeLists.txt index fd0a5fb..e21ff7c 100644 --- a/src/examples/claravizrenderer-ui/CMakeLists.txt +++ b/src/examples/claravizrenderer-ui/CMakeLists.txt @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.12) - include(GNUInstallDirs) find_package(clara_viz_renderer REQUIRED) diff --git a/src/examples/renderer/CMakeLists.txt b/src/examples/renderer/CMakeLists.txt index 5ce1851..4a6e81c 100644 --- a/src/examples/renderer/CMakeLists.txt +++ b/src/examples/renderer/CMakeLists.txt @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.12) - include(GNUInstallDirs) set(PROJECT_NAME ExampleRenderServer) diff --git a/src/examples/renderer/Dockerfile.renderer b/src/examples/renderer/Dockerfile.renderer index c8b2519..7ab033d 100644 --- a/src/examples/renderer/Dockerfile.renderer +++ b/src/examples/renderer/Dockerfile.renderer @@ -33,7 +33,7 @@ COPY ./src/examples/renderer/gen_volume.py . RUN python3 gen_volume.py volume ARG DOCKER_HUB -FROM ${DOCKER_HUB}nvidia/cuda:11.2.0-base-ubuntu18.04 +FROM ${DOCKER_HUB}nvidia/cuda:11.2.2-base-ubuntu18.04 ARG VOLUME_FILE="/app/volume.mhd" ENV VOLUME_FILE_ENV=$VOLUME_FILE diff --git a/src/examples/renderer/ui/package.json b/src/examples/renderer/ui/package.json index 09ee66e..9a0f6a3 100644 --- a/src/examples/renderer/ui/package.json +++ b/src/examples/renderer/ui/package.json @@ -1,6 +1,6 @@ { "name": "claraviz-example", - "version": "0.3.1", + "version": "0.3.2", "description": "RenderServer example", "dependencies": { "@grpc/proto-loader": "^0.6.9", diff --git a/src/examples/volumestreamrenderer/CMakeLists.txt b/src/examples/volumestreamrenderer/CMakeLists.txt index 53db8aa..9a3e3b8 100644 --- a/src/examples/volumestreamrenderer/CMakeLists.txt +++ b/src/examples/volumestreamrenderer/CMakeLists.txt @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.12) - include(GNUInstallDirs) set(PROJECT_NAME VolumeStreamRenderer) diff --git a/src/examples/volumestreamrenderer/ui/package.json b/src/examples/volumestreamrenderer/ui/package.json index 721772c..e67ce20 100644 --- a/src/examples/volumestreamrenderer/ui/package.json +++ b/src/examples/volumestreamrenderer/ui/package.json @@ -1,6 +1,6 @@ { "name": "ui", - "version": "0.3.1", + "version": "0.3.2", "private": true, "dependencies": { "@material-ui/core": "^4.11.0", diff --git a/src/examples/web-client/CMakeLists.txt b/src/examples/web-client/CMakeLists.txt index ff4b990..51742b3 100644 --- a/src/examples/web-client/CMakeLists.txt +++ b/src/examples/web-client/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved. +# Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.12) - find_package(gRPC REQUIRED CONFIG) find_package(grpc-web REQUIRED CONFIG) diff --git a/src/nvrpc/CMakeLists.txt b/src/nvrpc/CMakeLists.txt index c9d1f26..6f1f588 100644 --- a/src/nvrpc/CMakeLists.txt +++ b/src/nvrpc/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. +# Copyright (c) 2018-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,9 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. - -cmake_minimum_required(VERSION 3.12) - set(PROJECT_NAME nv_rpc) add_library(${PROJECT_NAME} STATIC) diff --git a/src/protos/CMakeLists.txt b/src/protos/CMakeLists.txt index dda2d31..44849f5 100644 --- a/src/protos/CMakeLists.txt +++ b/src/protos/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. +# Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.12) - set(PROJECT_NAME clara_viz_proto) add_library(${PROJECT_NAME} STATIC) diff --git a/src/protos/nvidia/claraviz/core/camera.proto b/src/protos/nvidia/claraviz/core/camera.proto index a0d0b26..4a411d1 100644 --- a/src/protos/nvidia/claraviz/core/camera.proto +++ b/src/protos/nvidia/claraviz/core/camera.proto @@ -20,26 +20,53 @@ package nvidia.claraviz.core; import "nvidia/claraviz/core/types.proto"; -// Message sent by the client for the `Camera` method. -// Defines the 3D viewing transformation. +/** + * Message sent by the client for the `Camera` method. + * + * Defines the 3D viewing transformation. + * + * If 'enable_pose' is 'SWITCH_DISABLE', the head pose is set by the 'eye', 'look_at' and 'up' parameters. Else + * if 'enable_pose' is 'SWITCH_ENABLE' the head pose is set by the 'pose' parameter. + * + * The ViewRequest::stereo_mode setting determines the camera setup. + * + * - If stereo mode is 'STEREO_MODE_OFF' then the image is rendered from the head pose and field of view is set using 'field_of_view'. + * - If stereo mode is 'STEREO_MODE_LEFT' or 'STEREO_MODE_RIGHT' then the the left or right eye image is rendered as set by 'left_eye_pose' + * or 'right_eye_pose'. + * - If stereo mode is 'STEREO_MODE_TOP_BOTTOM' then he left eye is rendered to the top half of the image and the right eye to the + * bottom half of the image. + * - If stereo mode is 'STEREO_MODE_LEFT', 'STEREO_MODE_RIGHT' or STEREO_MODE_TOP_BOTTOM', the field of view is set using 'left_tangent_x', 'left_tangent_y', + * 'right_tangent_x' and 'right_tangent_y'. The 'field_of_view` parameter is ignored. + * + * Also when stereo rendering is enabled, `left_gaze_direction` and `right_gaze_direction` are used the determine + * the position of the high resolution area when using warped rendering. @sa RenderSettingsInterfaceData::enable_warp. + */ message CameraRequest { // Name // Default: "" string name = 6; - // Position of the eye point, has to be different from 'look_at' + // Enable use of 'pose' parameter instead of 'eye', 'look_at' and 'up'. + // Default: SWITCH_DISABLE + Switch enable_pose = 18; + + // Position of the eye point, has to be different from 'look_at'. Used when 'enable_pose' is 'SWITCH_DISABLE'. // Default: (0.0, 0.0, -1.0) Float3 eye = 1; - // Position of the reference point, has to be different from 'eye' + // Position of the reference point, has to be different from 'eye'. Used when 'enable_pose' is 'SWITCH_DISABLE'. // Default: (0.0, 0.0, 0.0) Float3 look_at = 2; - // Direction of the up vector, has to be a unit vector + // Direction of the up vector, has to be a unit vector. Used when 'enable_pose' is 'SWITCH_DISABLE'. // Default: (0.0, 1.0, 0.0) Float3 up = 3; + // Camera pose. Used when 'enable_pose' is 'SWITCH_ENABLE'. + // Default: identity matrix + Matrix4x4 pose = 19; + // Field of view angle in degrees, in x direction // Default: 30.0 // Range: ]0.0, 180.0[ diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt index 4453847..32ee53b 100644 --- a/thirdparty/CMakeLists.txt +++ b/thirdparty/CMakeLists.txt @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.12) - add_subdirectory(cuda_helper) add_subdirectory(nlohmann_json) if (CLARA_VIZ_WITH_OPENH264) diff --git a/thirdparty/cuda_helper/CMakeLists.txt b/thirdparty/cuda_helper/CMakeLists.txt index 246e8da..d8a8995 100644 --- a/thirdparty/cuda_helper/CMakeLists.txt +++ b/thirdparty/cuda_helper/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2022, NVIDIA CORPORATION. All rights reserved. +# Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.12) - include("${CLARA_VIZ_PUBLIC_CMAKE_TOOLS_DIR}/Tools.cmake") include(ExternalProject) diff --git a/thirdparty/grpc-web/CMakeBuild.patch b/thirdparty/grpc-web/CMakeBuild.patch index d63e61d..ac8d549 100644 --- a/thirdparty/grpc-web/CMakeBuild.patch +++ b/thirdparty/grpc-web/CMakeBuild.patch @@ -1,7 +1,7 @@ diff -Naur o/CMakeLists.txt n/CMakeLists.txt --- o/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100 +++ n/CMakeLists.txt 2019-01-09 13:42:26.408739488 +0100 -@@ -0,0 +1,52 @@ +@@ -0,0 +1,50 @@ +# Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); @@ -16,8 +16,6 @@ diff -Naur o/CMakeLists.txt n/CMakeLists.txt +# See the License for the specific language governing permissions and +# limitations under the License. + -+cmake_minimum_required(VERSION 3.12) -+ +set(PROJECT_NAME protoc-gen-grpc-web) + +find_package(Protobuf CONFIG REQUIRED) diff --git a/thirdparty/grpc-web/CMakeLists.txt b/thirdparty/grpc-web/CMakeLists.txt index c098d98..a4fee6f 100644 --- a/thirdparty/grpc-web/CMakeLists.txt +++ b/thirdparty/grpc-web/CMakeLists.txt @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.12) - include("${CLARA_VIZ_PUBLIC_CMAKE_TOOLS_DIR}/Tools.cmake") prebuild_setup(VERSION_VAR grpc-web_VERSION) diff --git a/thirdparty/grpc/CMakeLists.txt b/thirdparty/grpc/CMakeLists.txt index f3ce4e3..e438699 100644 --- a/thirdparty/grpc/CMakeLists.txt +++ b/thirdparty/grpc/CMakeLists.txt @@ -12,17 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.13) - include(GNUInstallDirs) include(FetchContent) include("${CLARA_VIZ_PUBLIC_CMAKE_TOOLS_DIR}/Tools.cmake") prebuild_setup(VERSION_VAR gRPC_VERSION) -# silence a warning about 'ZLIB_ROOT' usage -cmake_policy(SET CMP0074 OLD) - ExternalProject_Add(gRPC_src PREFIX grpc GIT_REPOSITORY https://github.com/grpc/grpc.git diff --git a/thirdparty/nlohmann_json/CMakeLists.txt b/thirdparty/nlohmann_json/CMakeLists.txt index 7b59ad3..ea62fc4 100644 --- a/thirdparty/nlohmann_json/CMakeLists.txt +++ b/thirdparty/nlohmann_json/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2022, NVIDIA CORPORATION. All rights reserved. +# Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -11,7 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.12) include(FetchContent) include("${CLARA_VIZ_PUBLIC_CMAKE_TOOLS_DIR}/Tools.cmake") @@ -21,6 +20,7 @@ prebuild_setup(VERSION_VAR nlohmann_json_VERSION) FetchContent_Declare( nlohmann_json URL https://github.com/nlohmann/json/archive/refs/tags/${nlohmann_json_VERSION}.tar.gz + DOWNLOAD_EXTRACT_TIMESTAMP True ) set(JSON_BuildTests OFF CACHE INTERNAL "") set(JSON_Install OFF) diff --git a/thirdparty/openh264/CMakeLists.txt b/thirdparty/openh264/CMakeLists.txt index 289c3ba..7c7b486 100644 --- a/thirdparty/openh264/CMakeLists.txt +++ b/thirdparty/openh264/CMakeLists.txt @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.12) - include("${CLARA_VIZ_PUBLIC_CMAKE_TOOLS_DIR}/Tools.cmake") prebuild_setup(VERSION_VAR OpenH264_VERSION) diff --git a/thirdparty/openssl/CMakeLists.txt b/thirdparty/openssl/CMakeLists.txt index 05138d7..c025a2d 100644 --- a/thirdparty/openssl/CMakeLists.txt +++ b/thirdparty/openssl/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2022, NVIDIA CORPORATION. All rights reserved. +# Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.12) - include("${CLARA_VIZ_PUBLIC_CMAKE_TOOLS_DIR}/Tools.cmake") prebuild_setup(VERSION_VAR OPENSSL_VERSION)