Skip to content

Commit

Permalink
Release 0.3.2. See CHANGELOG.md for changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasHeumann committed Nov 27, 2023
1 parent 19a1b94 commit 9c75562
Show file tree
Hide file tree
Showing 40 changed files with 131 additions and 79 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -25,7 +25,7 @@ include(ExternalProject)

project(ClaraViz
DESCRIPTION "ClaraViz"
VERSION 0.3.1
VERSION 0.3.2
LANGUAGES CXX
)

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.claravizrenderserver
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile_aarch64.build
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) \
Expand Down
Binary file modified bin/aarch64/ClaraVizRenderServer
Binary file not shown.
Binary file modified bin/x86_64/ClaraVizRenderServer
Binary file not shown.
2 changes: 0 additions & 2 deletions cmake/Project.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 1 addition & 3 deletions cmake/Tools.cmake
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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++::
Expand Down
4 changes: 2 additions & 2 deletions cmake/clara_viz_rendererConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions cmake/clara_viz_rendererConfigVersion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lib/aarch64/libclara_viz_renderer.so.0
Binary file not shown.
2 changes: 1 addition & 1 deletion lib/x86_64/libclara_viz_renderer.so.0
Binary file not shown.
9 changes: 7 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down
1 change: 0 additions & 1 deletion src/claraviz/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions src/claraviz/hardware/nvenc/NvEncService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,10 @@ struct NvEncService::Impl
{
~Impl() = default;

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wignored-attributes"
UniqueObj<void, decltype(&dlclose), &dlclose> nvenc_lib; ///< NvEnc lib handle
#pragma GCC diagnostic pop

NV_ENCODE_API_FUNCTION_LIST nvenc; ///< NvEnc API
};
Expand Down
7 changes: 6 additions & 1 deletion src/claraviz/interface/CameraInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

#include "claraviz/interface/CameraInterface.h"

#include <algorithm>

#include "claraviz/util/Validator.h"

namespace clara::viz
Expand All @@ -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"); })
Expand Down Expand Up @@ -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;
Expand Down
37 changes: 28 additions & 9 deletions src/claraviz/interface/CameraInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand All @@ -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<Vector3f> 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<Vector3f> 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<Vector3f> 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
*
Expand Down
6 changes: 5 additions & 1 deletion src/claraviz/interface/JsonInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand All @@ -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);
Expand Down
15 changes: 15 additions & 0 deletions src/claraviz/rpc/CameraRPC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand All @@ -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());
Expand Down
2 changes: 0 additions & 2 deletions src/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions src/examples/claravizrenderer-ui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions src/examples/renderer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/examples/renderer/Dockerfile.renderer
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/examples/renderer/ui/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 0 additions & 2 deletions src/examples/volumestreamrenderer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/examples/volumestreamrenderer/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ui",
"version": "0.3.1",
"version": "0.3.2",
"private": true,
"dependencies": {
"@material-ui/core": "^4.11.0",
Expand Down
Loading

0 comments on commit 9c75562

Please sign in to comment.