Skip to content

Commit

Permalink
Merge branch 'release-1.1.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
gregjohnson committed Nov 1, 2021
2 parents dcdd2e1 + 1d77df3 commit b2cfd8a
Show file tree
Hide file tree
Showing 299 changed files with 16,291 additions and 9,679 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Version History
---------------

### Open VKL 1.1.0

- vklExamples improvements: asynchronous rendering, multiple viewports,
docking, and more
- Fixed bug in `openvkl_utility_vdb` which could lead to crashes when creating
VDB volumes with temporally constant tiles
- Superbuild updates to latest versions of dependencies
- Minimum rkcommon version is now 1.8.0

### Open VKL 1.0.1

- Fixed issue in `structuredRegular` and `vdb` interval iterators that could
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)

## Establish project ##

project(openvkl VERSION 1.0.1 LANGUAGES C CXX)
project(openvkl VERSION 1.1.0 LANGUAGES C CXX)

## Add openvkl specific macros ##

Expand Down Expand Up @@ -47,7 +47,7 @@ openvkl_configure_build_type()
openvkl_configure_global_build_flags()
openvkl_configure_ispc_isa()

set(RKCOMMON_VERSION_REQUIRED 1.7.0)
set(RKCOMMON_VERSION_REQUIRED 1.8.0)
find_package(rkcommon ${RKCOMMON_VERSION_REQUIRED} REQUIRED)
get_target_property(RKCOMMON_INCLUDE_DIRS rkcommon::rkcommon
INTERFACE_INCLUDE_DIRECTORIES)
Expand Down
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Intel® Open Volume Kernel Library

This is release v1.0.1 of Intel® Open VKL. For changes and new features
This is release v1.1.0 of Intel® Open VKL. For changes and new features
see the [changelog](CHANGELOG.md). Visit http://www.openvkl.org for more
information.

Expand Down Expand Up @@ -33,6 +33,15 @@ example renderers to demonstrate how to best use the Open VKL API.

## Version History

### Open VKL 1.1.0

- vklExamples improvements: asynchronous rendering, multiple
viewports, docking, and more
- Fixed bug in `openvkl_utility_vdb` which could lead to crashes when
creating VDB volumes with temporally constant tiles
- Superbuild updates to latest versions of dependencies
- Minimum rkcommon version is now 1.8.0

### Open VKL 1.0.1

- Fixed issue in `structuredRegular` and `vdb` interval iterators that
Expand Down
72 changes: 72 additions & 0 deletions examples/interactive/BatchApplication.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
// Copyright 2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0

#include "BatchApplication.h"
#include "renderer/Framebuffer.h"
#include "renderer/Renderer.h"
#include "renderer/Scene.h"
#include "renderer/Scheduler.h"

#include "rkcommon/utility/SaveImage.h"

namespace openvkl {
namespace examples {

BatchApplication::BatchApplication() {}

BatchApplication::~BatchApplication() {}

void BatchApplication::run(Scene &scene)
{
if (scene.rendererTypes.empty()) {
scene.rendererTypes = {"density_path_tracer_ispc"};
}

auto &scheduler = scene.scheduler;
auto &volume = scene.volume;

scene.rendererParams->fixedFramebufferSize = true;
const vec2i resolution = scene.rendererParams->framebufferSize;

std::cout << "Creating VKL objects ..." << std::endl;
volume.updateVKLObjects();
volume.printInfo();
scene.camera->fitToScreen(volume.getBounds());
scene.camera.incrementVersion();

for (const auto &type : scene.rendererTypes) {
auto rendererPtr = scene.createRenderer(type);
if (!rendererPtr) {
continue;
}

Renderer &renderer = *(rendererPtr.get());
// This call will resize the framebuffer to our desired output
// resolution.
renderer.getFramebuffer(resolution.x, resolution.y);

const std::string filename = type + ".pfm";

std::cout << "Rendering with " << type << " ..." << std::endl;

scheduler.start(renderer);
for (unsigned i = 0; i < scene.batchModeSpp; ++i) {
std::cout << "\r" << i << " / " << scene.batchModeSpp << " spp"
<< std::flush;
scheduler.renderFrame(renderer);
}
scheduler.stop(renderer);
std::cout << std::endl;

const auto &framebuffer =
renderer.getFramebuffer(resolution.x, resolution.y);
const auto &fb = framebuffer.getFrontBuffer();
std::cout << "Writing " << filename << " ..." << std::endl;
rkcommon::utility::writePFM(
filename, fb.getWidth(), fb.getHeight(), fb.getRgba());
}
}

} // namespace examples
} // namespace openvkl

27 changes: 27 additions & 0 deletions examples/interactive/BatchApplication.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright 2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0

#pragma once

#include <memory>
#include <list>
#include <vector>

namespace openvkl {
namespace examples {

struct Scene;
class Scheduler;

class BatchApplication
{
public:
BatchApplication();
~BatchApplication();
void run(Scene &scene);
};

} // namespace examples
} // namespace openvkl


134 changes: 55 additions & 79 deletions examples/interactive/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,91 +1,69 @@
## Copyright 2019-2021 Intel Corporation
## SPDX-License-Identifier: Apache-2.0

## OpenGL dependency ##

set(OpenGL_GL_PREFERENCE "LEGACY")
find_package(OpenGL 2 REQUIRED)

## GLFW dependency ##

