Skip to content

Commit

Permalink
Merge branch 'release-2.7.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
johguenther committed Sep 30, 2021
2 parents a783bf9 + bdde2c8 commit 5269850
Show file tree
Hide file tree
Showing 41 changed files with 731 additions and 418 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
Version History
---------------

### Changes in v2.7.1:

- Use Open VKL v1.0.1 to fix sporadic slowdowns when rendering
structured regular and VDB volumes with the SciVis renderer
- Fix CMake variables and logic
- Fix crash when transferfunction.opacity = 0
- Fix bug in MPI data-parallel rendering that caused rendering to hang
- Workaround dynamic linking issue on Windows in MPI distributed
rendering
- Correctly initialize renderFrame progress
- Improved performance of data-parallel rendering for scenes with
a large number of regions
- Expanded camera model support of the data-parallel renderer,
data-parallel rendering can now use all the camera models supported
by the scivis renderer
- Clarify documentation and error messages

### Changes in v2.7.0:

- Add support for transformation and camera Motion Blur (with the path
Expand Down
50 changes: 26 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
OSPRay
======

This is release v2.7.0 of Intel® OSPRay. For changes and new features
This is release v2.7.1 of Intel® OSPRay. For changes and new features
see the [changelog](CHANGELOG.md). Visit http://www.ospray.org for more
information.

Expand Down Expand Up @@ -100,7 +100,7 @@ before you can build OSPRay you need the following prerequisites:
`embree_DIR`.

- OSPRay also heavily uses Intel [Open VKL](https://www.openvkl.org/),
installing version 1.0.0 or newer is required. If Open VKL is not
installing version 1.0.1 or newer is required. If Open VKL is not
found by CMake its location can be hinted with the variable
`openvkl_DIR`.

Expand Down Expand Up @@ -1782,17 +1782,16 @@ group.
By adding `OSPGeometricModel`s to the `clippingGeometry` array a
clipping geometry feature is enabled. Geometries assigned to this
parameter will be used as clipping geometries. Any supported geometry
can be used for clipping. The only requirement is that it has to
distinctly partition space into clipping and non-clipping one. These
include: spheres, boxes, infinite planes, closed meshes, closed
subdivisions and curves. All geometries and volumes assigned to
`geometry` or `volume` will be clipped. Use of clipping geometry that is
not closed (or infinite) will result in rendering artifacts. User can
decide which part of space is clipped by changing shading normals
orientation with the `invertNormals` flag of the
[GeometricModel](#geometricmodels). When more than single clipping
geometry is defined all clipping areas will be “added” together – an
union of these areas will be applied.
can be used for clipping[6], the only requirement is that it has to
distinctly partition space into clipping and non-clipping one. The use
of clipping geometry that is not closed or infinite could result in
rendering artifacts. User can decide which part of space is clipped by
changing shading normals orientation with the `invertNormals` flag of
the [GeometricModel](#geometricmodels). All geometries and volumes
assigned to `geometry` or `volume` will be clipped. All clipping
geometries from all groups and [Instances](#instances) will be combined
together – a union of these areas will be applied to all other objects
in the [world](#world).
| Type | Name | Default | Description |
|:-----------------------|:-----------------|--------:|:----------------------------------------------------------------------------------------------------------------------------------------------------------------|
Expand Down Expand Up @@ -1848,7 +1847,7 @@ world has been committed. To get this information, call
OSPBounds ospGetBounds(OSPObject);
```
The result is returned in the provided `OSPBounds`[6] struct:
The result is returned in the provided `OSPBounds`[7] struct:
``` cpp
typedef struct {
Expand Down Expand Up @@ -1957,7 +1956,7 @@ renderers, the SciVis renderer supports the following parameters:
Special parameters understood by the SciVis renderer.
Note that the intensity (and color) of AO is deduced from an [ambient
light](#ambient-light) in the `lights` array.[7] If `aoSamples` is zero
light](#ambient-light) in the `lights` array.[8] If `aoSamples` is zero
(the default) then ambient lights cause ambient illumination (without
occlusion).
Expand Down Expand Up @@ -2074,7 +2073,7 @@ the opacity `d`.
Normal mapping can simulate small geometric features via the texture
`map_Bump`. The normals *n* in the normal map are with respect to the
local tangential shading coordinate system and are encoded as
½(*n* + 1), thus a texel (0.5, 0.5, 1)[8] represents the unperturbed
½(*n* + 1), thus a texel (0.5, 0.5, 1)[9] represents the unperturbed
shading normal (0, 0, 1). Because of this encoding an sRGB gamma
[texture](#texture) format is ignored and normals are always fetched as
linear from a normal map. Note that the orientation of normal maps is
Expand Down Expand Up @@ -3225,7 +3224,7 @@ ospTutorial
A minimal working example demonstrating how to use OSPRay can be found
at
[`apps/tutorials/ospTutorial.c`](https://github.com/ospray/ospray/blob/master/apps/ospTutorial/ospTutorial.c)[9].
[`apps/tutorials/ospTutorial.c`](https://github.com/ospray/ospray/blob/master/apps/ospTutorial/ospTutorial.c)[10].
An example of building `ospTutorial.c` with CMake can be found in
[`apps/tutorials/ospTutorialFindospray/`](https://github.com/ospray/ospray/tree/master/apps/ospTutorial/ospTutorialFindospray).
Expand Down Expand Up @@ -3384,7 +3383,7 @@ ospMPIDistribTutorial
A minimal working example demonstrating how to use OSPRay for rendering
distributed data can be found at
[`modules/mpi/tutorials/ospMPIDistribTutorial.c`](https://github.com/ospray/ospray/blob/master/modules/mpi/tutorials/ospMPIDistribTutorial.c)[10].
[`modules/mpi/tutorials/ospMPIDistribTutorial.c`](https://github.com/ospray/ospray/blob/master/modules/mpi/tutorials/ospMPIDistribTutorial.c)[11].
The compilation process via CMake is the similar to
[`apps/tutorials/ospTutorialFindospray/`](https://github.com/ospray/ospray/tree/master/apps/ospTutorial/ospTutorialFindospray),
Expand Down Expand Up @@ -3508,22 +3507,25 @@ voxel changes the quickest.
[5] actually a parallelogram
[6] `OSPBounds` has essentially the same layout as the `OSP_BOX3F`
[6] including spheres, boxes, infinite planes, closed meshes, closed
subdivisions and curves
[7] `OSPBounds` has essentially the same layout as the `OSP_BOX3F`
[`OSPDataType`](#data).
[7] If there are multiple ambient lights then their contribution is
[8] If there are multiple ambient lights then their contribution is
added.
[8] respectively (127, 127, 255) for 8 bit textures and
[9] respectively (127, 127, 255) for 8 bit textures and
(32767, 32767, 65535) for 16 bit textures
[9] A C++ version that uses the C++ convenience wrappers of OSPRay’s C99
API via
[10] A C++ version that uses the C++ convenience wrappers of OSPRay’s
C99 API via
[`include/ospray/ospray_cpp.h`](https://github.com/ospray/ospray/blob/master/ospray/include/ospray/ospray_cpp.h)
is available at
[`apps/tutorials/ospTutorial.cpp`](https://github.com/ospray/ospray/blob/master/apps/ospTutorial/ospTutorial.cpp).
[10] A C++ version that uses the C++ convenience wrappers of OSPRay’s
[11] A C++ version that uses the C++ convenience wrappers of OSPRay’s
C99 API via
[`include/ospray/ospray_cpp.h`](https://github.com/ospray/ospray/blob/master/ospray/include/ospray/ospray_cpp.h)
is available at
Expand Down
4 changes: 2 additions & 2 deletions apps/common/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Copyright 2009-2020 Intel Corporation
## Copyright 2009-2021 Intel Corporation
## SPDX-License-Identifier: Apache-2.0

if (NOT OSPRAY_APPS_BENCHARK AND
if (NOT OSPRAY_APPS_BENCHMARK AND
NOT OSPRAY_APPS_EXAMPLES AND
NOT OSPRAY_APPS_TESTING)
return()
Expand Down
2 changes: 1 addition & 1 deletion cmake/ospray_options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ set(OSPRAY_CMAKECONFIG_DIR

set(RKCOMMON_VERSION_REQUIRED 1.7.0)
set(EMBREE_VERSION_REQUIRED 3.13.1)
set(OPENVKL_VERSION_REQUIRED 1.0.0)
set(OPENVKL_VERSION_REQUIRED 1.0.1)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
Expand Down
2 changes: 1 addition & 1 deletion cmake/ospray_version.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

set(OSPRAY_VERSION_MAJOR 2)
set(OSPRAY_VERSION_MINOR 7)
set(OSPRAY_VERSION_PATCH 0)
set(OSPRAY_VERSION_PATCH 1)
set(OSPRAY_SOVERSION 2)
set(OSPRAY_VERSION_GITHASH 0)
set(OSPRAY_VERSION_NOTE "")
Expand Down
20 changes: 10 additions & 10 deletions doc/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1697,16 +1697,16 @@ group.
By adding `OSPGeometricModel`s to the `clippingGeometry` array a
clipping geometry feature is enabled. Geometries assigned to this
parameter will be used as clipping geometries. Any supported geometry
can be used for clipping. The only requirement is that it has to
distinctly partition space into clipping and non-clipping one. These
include: spheres, boxes, infinite planes, closed meshes, closed
subdivisions and curves. All geometries and volumes assigned to
`geometry` or `volume` will be clipped. Use of clipping geometry that is
not closed (or infinite) will result in rendering artifacts. User can
decide which part of space is clipped by changing shading normals
orientation with the `invertNormals` flag of the [GeometricModel]. When
more than single clipping geometry is defined all clipping areas will be
"added" together – an union of these areas will be applied.
can be used for clipping^[including spheres, boxes, infinite planes,
closed meshes, closed subdivisions and curves], the only requirement is
that it has to distinctly partition space into clipping and non-clipping
one. The use of clipping geometry that is not closed or infinite could
result in rendering artifacts. User can decide which part of space is
clipped by changing shading normals orientation with the `invertNormals`
flag of the [GeometricModel]. All geometries and volumes assigned to
`geometry` or `volume` will be clipped. All clipping geometries from all
groups and [Instances] will be combined together – a union of these
areas will be applied to all other objects in the [world].

-------------------- ---------------- ---------- --------------------------------------
Type Name Default Description
Expand Down
2 changes: 1 addition & 1 deletion doc/compilation.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ before you can build OSPRay you need the following prerequisites:
or newer is required. If Embree is not found by CMake its location
can be hinted with the variable `embree_DIR`.
- OSPRay also heavily uses Intel [Open VKL](https://www.openvkl.org/),
installing version 1.0.0 or newer is required. If Open VKL is not
installing version 1.0.1 or newer is required. If Open VKL is not
found by CMake its location can be hinted with the variable
`openvkl_DIR`.
- OSPRay also provides an optional module implementing the `denoiser`
Expand Down
2 changes: 1 addition & 1 deletion modules/mpi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ cmake_dependent_option(
OSPRAY_MPI_BUILD_TUTORIALS
"Enable MPI module sample apps"
ON
"OSPRAY_MODULE_MPI;OSPRAY_ENABLE_APPS"
"OSPRAY_MODULE_MPI;OSPRAY_ENABLE_APPS;OSPRAY_APPS_EXAMPLES"
OFF
)

Expand Down
101 changes: 35 additions & 66 deletions modules/mpi/ospray/common/DistributedWorld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,55 +16,6 @@ namespace mpi {

using namespace rkcommon;

void RegionScreenBounds::extend(const vec3f &p)
{
if (p.z < 0) {
bounds = box2f(vec2f(0), vec2f(1));
} else {
bounds.extend(vec2f(p.x * sign(p.z), p.y * sign(p.z)));
bounds.lower.x = clamp(bounds.lower.x);
bounds.upper.x = clamp(bounds.upper.x);
bounds.lower.y = clamp(bounds.lower.y);
bounds.upper.y = clamp(bounds.upper.y);
}
}

Region::Region(const box3f &bounds, int id) : bounds(bounds), id(id) {}

RegionScreenBounds Region::project(const Camera *camera) const
{
RegionScreenBounds screen;
for (int k = 0; k < 2; ++k) {
vec3f pt;
pt.z = k == 0 ? bounds.lower.z : bounds.upper.z;

for (int j = 0; j < 2; ++j) {
pt.y = j == 0 ? bounds.lower.y : bounds.upper.y;

for (int i = 0; i < 2; ++i) {
pt.x = i == 0 ? bounds.lower.x : bounds.upper.x;

ProjectedPoint proj = camera->projectPoint(pt);
screen.extend(proj.screenPos);
screen.depth = std::max(length(pt - camera->pos), screen.depth);
}
}
}
return screen;
}

bool Region::operator==(const Region &b) const
{
// TODO: Do we want users to specify the ID explitly? Or should we just
// assume that two objects with the same bounds have the same id?
return id == b.id;
}

bool Region::operator<(const Region &b) const
{
return id < b.id;
}

DistributedWorld::DistributedWorld() : mpiGroup(mpicommon::worker.dup())
{
managedObjectType = OSP_WORLD;
Expand All @@ -79,8 +30,8 @@ DistributedWorld::~DistributedWorld()
box3f DistributedWorld::getBounds() const
{
box3f bounds;
for (const auto &r : allRegions) {
bounds.extend(r.bounds);
for (const auto &b : allRegions) {
bounds.extend(b);
}
return bounds;
}
Expand Down Expand Up @@ -129,16 +80,41 @@ void DistributedWorld::commit()
// to the others to build the distributed world
std::sort(
myRegions.begin(), myRegions.end(), [](const box3f &a, const box3f &b) {
std::less<vec3f> op;
return op(a.lower, b.lower)
|| (a.lower == b.lower && op(a.upper, b.upper));
return a.lower < b.lower || (a.lower == b.lower && a.upper < b.upper);
});
auto last = std::unique(myRegions.begin(), myRegions.end());
myRegions.erase(last, myRegions.end());

exchangeRegions();

ispc::DistributedWorld_set(getIE(), allRegions.data(), allRegions.size());
if (regionScene) {
rtcReleaseScene(regionScene);
regionScene = nullptr;
}

if (allRegions.size() > 0) {
// Setup the boxes geometry which we'll use to leverage Embree for
// accurately determining region visibility
Data* allRegionsData = new Data(allRegions.data(),
OSP_BOX3F,
vec3ul(allRegions.size(), 1, 1),
vec3l(0));
regionGeometry = new Boxes();
regionGeometry->setParam("box", (ManagedObject *)allRegionsData);
regionGeometry->setDevice(embreeDevice);
regionGeometry->commit();

regionScene = rtcNewScene(embreeDevice);
rtcAttachGeometry(regionScene, regionGeometry->embreeGeometry);
rtcSetSceneFlags(regionScene, RTC_SCENE_FLAG_CONTEXT_FILTER_FUNCTION);
rtcCommitScene(regionScene);

regionGeometry->refDec();
allRegionsData->refDec();
}

ispc::DistributedWorld_set(
getIE(), allRegions.data(), allRegions.size(), regionScene);
}

void DistributedWorld::exchangeRegions()
Expand All @@ -160,11 +136,11 @@ void DistributedWorld::exchangeRegions()
for (const auto &b : myRegions) {
auto fnd = std::find_if(allRegions.begin(),
allRegions.end(),
[&](const Region &r) { return r.bounds == b; });
[&](const box3f &r) { return r == b; });
int id = -1;
if (fnd == allRegions.end()) {
id = allRegions.size();
allRegions.push_back(Region(b, id));
allRegions.push_back(b);
} else {
id = std::distance(allRegions.begin(), fnd);
}
Expand All @@ -189,11 +165,11 @@ void DistributedWorld::exchangeRegions()
for (const auto &b : recv) {
auto fnd = std::find_if(allRegions.begin(),
allRegions.end(),
[&](const Region &r) { return r.bounds == b; });
[&](const box3f &r) { return r == b; });
int id = -1;
if (fnd == allRegions.end()) {
id = allRegions.size();
allRegions.push_back(Region(b, id));
allRegions.push_back(b);
} else {
id = std::distance(allRegions.begin(), fnd);
}
Expand Down Expand Up @@ -230,10 +206,3 @@ void DistributedWorld::exchangeRegions()
} // namespace mpi
} // namespace ospray

using namespace ospray::mpi;

std::ostream &operator<<(std::ostream &os, const Region &r)
{
os << "Region { id = " << r.id << ", bounds = " << r.bounds << " }";
return os;
}
Loading

0 comments on commit 5269850

Please sign in to comment.