-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
51 changed files
with
1,891 additions
and
314 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
## Copyright 2022 Intel Corporation | ||
## SPDX-License-Identifier: Apache-2.0 | ||
|
||
# The minimal_01 ... minimal_06 examples gradually increase in complexity | ||
foreach(i 01 02 03 04 05 06) | ||
add_executable(vklMinimal_${i} minimal_${i}.cpp ${VKL_RESOURCE}) | ||
target_link_libraries(vklMinimal_${i} PRIVATE openvkl) | ||
install(TARGETS vklMinimal_${i} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) | ||
endforeach() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Intel® Open Volume Kernel Library: Minimal Examples | ||
|
||
This directory contains a sequence of minimal code examples that make use of | ||
Open VKL. These examples are designed to be read and understood in sequence; | ||
each example builds upon the previous one. | ||
|
||
The examples provided are: | ||
|
||
- `minimal_01.cpp`: prerequisite code infrastructure for managing a framebuffer, | ||
using a transfer function, and drawing the frame buffer to the terminal. | ||
- `minimal_02.cpp`: initializing Open VKL | ||
- `minimal_03.cpp`: instantiating a VKL volume, sampler, and rendering a slice | ||
- `minimal_04.cpp`: changing volume types | ||
- `minimal_05.cpp`: creating a ray marching volume renderer | ||
- `minimal_06.cpp`: creating an isosurface renderer | ||
|
||
For more complex examples, see the `vklExamples` application and corresponding | ||
code. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright 2021-2022 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#pragma once | ||
|
||
#include "field.h" | ||
|
||
#include <vector> | ||
#include <cstddef> | ||
|
||
// The structured regular volume expects a data buffer that contains | ||
// all voxel values. We create it here by sampling the field() function, but | ||
// this data could be the output of a simulation, or loaded from disk. | ||
inline std::vector<float> createVoxels(size_t res) | ||
{ | ||
std::vector<float> voxels(res * res * res); | ||
for (size_t z = 0; z < res; ++z) | ||
for (size_t y = 0; y < res; ++y) | ||
for (size_t x = 0; x < res; ++x) { | ||
const float fx = x / static_cast<float>(res); | ||
const float fy = y / static_cast<float>(res); | ||
const float fz = z / static_cast<float>(res); | ||
const size_t idx = z * res * res + y * res + x; | ||
voxels[idx] = field(fx, fy, fz); | ||
} | ||
return voxels; | ||
} |
Oops, something went wrong.