find_package(glfw3 REQUIRED)

## Example renderers ##

include_directories_ispc(
${CMAKE_SOURCE_DIR}/openvkl/include
${CMAKE_SOURCE_DIR}/openvkl/devices/cpu/math
${RKCOMMON_INCLUDE_DIRS}
)

openvkl_add_library_ispc(vkl_example_renderers STATIC
renderers/Renderer.cpp
renderers/Renderer.ih
renderers/Renderer.ispc

renderers/DensityPathTracer.cpp
renderers/DensityPathTracer.ispc
renderers/HitIterator.cpp
renderers/HitIterator.ispc
renderers/IntervalIteratorDebug.cpp
renderers/IntervalIteratorDebug.ispc
renderers/RayMarchIterator.cpp
renderers/RayMarchIterator.ispc
)

target_include_directories(vkl_example_renderers PUBLIC ${ISPC_TARGET_DIR})

target_link_libraries(vkl_example_renderers PUBLIC openvkl openvkl_testing rkcommon::rkcommon)



set(OPENVKL_IMGUI_ROOT "${CMAKE_CURRENT_LIST_DIR}/imgui-1.81"
CACHE PATH "Path to imgui.")

add_library(imgui STATIC
${OPENVKL_IMGUI_ROOT}/imgui.cpp
${OPENVKL_IMGUI_ROOT}/imgui_draw.cpp
${OPENVKL_IMGUI_ROOT}/imgui_tables.cpp
${OPENVKL_IMGUI_ROOT}/imgui_widgets.cpp
${OPENVKL_IMGUI_ROOT}/backends/imgui_impl_glfw.cpp
${OPENVKL_IMGUI_ROOT}/backends/imgui_impl_opengl2.cpp)

target_include_directories(imgui PUBLIC ${OPENVKL_IMGUI_ROOT})
target_link_libraries(imgui PUBLIC glfw)

## Interactive example app ##

add_executable(vklExamples
window/ArcballCamera.cpp
window/VKLWindow.cpp
window/GLFWVKLWindow.cpp
vklExamples.cpp
window/TransferFunctionWidget.cpp

${VKL_RESOURCE}
)
add_subdirectory(renderer)

### vklExamples app ##

set(OpenGL_GL_PREFERENCE "GLVND") # Request new ABI, but this is only a hint.
find_package(OpenGL 2)

if (OPENGL_FOUND)
add_library(vkl_opengl INTERFACE)
target_compile_definitions(vkl_opengl INTERFACE GL_SILENCE_DEPRECATION)
if (TARGET OpenGL::GL)
target_link_libraries(vkl_opengl INTERFACE OpenGL::GL)
else ()
# Old versions of cmake do not create the GL targets.
target_link_libraries(vkl_opengl INTERFACE ${OPENGL_LIBRARIES})
target_include_directories(vkl_opengl INTERFACE ${OPENGL_INCLUDE_DIR})
endif ()

find_package(glfw3 REQUIRED)

set(OPENVKL_IMGUI_ROOT "${CMAKE_CURRENT_LIST_DIR}/imgui-1.83"
CACHE PATH "Path to imgui.")

add_library(imgui STATIC
${OPENVKL_IMGUI_ROOT}/imgui.cpp
${OPENVKL_IMGUI_ROOT}/imgui_draw.cpp
${OPENVKL_IMGUI_ROOT}/imgui_tables.cpp
${OPENVKL_IMGUI_ROOT}/imgui_widgets.cpp
${OPENVKL_IMGUI_ROOT}/backends/imgui_impl_glfw.cpp
${OPENVKL_IMGUI_ROOT}/backends/imgui_impl_opengl2.cpp)

target_include_directories(imgui PUBLIC ${OPENVKL_IMGUI_ROOT})
target_link_libraries(imgui PUBLIC glfw vkl_opengl)
target_compile_definitions(imgui PUBLIC VKL_HAVE_IMGUI)
endif()

target_link_libraries(vklExamples PRIVATE
openvkl_utility
openvkl_testing
imgui
vkl_example_renderers
${OPENGL_LIBRARIES}
)
if (TARGET imgui)
add_executable(vklExamples
vklExamples.cpp
BatchApplication.cpp
InteractiveApplication.cpp
ParameterGui.cpp
RenderView.cpp
TransferFunctionWidget.cpp
${VKL_RESOURCE}
)

target_include_directories(vklExamples PRIVATE ${CMAKE_CURRENT_LIST_DIR})
target_compile_definitions(vklExamples PRIVATE GL_SILENCE_DEPRECATION)
target_link_libraries(vklExamples
PRIVATE
imgui
vkl_example_renderers
)

install(TARGETS vklExamples RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
install(TARGETS vklExamples
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
endif()

## Benchmark app ##
### vklBenchmark app ##

if (BUILD_BENCHMARKS)
add_executable(vklBenchmark
window/ArcballCamera.cpp
window/VKLWindow.cpp
vklBenchmark.cpp

${VKL_RESOURCE}
)

Expand All @@ -96,7 +74,5 @@ if (BUILD_BENCHMARKS)
vkl_example_renderers
)

target_include_directories(vklBenchmark PRIVATE ${CMAKE_CURRENT_LIST_DIR})

install(TARGETS vklBenchmark RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
Loading

0 comments on commit b2cfd8a

Please sign in to comment.