From 7a871d91a23c73c1ac20873f603ca5bcd2d7a710 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20G=C3=BCnther?= Date: Thu, 24 Oct 2024 13:35:27 +0200 Subject: [PATCH 1/8] Remove unused lights from MPIDistribTutorial --- modules/mpi/tutorials/ospMPIDistribTutorialSpheres.cpp | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/modules/mpi/tutorials/ospMPIDistribTutorialSpheres.cpp b/modules/mpi/tutorials/ospMPIDistribTutorialSpheres.cpp index 22c16a617..d9e6f6c1d 100644 --- a/modules/mpi/tutorials/ospMPIDistribTutorialSpheres.cpp +++ b/modules/mpi/tutorials/ospMPIDistribTutorialSpheres.cpp @@ -94,16 +94,6 @@ int main(int argc, char **argv) // create OSPRay renderer cpp::Renderer renderer("mpiRaycast"); - - // create and setup an ambient light - std::array lights = { - cpp::Light("ambient"), cpp::Light("distant")}; - lights[0].commit(); - - lights[1].setParam("direction", vec3f(-1.f, -1.f, 0.5f)); - lights[1].commit(); - - renderer.setParam("lights", cpp::CopiedData(lights)); renderer.setParam("aoSamples", 1); // create a GLFW OSPRay window: this object will create and manage the From 52cdaf496637bf6514491ce7a8c13316ae124453 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20G=C3=BCnther?= Date: Thu, 14 Nov 2024 12:56:20 +0100 Subject: [PATCH 2/8] Docu: Unstructured clarifications --- doc/api.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/doc/api.md b/doc/api.md index 5df718c2f..84edff378 100644 --- a/doc/api.md +++ b/doc/api.md @@ -832,11 +832,12 @@ the vertices and data values. Vertex ordering is the same as `VTK_PYRAMID`: four bottom vertices counterclockwise, then the top vertex. -To maintain VTK data compatibility, the `index` array may be specified -with cell sizes interleaved with vertex indices in the following format: -$n, id_1, ..., id_n, m, id_1, ..., id_m$. This alternative `index` array -layout can be enabled through the `indexPrefixed` flag (in which case, -the `cell.type` parameter must be omitted). +For backward compatibility with legacy vtkCellArray the `index` array +can also be specified with cell sizes interleaved with vertex indices in +the following format: $n, id_1, ..., id_n, m, id_1, ..., id_m$. This +alternative `index` array layout can be enabled through the +`indexPrefixed` flag (in which case, the `cell.type` parameter must be +omitted). ------------------- ------------------ -------- --------------------------------------- Type Name Default Description @@ -850,9 +851,9 @@ the `cell.type` parameter must be omitted). vertex array(s)) that form cells bool indexPrefixed false indicates that the `index` array is - compatible to VTK, where the indices of - each cell are prefixed with the number - of vertices + compatible to legacy vtkCellArray, + where the indices of each cell are + prefixed with the number of vertices uint32[] / uint64[] cell.index [data] array of locations (into the index array), specifying the first index From 9718d67fc988470f75cae3cda2a3d6087e87ca00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20G=C3=BCnther?= Date: Thu, 9 Jan 2025 10:50:40 +0100 Subject: [PATCH 3/8] Update and reformat changelog --- CHANGELOG.md | 192 +++++++++++++++++++++++++++------------------------ 1 file changed, 100 insertions(+), 92 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca6af4e3e..87e911af7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,34 +4,38 @@ Version History ### Changes in v3.3.0: - Add more framebuffer channels and options: - - Parameter `bool projectedDepth` to switch from euclidean to - projected distance for channel `OSP_FB_DEPTH` (often the distance - to the image plane, or simply depth) - - Channel `OSP_FB_FIRST_NORMAL` holds the world-space normal of the - *first* hit (as opposed to `OSP_FB_NORMAL`, which holds the normal - of the first *non-specular* hit for denoising) - - Channel `OSP_FB_POSITION` holds the world-space position of the first hit + - Parameter `bool projectedDepth` to switch from euclidean to + projected distance for channel `OSP_FB_DEPTH` (often the + distance to the image plane, or simply depth) + - Channel `OSP_FB_FIRST_NORMAL` holds the world-space normal of + the *first* hit (as opposed to `OSP_FB_NORMAL`, which holds the + normal of the first *non-specular* hit for denoising) + - Channel `OSP_FB_POSITION` holds the world-space position of the + first hit - Improved sampling of layered materials - New parameter `specularMetallic` for the Principled material to optionally disable the incluence of `specular` to metallicness, improving compatibility with glTF `KHR_materials_specular` - Improvements to and documentation of the pathtracer's Shadow Catcher feature (enabled via parameter `shadowCatcherPlane`) +- Bug fixes + - Find geometry lights after first empty instance + - Segfault when `numPrimitives()` is called before `commit()` ### Changes in v3.2.0: - Sampling improvements: - - Better performance (lower rendering time and faster convergence) - - More pleasing blue noise enabled when the total number of frames + - Better performance (lower rendering time and faster convergence) + - More pleasing blue noise enabled when the total number of frames to be accumulated is known in advance and set as the `targetFrames` parameter at the framebuffer - - Note a maximum of 64k samples is supported + - Note a maximum of 64k samples is supported - Improved `denoiser` image operation: - - User-controlled quality levels via parameter `quality` - - Optionally denoise alpha channel as well, enabled via - parameter `denoiseAlpha` -- Support half-precision (16\ bit float) texture formats - `OSP_TEXTURE_[RGBA16F|RGB16F|RA16F|R16F]` and two-channel 32\ bit + - User-controlled quality levels via parameter `quality` + - Optionally denoise alpha channel as well, enabled via parameter + `denoiseAlpha` +- Support half-precision (16 bit float) texture formats + `OSP_TEXTURE_[RGBA16F|RGB16F|RA16F|R16F]` and two-channel 32 bit float textures `OSP_TEXTURE_RA32F` - New parameter `limitIndirectLightSamples` for the `pathtracer` which limits the number of light samples after the first non-specular @@ -40,22 +44,23 @@ Version History additional memory per texture needed cannot be spared, applications can disable the generation of MIP maps with device parameter `disableMipMapGeneration` -- The backplate (background texture) is now always sampled at the pixel - center and thus not blurred by the pixel filter anymore +- The backplate (background texture) is now always sampled at the + pixel center and thus not blurred by the pixel filter anymore - Avoid color bleeding across eye-subimages when stereo rendering - Superbuild uses binary packages of Open VKL - Removed Intel ISPCRT dependency (ISPC compiler is still needed): - oneAPI Level Zero Loader is no longer necessary - - `zeContext` and `zeDevice`device parameters are no longer supported - - `ispcrtContext` and `ispcrtDevice`device parameters are no longer + - `zeContext` and `zeDevice`device parameters are no longer supported + - `ispcrtContext` and `ispcrtDevice`device parameters are no + longer supported - Clarify the size of `OSP_BOOL` to be 1 byte - Fix artifacts occasionally appearing with `gpu` device - The new minimum versions of dependencies: - - Embree v4.3.3 (better error reporting) - - Open Image Denoise v2.3 (better image quality with `HIGH` - quality mode, added `FAST` quality mode) - - rkcommon v1.14.0 + - Embree v4.3.3 (better error reporting) + - Open Image Denoise v2.3 (better image quality with `HIGH` + quality mode, added `FAST` quality mode) + - rkcommon v1.14.0 ### Changes in v3.1.0: @@ -73,13 +78,13 @@ Version History - Fix empty image on Windows when `focusDistance=0` - Fix missing SDK headers for `ISPCDevice*` - The new minimum versions of dependencies: - - Embree v4.3.1 - - Open VKL v2.0.1 - - Open Image Denoise v2.2 (better quality with fine details, - support AArch64 CPU on Linux) - - ISPCRT v1.23.0 (uses environment variable `ISPCRT_GPU_DRIVER` - to select GPU to run on when multiple (i)GPUs are present) - - rkcommon v1.13.0 (fixes crash using GPU and emissive geometry) + - Embree v4.3.1 + - Open VKL v2.0.1 + - Open Image Denoise v2.2 (better quality with fine details, + support AArch64 CPU on Linux) + - ISPCRT v1.23.0 (uses environment variable `ISPCRT_GPU_DRIVER` to + select GPU to run on when multiple (i)GPUs are present) + - rkcommon v1.13.0 (fixes crash using GPU and emissive geometry) ### Changes in v3.0.0: @@ -88,7 +93,7 @@ Version History Implementation is based on the [SYCL](https://www.khronos.org/sycl/) cross-platform programming language implemented by [Intel oneAPI Data Parallel C++ - (DPC++)](https://www.intel.com/content/www/us/en/developer/tools/oneapi/data-parallel-c-plus-plus.html). + (DPC++)](https://www.intel.com/content/www/us/en/developer/tools/oneapi/data-parallel-c-plus-plus.html).\ Note that the following features are not implemented yet or are not working correctly on the new `gpu` device: - Multiple volumes in the scene @@ -129,14 +134,14 @@ Version History - Fix crash in HDRI light - Fix link order for Debug build on Windows - The new minimum versions of dependencies: - - Embree v4.3.0 - - Open VKL v2.0.0 - - Open Image Denoise v2.1.0 - - ISPC v1.21.1 - - rkcommon v1.12.0 + - Embree v4.3.0 + - Open VKL v2.0.0 + - Open Image Denoise v2.1.0 + - ISPC v1.21.1 + - rkcommon v1.12.0 - Breaking API changes - Renamed `OSP_TEXTURE_FILTER_BILINEAR` to - `OSP_TEXTURE_FILTER_LINEAR ` and + `OSP_TEXTURE_FILTER_LINEAR` and `OSP_VOLUME_FILTER_TRI[LINEAR|CUBIC]` to `OSP_VOLUME_FILTER_[LINEAR|CUBIC]` - Most enums now use storage type `uint32` @@ -155,7 +160,6 @@ Version History `intensityQuantity` other than `OSP_INTENSITY_QUANTITY_SCALE` - ### Changes in v2.12.0: - Support denoising on the GPU with OIDN 2.0, which is the new minimum @@ -181,9 +185,9 @@ Version History - Support for volume rendering (and thus the dependency to Open VKL) can now be compile-time controlled via CMake variable `OSPRAY_ENABLE_VOLUMES` -- OSPRay's MPI modules have been split up and renamed, the `mpiOffload` - device is now in the `mpi_offload` module, while the `mpiDistributed` - device is now in the `mpi_distributed_cpu` module +- OSPRay's MPI modules have been split up and renamed, the + `mpiOffload` device is now in the `mpi_offload` module, while the + `mpiDistributed` device is now in the `mpi_distributed_cpu` module - Add native support for spheres via Embree, which requires the positions and radius of the spheres to be interleaved in memory; if this is not the case, OSPRay will internally create a copy of the @@ -241,7 +245,7 @@ Version History the `cellCentered` parameter (vertex-centered remains the default) - Particle volumes ignore particles with zero radius -- Add support for dynamic load balancing in MPI Offload device +- Add support for dynamic load balancing in MPI Offload device - Support for photometric lights (e.g., IES or EULUMDAT) also for `sphere` and `quad` lights. When setting `intensityDistribution`, other values for `intensityQuantity` than @@ -354,7 +358,7 @@ Version History for VDB volume - Fixed artifacts for isosurfaces of unstructured volumes - Performance improvements for isosurfaces when multiple isovalues - are selected + are selected - Better, adaptive sampling of AMR volumes - The `mpiOffload` and `mpiDistributed` devices now support picking. Picking in the distributed device will return the globally closest @@ -386,13 +390,13 @@ Version History interpretation and conversion of the `intensity` into a radiative quantity - OSPRay now requires minimum Open VKL v0.12.0 to bring the following - improvements: + improvements: - Better default sampling rate for scaled volumes, improving performance - Higher robustness for axis-aligned rays -- Removed limit on the number of volumes (both overlapped and separate) - that a ray can intersect while rendering. Now it is limited by - available memory only. +- Removed limit on the number of volumes (both overlapped and + separate) that a ray can intersect while rendering. Now it is + limited by available memory only. - Move to OIDN v1.3.0 to bring the following improvements: - Improved denoising quality (sharpness of fine details, fewer noisy artifacts) @@ -401,7 +405,7 @@ Version History geometry/volume objects rebound using an object parameter - Fix light leaking artifacts at poles of HDRI (and Sun-Sky) light - Add sRGB conversion to `ospExamples` such that the color of the - widget for `backgroundColor` actually matches + widget for `backgroundColor` actually matches - Dropping support for MSVC14, new minimum compiler on Windows is MSVC15 (Visual Studio 2017) @@ -411,7 +415,7 @@ Version History background is seen through refractive objects like glass, by enabling `backgroundRefraction` - OSPRay now requires minimum Open VKL v0.11.0 to bring the following - improvements: + improvements: - Improved rendering performance of VDB volumes - Added support for configurable iterator depth via the `maxIteratorDepth` parameters for unstructured and particle @@ -451,8 +455,8 @@ Version History - Added support for data arrays with a stride between voxels in volumes - Application thread waiting for finished image via `ospWait` - participates in rendering, increasing CPU utilization; via - rkcommon v1.5.0 + participates in rendering, increasing CPU utilization; via rkcommon + v1.5.0 - Added `ospray_cpp` compatibility headers for C++ wrappers to understand rkcommon and glm short vector types - For rkcommon, include `ospray/ospray_cpp/ext/rkcommon.h` @@ -577,9 +581,9 @@ Version History - Fix issue where OSPRay always loaded the ISPC module, even if not required - Fixes for MPI module - - Fix member variable type for bcast - - Fix incorrect data size computation in `offload` device - - Fix large data chunking support for MPI Bcast + - Fix member variable type for bcast + - Fix incorrect data size computation in `offload` device + - Fix large data chunking support for MPI Bcast - OSPRay now requires minimum Open VKL v0.9.0 ### Changes in v2.0.1: @@ -608,16 +612,16 @@ Version History ### Changes in v2.0.0: - New major revision of OSPRay brings API breaking improvements over - v1.x. See [doc/ospray2_porting_guide.md] for a deeper description of - migrating from v1.x to v2.0 and the latest - [API documentation](README.md#ospray-api) - - `ospRenderFrame` now takes all participating objects as - function parameters instead of setting some as renderer params + v1.x. See \[doc/ospray2_porting_guide.md\] for a deeper description + of migrating from v1.x to v2.0 and the latest [API + documentation](README.md#ospray-api) + - `ospRenderFrame` now takes all participating objects as function + parameters instead of setting some as renderer params - `ospRenderFrame` is now asynchronous, where the task is managed through a returned `OSPFuture` handle - - The hierarchy of objects in a scene are now more granular to - aid in scene construction flexibility and reduce potential - object duplication + - The hierarchy of objects in a scene are now more granular to aid + in scene construction flexibility and reduce potential object + duplication - Type-specific parameter setting functions have been consolidated into a single `ospSetParam` API call - C++ wrappers found in `ospray_cpp.h` now automatically track @@ -633,8 +637,8 @@ Version History - All utility functions are implemented in terms of the core API found in `ospray.h`, therefore they are compatible with any device backend -- Introduction of new Intel® Open Volume Kernel Library (Open VKL) - for greatly enhanced volume sampling and rendering features and +- Introduction of new Intel® Open Volume Kernel Library (Open VKL) for + greatly enhanced volume sampling and rendering features and performance - Added direct support for Intel® Open Image Denoise as an optional module, which adds a `denoiser` type to `ospNewImageOperation` @@ -643,8 +647,8 @@ Version History and OSPRay itself - Found in `scripts/superbuild` - See documentation for more details and example usage -- The `ospcommon` library now lives as a stand alone repository and - is required to build OSPRay +- The `ospcommon` library now lives as a stand alone repository and is + required to build OSPRay - The MPI module is now a separate repository, which also contains all MPI distributed rendering documentation - Log levels are now controlled with enums and named strings (where @@ -671,11 +675,12 @@ Version History - Introduction of new `boxes` geometry type - Expansion of information returned by `ospPick` - Addition of API to query version information at runtime -- Curves now supports both, per vertex varying radii as in `vec4f[] - vertex.position_radius` and constant radius for the geometry with - `float radius`. It uses `OSP_ROUND` type and `OSP_LINEAR` basis by - default to create the connected segments of constant radius. For per - vertex varying radii curves it uses Embree curves. +- Curves now supports both, per vertex varying radii as in + `vec4f[] vertex.position_radius` and constant radius for the + geometry with `float radius`. It uses `OSP_ROUND` type and + `OSP_LINEAR` basis by default to create the connected segments of + constant radius. For per vertex varying radii curves it uses Embree + curves. - Add new Embree curve type `OSP_CATMULL_ROM` for curves - Minimum required Embree version is now 3.7.0 - Removal of `cylinders` and `streamlines` geometry, use `curves` @@ -713,15 +718,16 @@ Version History `ospray::mpi::TileOperation`, respectively. See the `ospray::mpi::DistributedRaycastRenderer` for an example to start from. - - The MPI Offload device can now communicate over sockets, allowing - for remote rendering on clusters in the listen/connect mode + - The MPI Offload device can now communicate over sockets, + allowing for remote rendering on clusters in the listen/connect + mode - Data and commands are now sent asynchronously to the MPI workers in the Offload device, overlapping better with application work. The number of data copies performed has also been significantly reduced, and should improve load times - The MPI Distributed device will now infer the rank's local data - bounds based on the volumes and geometry specified if no bounding - boxes are specified + bounds based on the volumes and geometry specified if no + bounding boxes are specified - When specifying custom bounds on each rank IDs are no longer required, and ranks sharing data will be determined by finding any specifying the same bounding boxes. This will also be done @@ -862,8 +868,8 @@ Version History ### Changes in v1.6.0: -- Updated ispc device to use Embree3 (minimum required Embree - version is 3.1) +- Updated ispc device to use Embree3 (minimum required Embree version + is 3.1) - Added new `ospShutdown()` API function to aid in correctness and determinism of OSPRay API cleanup - Added "`Principled`" and "`CarPaint"` materials to the path tracer @@ -943,9 +949,9 @@ Version History - Fixed a crash in MPI mode when creating lights without a renderer - Fixed an issue with camera lens samples not initialized when - `spp` <= 0 - - Fixed an issue in `ospExampleViewer` when specifying multiple data - files + `spp` \<= 0 + - Fixed an issue in `ospExampleViewer` when specifying multiple + data files - The C99 tutorial is now indicated as the default; the C++ wrappers do not change the semantics of the API (memory management) so the C99 version should be considered first when learning the API @@ -1079,8 +1085,8 @@ Version History - Devices can be created and set current, creating an alternative method for initializing the API - New API functions for committing parameters on Devices -- Removed support for the first generation Intel® Xeon Phi™ coprocessor - (codename Knights Corner) +- Removed support for the first generation Intel® Xeon Phi™ + coprocessor (codename Knights Corner) - Other minor improvements, updates, and bug fixes - Updated Embree required version to v2.13.0 for added features and performance @@ -1130,14 +1136,15 @@ Version History Xeon Phi coprocessor (codename Knights Corner) - Future major and minor releases will be upgraded to the latest version of Embree, which no longer supports Knights Corner - - Depending on user feedback, patch releases are still made to - fix bugs + - Depending on user feedback, patch releases are still made to fix + bugs - Enhanced output statistics in `ospBenchmark` application - Many fixes to the OSPRay SDK - Improved CMake detection of compile-time enabled features - Now distribute OSPRay configuration and ISPC CMake macros - Improved SDK support on Windows -- OSPRay library can now be compiled with `-Wall` and `-Wextra` enabled +- OSPRay library can now be compiled with `-Wall` and `-Wextra` + enabled - Tested with GCC v5.3.1 and Clang v3.8 - Sample applications and modules have not been fixed yet, thus applications which build OSPRay as a CMake subproject should @@ -1205,9 +1212,9 @@ Version History - Added new tasking options: `Cilk`, `Internal`, and `Debug` - Provides more ways for OSPRay to interact with calling application tasking systems - - `Cilk`: Use Intel® Cilk™ Plus language extensions (icc only) - - `Internal`: Use hand written OSPRay tasking system - - `Debug`: All tasks are run in serial (useful for debugging) + - `Cilk`: Use Intel® Cilk™ Plus language extensions (icc only) + - `Internal`: Use hand written OSPRay tasking system + - `Debug`: All tasks are run in serial (useful for debugging) - In most cases, Intel Threading Building Blocks (Intel `TBB`) remains the fastest option - Added support for adaptive accumulation and stopping @@ -1264,7 +1271,8 @@ Version History renderer - Updated default renderer to be "ao1" in ospModelViewer - Trianglemesh `postIntersect` shading is now 64-bit safe - - Texture2D has been reworked, with many improvements and bug fixes + - Texture2D has been reworked, with many improvements and bug + fixes - Fixed bug where MPI device would freeze while rendering frames with Intel TBB - Updates to CMake with better error messages when Intel TBB is @@ -1372,14 +1380,14 @@ changes. `gridSpacing` parameters - New `shared_structured_volume` volume type that allows voxel data to be provided by applications through a shared data buffer - - New API call to set (sub-)regions of volume data (`ospSetRegion()`) + - New API call to set (sub-)regions of volume data + (`ospSetRegion()`) - Added a subsampling-mode, enabled with a negative `spp` parameter; the first frame after scene changes is rendered with reduced resolution, increasing interactivity - Added multi-target ISA support: OSPRay will now select the appropriate ISA at runtime -- Added support for the Stanford SEP file format to the seismic - module +- Added support for the Stanford SEP file format to the seismic module - Added `--osp:numthreads ` command line option to restrict the number of threads OSPRay creates - Various bug fixes, cleanups and documentation updates throughout the From 0ddce28b5176e6861bb48d249ce32b9926c8ca65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20G=C3=BCnther?= Date: Mon, 25 Nov 2024 13:06:15 +0100 Subject: [PATCH 4/8] Fix initialization of OpenGL on OSX, closes #601 --- CHANGELOG.md | 1 + apps/ospExamples/GLFWOSPRayWindow.cpp | 2 +- modules/mpi/tutorials/GLFWDistribOSPRayWindow.cpp | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 87e911af7..830f62350 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ Version History - Bug fixes - Find geometry lights after first empty instance - Segfault when `numPrimitives()` is called before `commit()` + - Initialization of OpenGL on OSX ### Changes in v3.2.0: diff --git a/apps/ospExamples/GLFWOSPRayWindow.cpp b/apps/ospExamples/GLFWOSPRayWindow.cpp index 4e4ef1ab7..e040b4711 100644 --- a/apps/ospExamples/GLFWOSPRayWindow.cpp +++ b/apps/ospExamples/GLFWOSPRayWindow.cpp @@ -164,7 +164,7 @@ GLFWOSPRayWindow::GLFWOSPRayWindow( glfwWindowHint(GLFW_SRGB_CAPABLE, GLFW_TRUE); glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); -#ifdef __APPLE_ +#ifdef __APPLE__ glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2); glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); const char *glslVersion = "#version 150"; diff --git a/modules/mpi/tutorials/GLFWDistribOSPRayWindow.cpp b/modules/mpi/tutorials/GLFWDistribOSPRayWindow.cpp index 1f1cab857..fbc77dfd5 100644 --- a/modules/mpi/tutorials/GLFWDistribOSPRayWindow.cpp +++ b/modules/mpi/tutorials/GLFWDistribOSPRayWindow.cpp @@ -55,7 +55,7 @@ GLFWDistribOSPRayWindow::GLFWDistribOSPRayWindow(const vec2i &windowSize, glfwWindowHint(GLFW_SRGB_CAPABLE, GLFW_TRUE); glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); -#ifdef __APPLE_ +#ifdef __APPLE__ glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2); glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); const char *glslVersion = "#version 150"; From 184109847578f86cd42e41ee2a03885f63681263 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20G=C3=BCnther?= Date: Mon, 2 Dec 2024 19:12:08 +0100 Subject: [PATCH 5/8] Optimized computation of Sobol dim2, +1% overall perf --- CHANGELOG.md | 4 +++- modules/cpu/math/sobol.ih | 45 +++++++++++++++++++++++--------------- modules/cpu/math/sobol.inl | 34 +--------------------------- 3 files changed, 31 insertions(+), 52 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 830f62350..2c3840e96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,9 @@ Version History normal of the first *non-specular* hit for denoising) - Channel `OSP_FB_POSITION` holds the world-space position of the first hit -- Improved sampling of layered materials +- Sampling improvements: + - Improved sampling of layered materials + - Faster sample computation - New parameter `specularMetallic` for the Principled material to optionally disable the incluence of `specular` to metallicness, improving compatibility with glTF `KHR_materials_specular` diff --git a/modules/cpu/math/sobol.ih b/modules/cpu/math/sobol.ih index b24431d60..0cb0f023d 100644 --- a/modules/cpu/math/sobol.ih +++ b/modules/cpu/math/sobol.ih @@ -30,19 +30,30 @@ OSPRAY_BEGIN_ISPC_NAMESPACE #ifdef OSPRAY_TARGET_SYCL #include "sobol.inl" #else -extern const uniform unsigned int Sobol_revMatrices[4 * 32]; +extern const uniform unsigned int Sobol_revMatrices[3 * 32]; extern const uniform unsigned int Sobol_matrices[5 * 52]; #endif +// compute component 1 of the Sobol'-sequence (count starting from 0) +// Ahmed, "An Implementation Algorithm of 2D Sobol Sequence Fast, Elegant, and +// Compact", EGSR 2024, https://doi.org/10.2312/sr.20241147 +inline uint32 Sobol_revSample1(uint32 v) +{ + v ^= v << 16; + v ^= (v & 0x00FF00FFu) << 8; + v ^= (v & 0x0F0F0F0Fu) << 4; + v ^= (v & 0x33333333u) << 2; + v ^= (v & 0x55555555u) << 1; + return reverseBits(v); +} + // compute components 1 and 2 of the Sobol'-sequence (count starting from 0) inline vec2ui Sobol_revSample2(uint32 revIndex) { - vec2ui result = make_vec2ui(0); - for (uniform uint32 i = 0; revIndex; revIndex <<= 1, i += 4) { - if (revIndex & 0x80000000u) { - result.x ^= Sobol_revMatrices[i]; - result.y ^= Sobol_revMatrices[i + 1]; - } + vec2ui result = make_vec2ui(Sobol_revSample1(revIndex), 0u); + for (uniform uint32 i = 0; revIndex; revIndex <<= 1, i += 3) { + if (revIndex & 0x80000000u) + result.y ^= Sobol_revMatrices[i]; } return result; @@ -51,12 +62,11 @@ inline vec2ui Sobol_revSample2(uint32 revIndex) // compute components 1 to 3 of the Sobol'-sequence (count starting from 0) inline vec3ui Sobol_revSample3(uint32 revIndex) { - vec3ui result = make_vec3ui(0); - for (uniform uint32 i = 0; revIndex; revIndex <<= 1, i += 4) { + vec3ui result = make_vec3ui(Sobol_revSample1(revIndex), 0u, 0u); + for (uniform uint32 i = 0; revIndex; revIndex <<= 1, i += 3) { if (revIndex & 0x80000000u) { - result.x ^= Sobol_revMatrices[i]; - result.y ^= Sobol_revMatrices[i + 1]; - result.z ^= Sobol_revMatrices[i + 2]; + result.y ^= Sobol_revMatrices[i]; + result.z ^= Sobol_revMatrices[i + 1]; } } @@ -66,13 +76,12 @@ inline vec3ui Sobol_revSample3(uint32 revIndex) // compute components 1 to 4 of the Sobol'-sequence (count starting from 0) inline vec4ui Sobol_revSample4(uint32 revIndex) { - vec4ui result = make_vec4ui(0); - for (uniform uint32 i = 0; revIndex; revIndex <<= 1, i += 4) { + vec4ui result = make_vec4ui(Sobol_revSample1(revIndex), 0u, 0u, 0u); + for (uniform uint32 i = 0; revIndex; revIndex <<= 1, i += 3) { if (revIndex & 0x80000000u) { - result.x ^= Sobol_revMatrices[i]; - result.y ^= Sobol_revMatrices[i + 1]; - result.z ^= Sobol_revMatrices[i + 2]; - result.w ^= Sobol_revMatrices[i + 3]; + result.y ^= Sobol_revMatrices[i]; + result.z ^= Sobol_revMatrices[i + 1]; + result.w ^= Sobol_revMatrices[i + 2]; } } diff --git a/modules/cpu/math/sobol.inl b/modules/cpu/math/sobol.inl index dd7dfcd5b..f66fc516a 100644 --- a/modules/cpu/math/sobol.inl +++ b/modules/cpu/math/sobol.inl @@ -30,163 +30,131 @@ // http://web.maths.unsw.edu.au/~fkuo/sobol/new-joe-kuo-6.21201 // bit-reversed and interleaved -OSPRAY_GLOBAL const unsigned int Sobol_revMatrices[4 * 32] = { - 0x1u, +OSPRAY_GLOBAL const unsigned int Sobol_revMatrices[3 * 32] = { 0x1u, 0x1u, 0x1u, - 0x3u, 0x3u, 0x3u, 0x2u, - 0x5u, 0x6u, 0x4u, 0x4u, - 0xfu, 0x9u, 0xau, 0xdu, - 0x11u, 0x17u, 0x1fu, 0x1fu, - 0x33u, 0x3au, 0x2eu, 0x3bu, - 0x55u, 0x71u, 0x45u, 0x5eu, - 0xffu, 0xa3u, 0xc9u, 0xb9u, - 0x101u, 0x116u, 0x11bu, 0x15au, - 0x303u, 0x339u, 0x2a4u, 0x3f4u, - 0x505u, 0x677u, 0x79au, 0x685u, - 0xf0fu, 0x9aau, 0xb67u, 0xd0fu, - 0x1111u, 0x1601u, 0x101eu, 0x115bu, - 0x3333u, 0x3903u, 0x302du, 0x23f6u, - 0x5555u, 0x7706u, 0x4041u, 0x4681u, - 0xffffu, 0xaa09u, 0xa0c3u, 0xdd02u, - 0x10001u, 0x10117u, 0x1f104u, 0x1e144u, - 0x30003u, 0x3033au, 0x2e28au, 0x393cdu, - 0x50005u, 0x60671u, 0x457dfu, 0x5a6dfu, - 0xf000fu, 0x909a3u, 0xc9baeu, 0xb4dbbu, - 0x110011u, 0x171616u, 0x11a105u, 0x14401eu, - 0x330033u, 0x3a3939u, 0x2a7289u, 0x3cd039u, - 0x550055u, 0x717777u, 0x79e7dbu, 0x6df05au, - 0xff00ffu, 0xa3aaaau, 0xb6dba4u, 0xdbb0b4u, - 0x1010101u, 0x1170001u, 0x100011au, 0x101e145u, - 0x3030303u, 0x33a0003u, 0x30002a7u, 0x20393cfu, - 0x5050505u, 0x6710006u, 0x400079eu, 0x405a6dbu, - 0xf0f0f0fu, 0x9a30009u, 0xa000b6du, 0xd0b4db6u, - 0x11111111u, 0x16160017u, 0x1f001001u, 0x1f144001u, - 0x33333333u, 0x3939003au, 0x2e003003u, 0x3b3cd002u, - 0x55555555u, 0x77770071u, 0x45004004u, 0x5e6df004u, - 0xffffffffu, 0xaaaa00a3u, 0xc900a00au, 0xb9dbb00du, From fe6bf40ff6f3a52e49d7e513f6504d34a710a1e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20G=C3=BCnther?= Date: Wed, 8 Jan 2025 16:20:29 +0100 Subject: [PATCH 6/8] Verify size of OSPUnstructuredCellType enum --- .github/workflows/ci.windows.yml | 12 ++++++++++++ apps/ospTestSuite/test_enums.cpp | 1 + cmake/compiler/msvc.cmake | 3 +++ cmake/ospray_cmake_config/osprayConfig.cmake.in | 6 ++++++ 4 files changed, 22 insertions(+) diff --git a/.github/workflows/ci.windows.yml b/.github/workflows/ci.windows.yml index 1daade68e..da02193cf 100644 --- a/.github/workflows/ci.windows.yml +++ b/.github/workflows/ci.windows.yml @@ -112,3 +112,15 @@ jobs: artifact-out: test-windows-msvc17-avx512 artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed* artifact-on-failure: true + + test-find-ospray: + needs: build-windows-msvc17 + uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main + with: + cmd: | + md buildtut + cd buildtut + $env:ospray_DIR=(Get-ChildItem $env:GITHUB_WORKSPACE\build\install\ospray\lib\cmake\ospray-* | Select-Object -Expand FullName) + cmake ..\apps\ospTutorial\ospTutorialFindospray + cmake --build . + artifact-in: build-windows-msvc17 diff --git a/apps/ospTestSuite/test_enums.cpp b/apps/ospTestSuite/test_enums.cpp index 8e2113cb2..9935583e7 100644 --- a/apps/ospTestSuite/test_enums.cpp +++ b/apps/ospTestSuite/test_enums.cpp @@ -98,6 +98,7 @@ TEST(Enums, VKLUnstructuredCellType) ASSERT_EQ(OSP_HEXAHEDRON, VKL_HEXAHEDRON); ASSERT_EQ(OSP_WEDGE, VKL_WEDGE); ASSERT_EQ(OSP_PYRAMID, VKL_PYRAMID); + ASSERT_EQ(sizeof(OSPUnstructuredCellType), 1); // must fit in uint8 } TEST(Enums, VKLAMRMethod) diff --git a/cmake/compiler/msvc.cmake b/cmake/compiler/msvc.cmake index b118b75c7..1fd89cfb0 100644 --- a/cmake/compiler/msvc.cmake +++ b/cmake/compiler/msvc.cmake @@ -2,6 +2,9 @@ ## SPDX-License-Identifier: Apache-2.0 set(COMMON_CXX_FLAGS "/EHsc /MP /GR /bigobj") +if (MSVC_VERSION GREATER_EQUAL 1914) + string(APPEND COMMON_CXX_FLAGS " /Zc:__cplusplus") +endif() set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${COMMON_CXX_FLAGS}") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${COMMON_CXX_FLAGS} /Ox /fp:fast /Oi /Gy ") diff --git a/cmake/ospray_cmake_config/osprayConfig.cmake.in b/cmake/ospray_cmake_config/osprayConfig.cmake.in index 5f90d6f57..d6be1b313 100644 --- a/cmake/ospray_cmake_config/osprayConfig.cmake.in +++ b/cmake/ospray_cmake_config/osprayConfig.cmake.in @@ -196,6 +196,12 @@ set_target_properties(ospray::ospray PROPERTIES set_target_properties(ospray::ospray_module_cpu PROPERTIES INTERFACE_LINK_LIBRARIES "ospray::ospray;${OPENVKL_LIBRARY};${EMBREE_LIBRARY}") +# https://gitlab.kitware.com/cmake/cmake/-/issues/18837 +if (MSVC AND (MSVC_VERSION GREATER_EQUAL 1914)) + set_property(TARGET ospray::ospray APPEND PROPERTY + INTERFACE_COMPILE_OPTIONS "$<$:/Zc:__cplusplus>") +endif() + # Reset CMake module path to its state when this script was called. set(CMAKE_MODULE_PATH ${OSPRAY_CALLERS_CMAKE_MODULE_PATH}) From 347c90974e27271e9afdf09001ccf5f282ca712d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20G=C3=BCnther?= Date: Wed, 2 Jul 2025 15:02:40 +0200 Subject: [PATCH 7/8] Docu: Update GPU features --- doc/api.md | 6 ++---- modules/cpu/CMakeLists.txt | 2 +- scripts/superbuild/README.md | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/doc/api.md b/doc/api.md index 84edff378..c4e6f3259 100644 --- a/doc/api.md +++ b/doc/api.md @@ -3388,8 +3388,8 @@ The CPU module is implicitly loaded and the `cpu` device is automatically used if no other options are specified. -GPU (Beta) ---------- +GPU +---- To use the GPU for rendering load the `gpu` module and select the `gpu` device: @@ -3442,11 +3442,9 @@ correctly on the GPU device: - Multiple volumes in the scene - Clipping -- Motion blur - Subdivision surfaces - Progress reporting via `ospGetProgress` or canceling the frame via `ospCancel` - Picking via `ospPick` -- Adaptive accumulation via `OSP_FB_VARIANCE` and `varianceThreshold` - Framebuffer channels `OSP_FB_ID_*` (id buffers) - Experimental support for shared device-only data, works only for `structuredRegular` volume diff --git a/modules/cpu/CMakeLists.txt b/modules/cpu/CMakeLists.txt index 0fe4cb08b..579219719 100644 --- a/modules/cpu/CMakeLists.txt +++ b/modules/cpu/CMakeLists.txt @@ -6,7 +6,7 @@ mark_as_advanced(OSPRAY_MODULE_CPU) cmake_dependent_option( OSPRAY_MODULE_GPU - "Build the GPU module (beta)" + "Build the GPU module" OFF EMBREE_SYCL_SUPPORT OFF diff --git a/scripts/superbuild/README.md b/scripts/superbuild/README.md index 72dd97085..476dc2d31 100644 --- a/scripts/superbuild/README.md +++ b/scripts/superbuild/README.md @@ -53,7 +53,7 @@ BUILD_OSPRAY_MODULE_MPI distributed parallel rendering on multiple nodes. BUILD_GPU_SUPPORT -: enables beta GPU support, fetching the SYCL variants of the +: enables GPU support, fetching the SYCL variants of the dependencies and builds `OSPRAY_MODULE_GPU` BUILD_TBB_FROM_SOURCE From d5d60d47fb07973168194b83b694481797621213 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20G=C3=BCnther?= Date: Thu, 24 Jul 2025 15:13:50 +0200 Subject: [PATCH 8/8] Remove end caps of cone/cylinder curve small cleanup for spheres --- CHANGELOG.md | 2 ++ modules/cpu/geometry/Curves.cpp | 6 ++++++ modules/cpu/geometry/Curves.h | 1 + modules/cpu/geometry/SpheresShared.h | 3 +-- .../TestScenesGeometry_Curves.test_scenes_15.png.md5 | 2 +- .../TestScenesGeometry_Curves.test_scenes_16.png.md5 | 2 +- .../TestScenesGeometry_Curves.test_scenes_17.png.md5 | 2 +- 7 files changed, 13 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c3840e96..526c67f99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,8 @@ Version History - Find geometry lights after first empty instance - Segfault when `numPrimitives()` is called before `commit()` - Initialization of OpenGL on OSX + - `OSP_DISJOINT` curves had disks at the end of the first and last + cone/cylinder ### Changes in v3.2.0: diff --git a/modules/cpu/geometry/Curves.cpp b/modules/cpu/geometry/Curves.cpp index 5d391aed3..2a6f3dbd7 100644 --- a/modules/cpu/geometry/Curves.cpp +++ b/modules/cpu/geometry/Curves.cpp @@ -189,6 +189,12 @@ void Curves::createEmbreeGeometry() setEmbreeGeometryBuffer( embreeGeometry, RTC_BUFFER_TYPE_VERTEX_ATTRIBUTE, texcoordData, 1); } + capData.clear(); + if (curveType == OSP_DISJOINT) { + // disable caps to get always open cones/cylinders + capData.resize(numPrimitives(), RTC_CURVE_FLAG_NEIGHBOR_LEFT | RTC_CURVE_FLAG_NEIGHBOR_RIGHT); + setEmbreeGeometryBuffer(embreeGeometry, RTC_BUFFER_TYPE_FLAGS, capData); + } rtcCommitGeometry(embreeGeometry); } diff --git a/modules/cpu/geometry/Curves.h b/modules/cpu/geometry/Curves.h index f4c88a9a1..5d9749124 100644 --- a/modules/cpu/geometry/Curves.h +++ b/modules/cpu/geometry/Curves.h @@ -28,6 +28,7 @@ struct OSPRAY_SDK_INTERFACE Curves Ref> tangentData; Ref> colorData; Ref> texcoordData; + std::vector capData; RTCGeometryType embreeCurveType{(RTCGeometryType)-1}; diff --git a/modules/cpu/geometry/SpheresShared.h b/modules/cpu/geometry/SpheresShared.h index db8429a07..bd4249737 100644 --- a/modules/cpu/geometry/SpheresShared.h +++ b/modules/cpu/geometry/SpheresShared.h @@ -15,11 +15,10 @@ struct Spheres Data1D sphere; Data1D texcoord; Data1D normalData; - float global_radius; OSPSphereType sphereType; #ifdef __cplusplus - Spheres() : global_radius(.01f) + Spheres() { super.type = GEOMETRY_TYPE_SPHERES; } diff --git a/test_image_data/baseline/TestScenesGeometry_Curves.test_scenes_15.png.md5 b/test_image_data/baseline/TestScenesGeometry_Curves.test_scenes_15.png.md5 index 72fd351b5..89086bd34 100644 --- a/test_image_data/baseline/TestScenesGeometry_Curves.test_scenes_15.png.md5 +++ b/test_image_data/baseline/TestScenesGeometry_Curves.test_scenes_15.png.md5 @@ -1 +1 @@ -1fe1248c860675a236275d280f209d69 +d808e1c19a981c996076630d6d84987c diff --git a/test_image_data/baseline/TestScenesGeometry_Curves.test_scenes_16.png.md5 b/test_image_data/baseline/TestScenesGeometry_Curves.test_scenes_16.png.md5 index fd5dd4273..c50f46c4c 100644 --- a/test_image_data/baseline/TestScenesGeometry_Curves.test_scenes_16.png.md5 +++ b/test_image_data/baseline/TestScenesGeometry_Curves.test_scenes_16.png.md5 @@ -1 +1 @@ -e7023c32188855a556bf2b140a4790e8 +574c40e72117c607c8ce503f0ff9dd92 diff --git a/test_image_data/baseline/TestScenesGeometry_Curves.test_scenes_17.png.md5 b/test_image_data/baseline/TestScenesGeometry_Curves.test_scenes_17.png.md5 index 0e62fed66..97384bebd 100644 --- a/test_image_data/baseline/TestScenesGeometry_Curves.test_scenes_17.png.md5 +++ b/test_image_data/baseline/TestScenesGeometry_Curves.test_scenes_17.png.md5 @@ -1 +1 @@ -701ee56ee7ea7ec7210d44a35684e484 +48bb96453c5151afba3ccf877986704a