Compare commits

...
467 Commits
Author SHA1 Message Date
Krzysztof Raszkowski 80284e3579 ci: add external linux workflow 2024-07-24 11:26:31 +02:00
Johannes Günther 85af292993 Merge branch 'release-3.2.x' 2024-07-22 21:06:49 +02:00
Johannes Günther 101ec57e2a Sync README, fix links and spelling 2024-07-22 18:20:02 +02:00
Johannes Günther f70252b0b7 Bump dependencies
- Embree (better error reporting)
- rkcommon
- benchmark
2024-07-22 18:20:02 +02:00
Johannes Günther a27184a0fb Backplate to ignore pixelFilter, closes #590 2024-07-22 16:14:17 +02:00
Johannes Günther f8f52b5eb7 Docu: more details on face-varying attributes, closes #591
Also reformat Mesh parameters into a wide table
2024-07-22 16:14:17 +02:00
Johannes Günther 24423d6c71 Fix Windows release
- Disable stripping on Win (noop, but sometimes destroys sigs)
- Some files get rebuilt after CMake re-config, thus they are not identical
- Build Embree with Clang GNU-style options as well
2024-07-22 16:14:17 +02:00
Johannes Günther 64380b59f7 ospExample tweaks
- Change defaults to better highlight OSPRay capabilities
- Enable denoiser per default if GPU is available
- Add 'normal' as displayable AOV
2024-07-18 16:48:49 +02:00
Johannes Günther c75f0837d5 Fix warnings 2024-07-16 15:35:48 +02:00
Johannes Günther 52ddc68964 Ensure postprocessors run on every renderFrame
Even if rendering is done (targetFrames or varianceThreshold reached) PP
still needs to run on renderFrame to reflect changes
2024-07-15 19:10:46 +02:00
Johannes Günther ac6f16f899 Record aux info at last smooth vertex of a specular-only path 2024-07-15 19:10:46 +02:00
Johannes Günther f995831810 Denoiser quality level, HIGH is using cleanAux and prefiltering 2024-07-15 19:07:32 +02:00
Johannes Günther 89dbb1930d Docu: combine TMO params into single table, reformat FB table 2024-07-15 19:07:32 +02:00
Johannes Günther 94d5fe82a2 Fix missing version info in some MPI DLLs 2024-07-15 19:07:32 +02:00
Johannes Günther 5b05343902 Denoise alpha-channel 2024-07-15 19:07:32 +02:00
Johannes Günther aa3774ea66 Use OIDN ErrorFunction callback 2024-07-15 19:07:32 +02:00
Alexander Stukowski c08f6ba981 Object handles: support equality/inequality comparison 2024-07-15 17:09:32 +02:00
Miroslaw Pawlowski 1df508397e Add MIP map cache to handle MIP maps when data object is shared among many texture objects, use last MIP map instead of avg 2024-07-15 10:48:52 +02:00
Johannes Günther be552bf968 Initialize shadowCone for ShadowCatcher 2024-07-09 10:35:13 +02:00
Johannes Günther 536dca3f7d Build system improvements for ISPC
- fix race conditions if multiple targets compile the same .ispc source
- support OSPRAY_STRICT_BUILD (show warnings, but not as-error)
- reporting and generated header files with relative paths
2024-07-09 10:35:13 +02:00
Johannes Günther b25063c4b6 Bump dependencies
- Use FetchContent to get Dear ImGui and STB sources, requires CMake v3.14
- Downgrade to glfw v3.3.10 (GUI was missing on Windows with v3.4)
2024-07-09 10:34:37 +02:00
Johannes Günther 501f991080 Use sincos, fix warnings 2024-07-09 09:33:02 +02:00
Johannes Günther f71a2d73e0 Need to build VKL from source when installing in single directory 2024-07-09 09:33:02 +02:00
Johannes Günther a04c1a3351 CI updates
- sanitizer
  - with clang
  - add MPI and Denoiser modules
  - split into three jobs
  - remove sanitize_ignore.txt (not needed anymore)
- fix initialization
- use RenderKit Arch docker image
- test Ubuntu 24.04 (no longer 18.04)
- test Rocky8 (no longer CentOs7)
- no force-delete
- fix multiple scan jobs
- properly handle Windows exit codes in build and release jobs
2024-07-09 09:33:02 +02:00
Miroslaw Pawlowski 347e2a804f StructShared uninitialized _ptr fix 2024-07-04 19:04:45 +02:00
Johannes Günther d3dec43d5c Cleanup DistributedRaycast logging 2024-07-01 12:53:53 +02:00
Isha SharmaandJohannes Günther 069b4d0cb2 MIP mapping, with ray cones
- MIP bias
- trilinear filtering
- regard stereo mode and sub-image region
- calc footprint width in postIntersect
- precompute tc transform scale; invariant to axis
- ray cones for textured shadows
- unit tests

MIP generation
- with ISPC (even in module GPU)
- refactor getTexel and Texture2D
- set texel functions and optimizations
- handle 1D textures
- explicit average (instead of smalles level)

Co-authored-by: Johannes Günther <johannes.guenther@intel.com>
2024-07-01 12:53:53 +02:00
Johannes Günther f6f2deb604 Fix hasAlpha 2024-06-28 22:29:01 +02:00
Johannes Günther 4bb2ea57b0 Kill paths which scatter to the wrong side of the surface due to shading normals 2024-06-27 17:03:20 +02:00
Johannes Günther da5f5b492e Replace firstBounceLightSamples parameter by flag limitIndirectLightSample 2024-06-19 16:50:02 +02:00
Johannes Günther 9b4f1703e0 Fix "targetFrames" with MPI
- remove FB::doAccumulation
- handle FrameID on host
- fix "accumulation" of the first sample
2024-06-19 16:50:02 +02:00
Johannes Günther be954607fb Fix GeometryLights 2024-06-19 16:50:02 +02:00
Johannes Günther 98922bb22b Improve Russian roulette 2024-06-19 16:50:02 +02:00
Johannes Günther e7fc1d09bb Fix MIS with different #NEE samples, and when evaluating virtual lights 2024-06-19 16:50:02 +02:00
Johannes Günther 6c01601125 Sampling improvements
- changed low-discrepancy sampler from Sobol with Cranley-Patterson
  rotation to shuffled and fast Owen-scrambled Sobol (Burley 2020)
- optimized implementation (support maximum of 64k samples)
- keep plain implementation for debugging
- enable screen-space blue noise via parameter `targetFrames` at the
  framebuffer (because the total number of samplers needs to be known in
  advance)
- splitting for NEE with >1 light samples
2024-06-19 16:50:02 +02:00
Sebastian Herholz 932775bd2f Adding support to use different numbers of NEE samples for the primary and all subsequent diffuse-glossy intersections 2024-06-19 16:50:02 +02:00
Miroslaw Pawlowski 57a2deea05 Replaced ISPCRT with a new DeviceRT layer for device memory allocations and kernel launching 2024-06-19 12:27:17 +02:00
Johannes Günther 0d9196bab6 Fix Mesh epsilons and self-shadowing of GeometryLights 2024-05-23 18:41:09 +02:00
Johannes Günther 1593e9094b PING for kernels 2024-05-23 18:41:09 +02:00
Johannes Günther 218c20c3ae Cleanup math constants
- move Halton and Sobol constants to global arrays (static for SYCL)
- remove pre-computed zorder
2024-05-23 18:41:09 +02:00
Johannes Günther 6ad92f0dee Bump dependencies 2024-05-23 18:41:09 +02:00
Johannes Günther 04a3802636 Fix name 2024-05-17 16:17:04 +02:00
Moushumi Maria e12ce01a37 CI test for MPI tutorials 2024-05-15 11:42:08 +02:00
Moushumi Maria 2da9e15570 Refactor emissive materials 2024-05-15 11:11:57 +02:00
Johannes Günther 9ff9446dd8 CI: bump to icx 2024.1; Win: driver 101.5445, disable tests with artifacts 2024-05-10 12:37:53 +02:00
Johannes Günther 26de7347fa Fix cut-out transparency in Principled material 2024-04-25 16:53:46 +02:00
Johannes Günther 54f060e660 Add support for fp16 textures 2024-04-17 11:16:24 +02:00
Johannes Günther 30e2aec785 Docu: add missing datatype enums, clarify sizeOf(OSP_BOOL)=1 2024-04-16 18:25:11 +02:00
Johannes Günther c67b8cab8b CI: handle workflow changes 2024-04-16 18:25:11 +02:00
Johannes Günther 94e37acbae Correctly calculate pixel_center 2024-04-16 18:25:11 +02:00
Miroslaw Pawlowski 3692dd553e Enable texturing tests on GPU 2024-04-12 19:51:31 +02:00
Miroslaw Pawlowski 45a2db8ab2 Kernel size reduction by PT debugging removal, converted varying IF to uniform in Principled material 2024-04-12 19:51:19 +02:00
Miroslaw Pawlowski 41b72afa62 Kernel size reduction by Textures improved inlining 2024-04-11 14:15:26 +02:00
Miroslaw Pawlowski bc1757b895 Kernel size reduction by Materierial/BSDF improved inlining 2024-04-11 14:13:56 +02:00
Moushumi Maria 34a2557bde Fix camera sample
Use pixel center to decide between eyes for stereo images.
2024-04-02 17:34:51 +02:00
Moushumi Maria 42d07e5e84 Enable sycl print 2024-03-15 11:42:40 +01:00
Moushumi Maria dc9354631d Add ref texture in material param 2024-03-08 08:46:22 +01:00
Moushumi Maria ffba3a9e24 Add support for downloading VKL binary in superbuild 2024-03-01 11:16:13 +01:00
Johannes Günther 609308b23d Fix name 2024-02-29 16:54:45 +01:00
Johannes Günther c9d546e8e0 Test Bezier Curve as well 2024-02-29 13:43:48 +01:00
Moushumi Maria 013160d171 Refactor curve interpolate function to eliminate duplicate code
Use specialization constants
2024-02-29 13:43:31 +01:00
Johannes Günther faeea0b71a Bump version, add OSX ARM download link 2024-02-23 12:50:07 +01:00
Johannes Günther f2a61c2eb5 Merge branch 'release-3.1.x' 2024-02-22 16:54:23 +01:00
Johannes Günther ecff444288 Sync README, sort changelog
- fix Embree version check for HASHes in suyperbuild
- fix "scheduled" CI workflow
2024-02-22 15:59:38 +01:00
Johannes Günther 282d90774a Improvements to variance-based adaptive accumulation
- use average (scaled) error to match behavior in v3.0
- activate test on GPU
2024-02-22 15:57:31 +01:00
Johannes Günther 2ada835073 Several fixes
- calc variance only if also a colorBuffer is present
- workaround to redistribute MSVCRT with GNU-style DPCPP
- more robust handling of Win stack-size flags via
  CMAKE_CXX_COMPILER_FRONTEND_VARIANT
- smaller flagged issues
2024-02-20 11:33:10 +01:00
Johannes Günther 2258668f3f Use released rkcommon v1.13.0, Embree v4.3.1, VKL v2.0.1, OIDN v2.2.0, and ISPC v1.23.0
- workaround for ISPCRT device creation with app context
- no additional indirection for zeContext / zeDevice passed as void*
  parameters (those are already handles)
- superbuild supports building on Linux aarch64
- consistent namespace for MPI MessageHandler
2024-02-19 17:42:39 +01:00
Johannes Günther 604a122646 WA for OSX AVX512 2024-02-16 16:17:33 +01:00
Johannes Günther acd097b268 Bump Dear ImGui to v1.90.3 2024-02-16 16:17:33 +01:00
Johannes Günther f7d32333a4 CI maintenance and improvements
- Store release packages
- Benchmark on GPU as well
- Better test image retrieval
- Use timeout
2024-02-16 16:17:24 +01:00
Johannes Günther bdf9ab45dc OSX release packages for ARM64, closes #559
- OSX uses new sign workflow with CPACK_PRE_BUILD_SIGNING_SCRIPT
- Cleanup pkg
- Remove entitlements
2024-02-16 10:02:23 +01:00
Moushumi Maria d2e1df0d9c Add support for texture co-ordinate wrap modes, closes #270
new wrap modes:
- mirror repeat
- clamp to edge
2024-02-16 09:11:21 +01:00
Johannes Günther fb0edb8372 Bump ISPC to v1.22.0 2024-02-02 14:20:01 +01:00
Johannes Günther c949a20299 Release CI updates
- merge GPU module into single release package
- Windows MSI installer offers GPU as separate component
- parallel testing
- go with DPCPP 2023-10-26
2024-02-02 14:20:01 +01:00
Miroslaw Pawlowski b7262948b7 New variance calculation in a FrameOp 2024-01-30 13:59:11 +01:00
Miroslaw Pawlowski 63aa19247a Randomized variance accumulation 2024-01-30 13:59:11 +01:00
Miroslaw Pawlowski b069d58221 Decoupled RenderTask from SYCL work item 2024-01-30 13:59:11 +01:00
Johannes Günther c590d5c94b Fix PixelFilter, closes #577
- Parameter was ignored (always using the default Gaussian)
- Avoid a shift/misalignment within the pixel for first sample
- Avoid flickering when not accumulating frames
2024-01-29 16:35:48 +01:00
Johannes Günther 60e00b3165 Bump GLM to v1.0.0 2024-01-29 16:35:48 +01:00
Johannes Günther d498dcfde9 CI updates
- Bump DPCPP compiler and Windows driver
- Speedup image download
- Split GPU tests for parallel execution
- Remove nightly compilers
- Windows GPU: icx release with MPI; use 'main' workflow
- Remove CentOS7 IMPI test
2024-01-29 16:35:48 +01:00
Johannes Günther ce4e1016fc Add dependent load flag to executables and shared libs 2024-01-29 16:35:48 +01:00
Johannes Günther 33b87d3cfd Update options for Large GRF 2024-01-29 16:35:48 +01:00
Johannes Günther 33d249da38 Fix race condition in PT 2024-01-29 16:35:48 +01:00
Johannes Günther 456855b558 Fix Principled with coatIor=1.0
- Even with coatIor=1.0 the attenuation of coatColor is relevant
- Was crashing, because not even a PassthroughLayer was constructed
2024-01-29 12:25:23 +01:00
Moushumi Maria a9030e6406 Interpolation for Curves 2024-01-25 11:05:00 +01:00
Moushumi Maria ff3497412f Rework Data iterator 2024-01-24 19:16:20 -08:00
Johannes Günther 652262e3b7 Fixes for GPU Motion Blur
- Fix FeatureFlag for GeometryLights
- Put addresses of motion vertex data into USM
- Define, use and pass FeatureFlags for Motion Blur
2024-01-19 12:01:24 +01:00
Moushumi Maria c61da0ee70 Motion blur support for GPU
setEmbreeGeom: add RTCScene and geomID as parameters
Create dummy scene in Camera
Remove MotionTransform.ih
Support both uniform and varying time
Enable MB for Camera and Lights on SYCL
2024-01-16 15:35:20 +01:00
Johannes Günther 55c6f7f5c5 Bump GLFW to v3.3.9, Dear ImGui to v1.90.1 2024-01-16 09:45:33 +01:00
Johannes Günther 508e9c1921 CI improvements
- properly handle Windows exit codes
- permissions
- bump GPU driver and compiler
2024-01-16 09:45:33 +01:00
Johannes Günther 5402ed1c3e Define FFG_ enums in terms of RTC_FEATURE_FLAG_ 2024-01-15 15:11:42 +01:00
Johannes Günther be232a7a6f Cosmetics: transparently support foreach_unique in SYCL 2024-01-15 15:11:41 +01:00
Johannes Günther b1047c5e5b Bump VKL 2024-01-08 15:09:52 +01:00
Johannes Günther 9c3aa5e21b Emissive texture lookup when sampling GeometryLight; docu
Add texcoords to sampleAreaRes
Some WAs for MixMaterial
2023-12-20 15:47:59 +01:00
Johannes Günther a5b91e23dc Fix PRINT debug macros 2023-12-19 15:05:18 +01:00
Miroslaw Pawlowski 16b8b4b38d Tests updated to validate emissive textures 2023-12-19 14:07:21 +01:00
Bruce Cherniak 96e96d3943 Added emissiveColor to both Principled and Luminous
emissiveColor can be a constant and/or a texture and is used to provide
emissivity to principled material and emissive texture support to luminous
materials.
2023-12-19 14:07:21 +01:00
Miroslaw Pawlowski 573a76dda1 Unified variance calculation between LocalFB and SparseFB, fixing FrameID passing 2023-12-19 13:53:08 +01:00
Miroslaw Pawlowski f9d83a54f9 Separated rendering from post-processing, PP kernels can be chained now, accumulation buffer is color buffer now 2023-12-19 13:53:08 +01:00
Miroslaw Pawlowski 0563af0164 Removed PixelOp and SSAO FrameOp, ToneMapper converted to FrameOp, new way of calling PP kernels 2023-12-19 13:53:08 +01:00
Miroslaw Pawlowski 96dfc47cfb Adaptive sampling algorithm fix for LD seq (Halton, Sobol) 2023-12-19 13:53:08 +01:00
Miroslaw Pawlowski 40d0e456e9 Silenced compilation warnings when OSPRAY_ENABLE_VOLUMES is not defined 2023-12-19 13:53:08 +01:00
Moushumi Maria 2b8da0ff37 Add support for disc point and oriented disc point 2023-12-19 11:48:32 +01:00
Johannes Günther 945a44ebc9 Fix compilation on Windows when OSPRAY_ENABLE_VOLUMES=OFF 2023-11-29 15:34:44 +01:00
Johannes Günther 5aa45eda81 WA for PVC crash 2023-11-29 15:28:14 +01:00
Johannes Günther 7af9225b7d WA sanitizer crash 2023-11-29 15:28:14 +01:00
Johannes Günther b29ae3efd1 Bump Dear ImGui, merge together with glfw into one dll 2023-11-29 15:27:28 +01:00
Johannes Günther bb1a7a941a Bump TBB 2023-11-29 15:27:28 +01:00
Johannes Günther f04f651121 Update TPP of ISPC 2023-11-29 15:27:28 +01:00
Johannes Günther a4e0dffe68 WA for Debug CI job 2023-11-29 15:27:28 +01:00
Johannes Günther 28b38132a0 Fix crash using GPU and emissive geometry, bump rkcommon 2023-11-20 13:47:33 +01:00
Johannes Günther 8d31a2fd9a Allow individual OSPRAY_BUILD_ISA when OSPRAY_ENABLE_VOLUMES=OFF, closes #576 2023-11-20 13:29:13 +01:00
Johannes Günther b7875eb247 Fix missing SDK headers, closes #574 2023-11-20 13:29:13 +01:00
Johannes Günther 29ef593a8a Fix NaN in aperture when focusDistance=0, closes #573 2023-11-20 13:29:13 +01:00
Johannes Günther db0f753023 Clamp selection prob of ThisGlass to 1/4 to reduce noise of reflections 2023-11-20 13:29:13 +01:00
Johannes Günther e60ea3d882 Fix indirectly seen auxBuffers 2023-11-20 13:29:13 +01:00
Johannes Günther 6c5147ff42 Dependency redistribution: support Debug builds, cleanup 2023-11-20 13:29:13 +01:00
Johannes Günther c0a748980b superbuild: support OIDN branches 2023-11-15 16:23:35 +01:00
Johannes Günther 8b168219e7 Docu: fix driver links 2023-11-15 16:23:35 +01:00
Miroslaw Pawlowski 8671ed3ec6 Fix artifacts when using a specular map in Principled and coat map in CarPaint 2023-11-15 14:39:34 +01:00
Moushumi Maria 31feb8d422 Remove old user geometry spheres 2023-11-13 23:29:26 -08:00
Johannes Günther 29aa66672e Bump version, scan artifact names, teaser 2023-10-20 14:35:48 +02:00
Johannes Günther 66fa810848 Merge branch 'release-3.0.x' 2023-10-18 14:27:23 +02:00
Johannes Günther b54e4f4c2c Update documentation 2023-10-18 13:56:59 +02:00
Guenther b1ddfb9b02 Fix redistribution and another exception in dtor 2023-10-18 12:37:38 +02:00
Johannes Günther d51e3c22b9 TPP updates 2023-10-17 19:57:03 +02:00
Johannes Günther 935eecd94b Fixes (initializers, handle exceptions in dtors) 2023-10-17 17:52:41 +02:00
Johannes Günther 6af29ba63b Fix linking issues for MPI module
- Ensure DeviceFactory is in ospray core (befor it was also present in
  CPU module, and MPI module chose the wrong symbol)
- Do not ISCP export vec2f
- More robust "-x c++" WA
2023-10-17 17:52:41 +02:00
Johannes Günther eee353009c RPATH for rkcommon and VKL (and OIDN when built from source) 2023-10-17 17:52:41 +02:00
Johannes Günther 3541fff36f CI GPU: Windows add icx-nightly and MPI builds
- hamonize mpi test, use >1 worker
- tests use SYCL_CACHE_PERSISTENT
- tests: adjust artifact-path and no dpcpp compiler needed
2023-10-17 17:52:41 +02:00
Johannes Günther 1fb679d403 Bump ISPC(RT), use oneAPI version and binaries 2023-10-17 17:52:41 +02:00
Johannes Günther 5b5ac96f9b Rework redistribution
- add sycl
- add tbbbind
- namelink handling
- namelink only for main ospray lib
2023-10-17 17:52:41 +02:00
Johannes Günther 3380600552 SYCL release packages
- properly exit Windows jobs
- Windows release Ninja support, incl WA
- fix Windows zip sign test
- GPU beta
- Re-add /STACK increase on Windows
2023-10-17 15:19:24 +02:00
Johannes Günther 989bbdd125 Bump OIDN and enable by default
Add entitlement 'allow-jit' for denoiser
2023-10-17 08:33:24 +02:00
Johannes Günther dc81332922 Bump VKL, benchmark and gtest 2023-10-17 08:33:12 +02:00
Miroslaw Pawlowski 1861af7178 Fixed unnecessary object copies, dynamic cast checks and other 2023-10-16 16:22:50 +02:00
Miroslaw Pawlowski 84aa9035dc Missing initializers 2023-10-16 14:36:46 +02:00
Miroslaw Pawlowski a4271d7233 Fix for potential crash when mapping non-existing FB channel 2023-10-13 17:17:26 +02:00
Johannes Günther e0b6b28718 Reorder and update GPU test filters 2023-10-09 17:46:04 +02:00
Johannes Günther 363ad7889d Patch ispcrt to find DPCPP with new icx 2023-10-09 17:46:04 +02:00
Johannes Günther 074f5d0e07 Rework SYCL flags 2023-10-09 17:46:04 +02:00
Johannes Günther f761988f1d No /STACK increase on Win anymore 2023-10-09 17:46:04 +02:00
Johannes Günther 4bf4634180 Minimum CMake version to use SYCL 2023-10-09 17:46:03 +02:00
Johannes Günther b9e8115478 Fix SYCL compilation of MPIDistributed 2023-10-09 17:46:03 +02:00
Johannes Günther b5628f83ba icx needs to BUILD_EMBREE_FROM_SOURCE for successful linking 2023-10-09 17:46:03 +02:00
df09e6a1e8 Add Windows GPU CI, Params for build/win.ps1
Fix linking with SYCL for ospTestSuite
no "-x c++" for Win
Fix benchmark

Co-authored-by: Johannes Günther <johannes.guenther@intel.com>
Co-authored-by: Trevor Thomson <trevor.thomson@intel.com>
2023-10-09 17:46:03 +02:00
Johannes Günther 435ebea437 Rework Linux GPU CI: testing icx and dpcpp, release and nightly 2023-10-06 12:18:42 +02:00
David E. DeMarleandJohannes Günther 21ff84ae8d Experimental support for device data
DEVICE DATA

For device data we now detect the case where the application shares that
with us and, by default, handle it by copying into an internal shared
buffer, just like we do for host data. The copy, as implemented,
requires a corresponding change in ispcrt that is expected in the next
release. In the interim the superbuild applies the needed commit as
patch.

The new OSPRAY_ALLOW_DEVICE_MEMORY environment flag turns on an
experimental mode where OSPRay instead leaves the buffer alone and
attempts to use the device data in place. The mode is experimental
because in most cases the app will simply crash as most code in OSPRay,
VKL and Embree do not yet support device data. Applications that know
exactly what they are doing ie using it only for VKL structured volumes
with the upcoming VKL release, or RGB surface colors, can use it to
avoid a copy.

TESTING

1) The --own-SYCL argument to ospTestSuite causes the test app to
   emulate in situ use cases where the sycl enabled application owns the
   context and shares it with ospray.

2) The new test_sharedusm_data test (only available when compiled with
   SYCL) creates a simple volumetric data set and validates that usm
   host, shared, or device data sharing work as expected.

Co-authored-by: Johannes Günther <johannes.guenther@intel.com>
2023-09-29 10:34:38 +02:00
David E. DeMarleandJohannes Günther 574d3f4ea7 Add assigned data
ASSIGNED DATA

It is common for applications to need to massage data in a temporary
buffer before handing off to OSPRay. This change provides a way for
applications to transfer ownership of the buffer to try to avoid one
copy/delete cycle.

The additional arguments point to a custom deleter function (with
optional state if necessary) that OSPRay needs to call then it is done
with the buffer.

The C++ wrappers provide a cpp:MovedData(std::vector<>&) for the common
case.

TESTING

The new test_assigned_data test exercises the assigned data feature and
also demonstrate deleter functions as malloc and new counterparts. They
count and inspect the timeline of deletion calls to more fully validate
that the applications memory is in fact deleted by OSPRay through the
callback function.

Co-authored-by: Johannes Günther <johannes.guenther@intel.com>
2023-09-29 10:34:36 +02:00
Johannes Günther c4355ba6ea Bump Embree 2023-09-29 10:27:58 +02:00
Johannes Günther e66833fa4f Bump rkcommon 2023-09-28 11:42:34 +02:00
Johannes Günther 3ece3320bb Debug info for host code 2023-09-27 18:50:46 +02:00
Johannes Günther 3d254f8667 Fix implicit-const-int-float-conversion 2023-09-27 18:50:46 +02:00
Johannes Günther c69a70387d HDRILight with higher-res texture for consistency with GPU 2023-09-27 18:48:27 +02:00
Johannes Günther 753ef7aa1c Update VKL GPU device name 2023-09-27 18:48:27 +02:00
David E. DeMarle c2371d82c9 add linear2f helper for texture transform's deprecated vec removal 2023-09-27 12:01:35 -04:00
Johannes Günther 0e50b38c1d Remove obsolete first param of ospNewMaterial
Update images due to changed materials (AO and MPIDistrib renderers)
2023-09-26 21:06:50 +02:00
Johannes Günther 8482e03447 Switch to devel for VKL 2023-09-26 21:06:50 +02:00
Johannes Günther 492db27471 Optional VKL in superbuild via BUILD_OPENVKL 2023-09-26 21:06:50 +02:00
Johannes Günther 961b066000 Bump Snappy 2023-09-26 21:06:50 +02:00
Johannes Günther 8b528d65af "voxelType" is deprecated and deduced by VKL 2023-09-26 21:06:50 +02:00
Johannes Günther 2077df315e Numerical robustness with acos and Distribution2D, fixes HDRILight 2023-09-26 17:40:48 +02:00
Miroslaw Pawlowski b8bd0ecaca Adapt to changed rkcommon library interface 2023-09-25 19:34:40 +02:00
Miroslaw Pawlowski 07137676d8 No explicit denorms to zero (FTZ & DAZ) on main thread, rely on ISPC 2023-09-25 16:54:02 +02:00
David E. DeMarle c1209fc272 Add setParam utils for uint32 (most enums) and box1f/range1f 2023-09-21 14:41:46 +02:00
Johannes Günther 1280b39ed0 Rename TEXTURE_FILTER enum 2023-09-19 17:27:20 +02:00
Johannes Günther 1f263d6d2f VKL: structuredSpherical's default gridSpacing to cover the full sphere 2023-09-19 17:27:20 +02:00
Johannes Günther 043a5b4014 Streamline enum storage type (most to uint32) 2023-09-19 17:27:20 +02:00
Johannes Günther e7fa3be4bc Rename VOLUME_FILTER enums 2023-09-18 15:45:43 +02:00
Johannes Günther 11019acc6d Require VKL 2.0 2023-09-18 15:45:43 +02:00
Johannes Günther 7836622738 Bump TBB 2023-09-18 15:45:43 +02:00
Will Usher 18039c7b51 Use ISPCRT's ispcrtSetTaskingCallbacks to set OSPRay task callbacks 2023-09-07 15:19:30 +02:00
Johannes Günther 0ef253f46b Require map for HDRILight, make getParamObject template fct 2023-09-07 11:44:08 +02:00
Johannes Günther 9c8466807e Remove deprecated parameters and API calls 2023-09-07 11:44:08 +02:00
Johannes Günther ff2f6f6786 CI fixes
for GPU set BUILD_EMBREE_FROM_SOURCE=ON
use VKL from public GitHub
Revert temporary "CI: Driver download fix"
2023-09-07 11:44:08 +02:00
Johannes Günther 8efb1aa9e3 Bump Embree and ISPC 2023-09-07 11:44:08 +02:00
Brownlee, Carson fbbd14a9d5 fixing hdri light crash 2023-09-04 11:34:06 +02:00
Miroslaw Pawlowski 3b1e98a05d Simplified scivis and ao volume raymarching on GPU, fixes in feature flags passing 2023-08-25 17:50:58 +02:00
Miroslaw Pawlowski 00464b26d7 Pricipled material glowing fix 2023-08-23 10:27:03 +02:00
Miroslaw Pawlowski 148ebdf6cc CI: Driver download fix 2023-08-22 12:43:32 +02:00
Will Usher abd9269b9b Optimizations to MPI module and profiling
- Clean up redundant retain/release commands sent to workers
  Workers only care when app refcount goes to 0. Track other refcount
  events on the app node and only send the 1->0 case to workers

- Move task ids to device shadowed, cleanup some serial task filtering

- Cleaning up some data transfer costs and operations in LocalFB/SparseFB

- Handle case of sparseFb being empty
2023-08-08 09:33:31 -06:00
Will Usher 56bcac49cd Integrate performance tracing into MPI module 2023-08-08 09:33:31 -06:00
Moushumi Maria a970728e13 Skip computing of gradient shading for scivis volume samples that have 0 opacity 2023-08-04 18:15:04 -07:00
Johannes Günther 9b1d2cb556 Enable DebugOp for Windows MPI, harmonize test scripts 2023-08-04 09:17:20 -06:00
Miroslaw Pawlowski 3be5b5d0ff BSDF unroll with function pointers removal, new material tests 2023-08-01 14:14:04 +02:00
Will Usher b919f3c7cf Disable cancelling frames on the GPU 2023-07-27 11:11:57 -06:00
Will Usher 2bdff09928 Fix execution of frameops when using MPI + GPU 2023-07-18 09:38:30 +02:00
Johannes Günther f5a51ed533 Create key function for dynamic_cast to work across dynamic modules 2023-07-17 16:38:07 +02:00
Johannes Günther 0a3a05b316 Update DenoiserOp test
- Use PF4 to include alpha for RGBA32f
- Verbose OIDN for CI
- Enforce denoising on CPU for CPU test
2023-07-17 16:38:07 +02:00
Johannes Günther 015b1dd79f Denoise in-place (reuse buffer) to preserve alpha channel 2023-07-17 16:38:07 +02:00
Johannes Günther 5600cea43c Always initialize OIDN buffers 2023-07-17 16:38:07 +02:00
Johannes Günther 5b5c502f49 Fix missing tags 2023-07-17 16:38:07 +02:00
Johannes Günther 9078482c57 CI: test msvc17, cleanup runs-on 2023-07-14 17:17:07 +02:00
Johannes Günther c5bf246f25 Change link order (and thus Builder registration with singleton)
Fixes Win Debug build
2023-07-14 13:59:14 +02:00
Will Usher e9ef40a7af Resolve issues with new sparsefb device mem and data-parallel rendering 2023-07-12 11:13:54 +02:00
Will Usher eb9e981f9d Refactor accum id and task ids to reduce USM/data transfers 2023-07-12 11:13:54 +02:00
Will Usher 3c6ac358cc Separately compute tile region to skip usm readback for region data
region for a tile never changes, just recompute it and skip USM
transfer. This removes USM CPU<->GPU for tile data in multidevice, copy
to final localfb is device to device
2023-07-12 11:13:54 +02:00
Will Usher 88cc0732a8 try out dirty tracking for controlling tile readback 2023-07-12 11:13:54 +02:00
Will Usher 8e8ce5cf37 Updates to work with multidevice 2023-07-12 11:13:54 +02:00
Will Usher 1db3a4cbcb Add getTilesDevice for doing device->device copy in writeTiles 2023-07-12 11:13:54 +02:00
Will Usher 3c8902a8b6 Refactor sparsefb to store tiles in device memory 2023-07-12 11:13:54 +02:00
Tark Patel 2fc5e250a2 Add implicit mesh indexing for ANARI requirements
Update doc and changelog
2023-07-10 14:38:30 +02:00
Trevor Thomson fef4fb5e30 Switch to Coverity for static code analysis 2023-07-06 12:38:10 +02:00
Johannes Günther bcf55cb73f Compute intersection epsilon for Mesh 2023-06-29 13:08:09 +02:00
Johannes Günther 2bd3b659cd Remove internal docu submodule, closes #564 2023-06-28 17:22:10 +02:00
Johannes Günther 27a25a1147 CI: Enable MPI with GPU tests; run all tests even on failure (no early out) 2023-06-22 17:08:02 +02:00
Johannes Günther 0e655fe466 Verbose OIDN only in debugMode 2023-06-22 14:00:37 +02:00
Johannes Günther d45ef1f7e8 Refactor LiveDenoiseFrame, use *Async, more tests 2023-06-20 19:33:36 +02:00
Johannes Günther c2fdacb00c Bump version 2023-06-19 14:41:36 +02:00
Johannes Günther 08111292f4 Merge branch 'release-2.12.x' 2023-06-17 17:16:25 +02:00
Johannes Günther aa6534c5e8 Sync README and CHANGELOG, remove Gitter 2023-06-17 17:09:13 +02:00
Johannes Günther 73cf4204f1 Try OIDN for x64 on ARM cross-compile 2023-06-17 12:23:21 +02:00
Johannes Günther a356451a9c Update TBB and TPPs 2023-06-17 12:23:21 +02:00
Johannes Günther 51719801a4 Move to Rocky Linux for release binaries 2023-06-17 12:23:21 +02:00
Johannes Günther b2517884cb When rendering on CPU, let OIDN select the best device (GPU if available)
copy buffers if necessary from host to device
fix settings: default affinity (on) and HDR mode
2023-06-16 21:45:31 +02:00
Johannes Günther e97e0278ce Fix CI 2023-06-16 12:46:23 +02:00
Will Usher 21234717b3 Report ospRenderFrame time, and app framerate, exclude GL overhead 2023-06-16 12:46:23 +02:00
Will Usher 3656baab16 Update CI env 2023-06-16 12:46:23 +02:00
Will Usher 2f013f8921 ispc updated release 2023-06-16 12:46:23 +02:00
Will Usher 9e9a20249f Use OpenVKL Specialization Constants
- Add VKL spec. consts to AO, SciVis, PathTracer

- Change to pass FeatureFlagsHandler through to avoid indir call issues

- Move to u64 vkl feature flags

- Always pass FeatureFlagsHandler to OSPRay internal functions

- Update MPI module to spec. const and GPU localfb

- need openvkl gpu-devel in ci for all builds

- Unify getFeatureFlags across code, always return full FeatureFlags

- mark inline, embree 4.1.0 resolved calla issue

- Use ff.geometry to remove unused geometry code for volume-only scenes

- Update exported symbols

- Add flag to remove volume codepaths for isosurface-only scenes

- Also add debug renderer type specialization constant to improve JIT time

- Enable more tests, sphere precision does match avx512
2023-06-16 12:40:25 +02:00
Roba Binyahib 9def6a9e96 Refactor LocalFB writeTiles to use sycl event for GPU 2023-06-06 13:21:25 -07:00
Johannes Günther 1e76cb84b8 Bump version 2023-06-02 19:59:53 +02:00
Miroslaw Pawlowski 0d8337ef27 New versions of Embree, ISPC & ISPCRT, closes #558 2023-06-02 19:59:53 +02:00
Miroslaw Pawlowski 0102937937 OIDN2 support, frame buffer postprocessing in separate kernel on GPU 2023-06-02 19:59:53 +02:00
Miroslaw Pawlowski 8664fd62b1 HDR images comparison/write fixes in ospTestSuite 2023-06-02 19:59:53 +02:00
Miroslaw Pawlowski 4400168f63 Wait on SYCL RenderTask destruction 2023-05-25 16:52:30 -07:00
Moushumi Maria 14ae46b13f Fix unused parameter errors 2023-05-22 16:50:10 +02:00
Moushumi Maria 9a805990c0 Add MPI ON to build-arch-clang-extras build job 2023-05-22 16:47:14 +02:00
Will Usher 8668f18270 Base default maxTilesPerRound on the # of tiles assigned to the rank
We default to 0.33 (1/3) of tiles per-round and allow users to configure this
with the OSPRAY_MPI_LB_TILES_PER_ROUND variable which takes
values in [0-1]

The percentage of tiles active for work stealing to occur can also be
tuned with OSPRAY_MPI_LIB_MIN_ACTIVE_TILES
2023-05-16 08:50:18 -06:00
Will Usher 13527b957f Fix frame ID reset when clearing DFB 2023-04-28 10:53:08 +02:00
Will Usher 432e8c7bbf Make syclQueue with profiling enabled 2023-04-21 15:56:07 +02:00
Miroslaw Pawlowski d95b5833f5 Async GPU rendering using sycl::event 2023-04-18 10:50:57 -07:00
Miroslaw Pawlowski 4106d54864 Optimized host-device traffic in the local frame buffer 2023-04-18 10:50:57 -07:00
Krzysztof Raszkowski 3431d6131a ci: add PVC GPU tests 2023-04-14 13:42:00 +02:00
Will Usher ea97897e54 Refactor struct shared/BufferShared to alloc on the context
This is needed to enable memory pooling in ISPCRT
2023-04-14 11:11:00 +02:00
Johannes Günther 039a486510 Ensure proper exit for GPU CI 2023-04-12 12:00:24 +02:00
Johannes Günther 7a924c8172 CI: use common env for driver version 2023-04-12 12:00:24 +02:00
Johannes Günther bb3e0d9cdf Fix title of ospExamples 2023-04-12 10:05:00 +02:00
Johannes Günther 58e0dec8f0 Parameter to limit diffuse/glossy bounces 2023-04-05 13:59:03 +02:00
Johannes Günther 2a4b20a801 Fix transparent shadow 2023-04-05 13:59:03 +02:00
Johannes Günther 811e261853 Roulette to use random sampler 2023-04-05 13:59:03 +02:00
Miroslaw Pawlowski 1481fc4eba Cleanup compiler warnings and unused code removal 2023-03-29 15:00:04 +02:00
Johannes Günther e75140e73b Fix interpolation for cylinder cap SA 2023-03-29 15:00:04 +02:00
Miroslaw Pawlowski 69a19c9680 Fixed issues found by Klocwork 2023-03-28 09:26:25 -07:00
Will Usher c19c5cef38 Handle empty tileIDs in SparseFrameBuffer::setTiles 2023-03-27 10:00:09 +02:00
David E. DeMarle b767a65965 guard against empty tiles as can happen with many mpi ranks 2023-03-27 10:00:09 +02:00
Miroslaw Pawlowski ad263f41d1 CI: MPI on GPU job disabled 2023-03-24 15:48:16 +01:00
Miroslaw Pawlowski 994576a3a0 Get back to ci-comp_igc-19476 driver, removed some volume testing on GPU 2023-03-24 15:48:16 +01:00
Miroslaw Pawlowski 1c4ce88bcd Recursion removal from SciVis volume raymarching 2023-03-24 15:48:16 +01:00
Miroslaw Pawlowski d551358d4e Kernel size optimization with specialization constants 2023-03-24 15:48:16 +01:00
Johannes Günther 2aa442a495 Fix crash in PT when no lights but lightSamples > 0 2023-03-13 10:46:07 +01:00
Johannes Günther f0a726f95d Bump version 2023-03-10 14:38:25 +01:00
Johannes Günther 7f9bc6d789 Fix broken links 2023-03-08 20:14:45 +01:00
Johannes Günther cdb39c88a2 Merge branch 'release-2.11.x' 2023-03-08 16:30:45 +01:00
Johannes Günther 97f993faf0 Fix Windows release 2023-03-08 14:28:00 +01:00
Johannes Günther 81f9f361ef Sync docu 2023-03-07 18:26:37 +01:00
Johannes Günther 5044b49ec5 Run denoiser only when new pixels rendered 2023-03-05 19:16:32 +01:00
Johannes Günther 3732fb5c05 Test and fix adaptive accumulation with varianceThreshold 2023-03-05 18:44:32 +01:00
Johannes Günther 7c910f0a1a Fix KW issues 2023-03-05 18:43:58 +01:00
Johannes Günther e2ed292835 CI: fix OSX 2023-03-05 18:43:58 +01:00
Johannes Günther fcf9116535 CI: enable AVX512 test on Win 2023-03-05 18:43:58 +01:00
Johannes Günther 2f06d6631d Linux release fixes
load mpich last to avoid using IMPI
consistent CFLAGS
check MPI modules
2023-03-03 22:00:03 +01:00
Johannes Günther 242ff8f496 Update dependencies and TPPs 2023-03-03 22:00:03 +01:00
Will Usher ee7bf906b7 ispcrt include issue is fixed in OpenVKL, use gpu-devel for CI 2023-03-03 12:46:18 -08:00
Roba Binyahib 9314e7ae78 Run OSPRay Multidevice Module on GPU via ISPC as DPCPP 2023-03-03 15:25:13 -05:00
Will Usher c4abdb510f Use OpenVKL 1.3.2 release and ISPC 1.19 release 2023-03-02 13:50:57 +01:00
Will Usher 352a583e79 Add volume support to the MPI distributed renderer/MPI module 2023-03-02 13:48:24 +01:00
Will Usher caec535bed Build against OpenVKL 1.x devel for CPU by default
- Enable/disable VKL GPU device in superbuild
2023-03-02 13:48:24 +01:00
Will Usher 571b7e76e9 Support for Isosurfaces on the GPU in SYCL
Along with PR and CI cleanups
2023-03-01 16:38:03 -08:00
Will Usher 9c977d0f02 Add GPU volume support to pathtracer 2023-03-01 16:36:58 -08:00
Will Usher d749f3c651 Scivis volumes working with OSPRay SYCL/OpenvKL on GPU 2023-03-01 16:36:58 -08:00
Will Usher f66040f847 Support volumes via OpenVKL on the GPU, test in debug renderer
- Port transfer functions to tagged dispatch

- Use traceVolumeRay on the GPU as well, just find first interval
2023-03-01 16:36:58 -08:00
Johannes Günther 3d1f98e0fb Add support for double pumped NEON, remove KNL and MSVC14.0 support 2023-03-01 16:30:46 +01:00
Johannes Günther aeb4735cd2 Use public Embree v4 2023-03-01 16:30:46 +01:00
Johannes Günther 11723b39b6 CI: fix benchmark 2023-03-01 09:54:02 +01:00
Will Usher fd2f6d8242 Add backwards compat for mpi_offload, move ispc -> cpu handling 2023-02-28 21:59:57 +01:00
Will Usher b0cc2a1eca MPI 2.11 changelog and doc updates 2023-02-28 21:59:57 +01:00
Johannes Günther 0ed95ec157 Superbuild: update GLFW to 3.3.8 version and apply LoadLibrary patch 2023-02-28 13:41:40 +01:00
Johannes Günther ba32b4aece Superbuild: update gtest to 1.13.0 version 2023-02-28 13:41:40 +01:00
Will Usher b72247baa9 Use rkcommon release/openvkl in CI 2023-02-24 12:04:13 +01:00
Will Usher 1228768e41 Clean up handling of Group Comm's, missing comm_free's
This fixes the leaks, but a more robust solution for  tracking the
MPI_Comm ownership/releasing is needed
2023-02-24 12:04:13 +01:00
Will Usher da43b2e5ae Cleanups for PR
- Remove unused/empty DistributedRendererShared

- Embree defaults to ISPC support off now when building

- Run MPIoffload + GPU in CI, using OpenMPI for now but need to change
  to IMPI

- Handle no volumes builds in MPI Distrib test suite, fix dynamicLB issue

- Move project box up to C++

- Install gpu kernels static lib and link as public link dep for gpu
2023-02-24 12:04:13 +01:00
David E. DeMarle 87e5b85466 Let application tell mpi device what gpu to run on 2023-02-24 12:04:13 +01:00
Will Usher 2f1807568c Update region visibility raycasting and distrib test suite 2023-02-24 12:04:13 +01:00
Will Usher 7c5ea41e0f Fix bug when setting string params in MPI offload/distrib 2023-02-24 12:04:13 +01:00
Will Usher 059395edbf Enable dynamic LB w/ MPI + GPU 2023-02-24 12:04:13 +01:00
Will Usher 392c2dd916 Fix how volumes/openvkl being set for cpu mpi 2023-02-24 12:04:13 +01:00
Will Usher 0634cf0017 Fix link issues with "ispc/cpp" symbols and MPI module 2023-02-24 12:04:13 +01:00
Will Usher ac0b805778 Remove unused/stale pico bench library for stats 2023-02-24 12:04:13 +01:00
Will Usher d4738d0487 Run MPI data-distributed rendering on the GPU
- Add env-var for distributed GPU module to the distrib tutorials

- Split GPU kernels to static lib to re-use and reduce compile time

- tweak region visibility comp. to work on GPU, data-parallel now on GPU

- Update distributed raycast visible region calculation for Embree 4.
  No global filter functions in the API anymore

- Fix bad project box reduction for cameras
2023-02-24 12:04:13 +01:00
Will Usher b2d2a8e8a9 Run MPI offload rendering running on the GPU 2023-02-24 12:04:13 +01:00
Will Usher 59ba7919d8 Split up the MPI offload and distributed modules
Rework offload data handling on worker to not need an ISPCDevice

Data transfers now write to rkcommon::utility::FixedArray and are passed
using AbstractArray's to the internal API. This also reduces memory
overhead by no longer storing the appSharedData mirror on the worker
since that become redundant now that data is copied down to the internal
device. Also reduces data copying performed during data transfer by
eliminating the extra copy from cmdBuf/dataTransfer -> shared Data

Remove use of ISPCDevice and Data in MPIOffloadDevice

Replaced with ApplicationData that provides the necessary subset of host
side operations for keeping track of app data in the offload device
without requiring pulling in the CPU module

Split offload and distributed MPI modules up

Resolve leak/not freeing objects issues in MPI offload/distrib
2023-02-24 12:04:13 +01:00
Greg Johnson 8a8c80dc7c Use anchoring in loadLibraray(), switch to rkcommon 1.11.0 2023-02-23 16:42:59 +01:00
Moushumi Maria e1c00d1509 Call filterIntersectionSingle() from Isosurfaces_intersect_kernel() 2023-02-17 12:06:27 +01:00
Will Usher d53007c1c0 Assume dpcpp compiler is being used if module_gpu on, default GPU off 2023-02-13 10:31:55 -08:00
Miroslaw Pawlowski 0fb56793a7 Added curves interpolation routines 2023-01-30 17:50:49 +01:00
Krzysztof Raszkowski 9d808f67ee test_image_data: change URL to baseline images 2023-01-30 11:59:44 +01:00
David E. DeMarle 76af3c2256 install the MPI tutorials 2023-01-27 10:01:47 -08:00
David E. DeMarle b84d9f25fa separate module mpi tutorials and examples options
use the respective ospray options to turn on each set
of exectuables independently. Notably examples depend
on glfw, which can be problematic in HPC.
2023-01-27 10:01:47 -08:00
Miroslaw Pawlowski 0464e73d9f WA for Array::sharedPtr() crashing in ISPCRT 2023-01-25 09:26:57 -08:00
Will Usher e3d6baef71 CI match Embree release config plus comp_igc-19319 for shadows fix 2023-01-25 12:18:07 +01:00
Will Usher dd70eccda3 Clean up use of fp64 in kernels/code 2023-01-25 12:18:07 +01:00
Krzysztof Raszkowski 58be9cca36 ci: fix macos workflow 2023-01-11 13:07:49 +01:00
Miroslaw Pawlowski c46720efeb Disabling ospMPIDistribTestSuite 2023-01-11 13:07:49 +01:00
Miroslaw Pawlowski 4023bdb539 rtcOccluded missing context fix 2023-01-11 13:07:49 +01:00
Miroslaw Pawlowski 4984b6ccfc WA for sanitizer fatal error 2023-01-11 13:07:49 +01:00
Will Usher c704078019 Comment and CMake cleanups for merge 2023-01-11 13:07:49 +01:00
Will Usher d6189c0785 Allow mix material on the CPU 2023-01-11 13:07:49 +01:00
Will Usher a5cbe54f6c MPI releated cleanups 2023-01-11 13:07:49 +01:00
Roba Binyahib 1c742c5577 fix multiDevice bug 2023-01-11 13:07:49 +01:00
Will Usher 187c538df6 Fix incorrect writes to taskAccumID buffer leading to a crash in MPI
Rendering configurations without accum buffer/task accum IDs wouldn't
allocate a taskAccumID buffer but would still try to initialize it in
SparseFrameBuffer::clear
2023-01-11 13:07:49 +01:00
Miroslaw Pawlowski 4317408e36 Refined GPU tests 2023-01-11 13:07:49 +01:00
Miroslaw Pawlowski dbb3938f83 Multidevice crash fix 2023-01-11 13:07:49 +01:00
Miroslaw Pawlowski 4f29cdc9e3 Updated changed SpherePrecision reference images 2023-01-11 13:07:49 +01:00
Will Usher 70782a452b Fix some double promotions and allow-fcn-ptr compiler flag 2023-01-11 13:07:49 +01:00
Miroslaw Pawlowski c642831fa7 Fixed building in CI, temporarily disabled AVX512 on some OSes 2023-01-11 13:07:49 +01:00
Will Usher 6ec3b692bd Update installed osprayConfig.cmake to just find Embree4 2023-01-11 13:07:49 +01:00
Miroslaw Pawlowski 0e105e383a Update to Embree4 RayQuery rename 2023-01-11 13:07:49 +01:00
Miroslaw Pawlowski 50bcc0caad Fixed lights motion blur on CPU 2023-01-11 13:07:49 +01:00
Roba Binyahib 8eb52901cb Light module code hybridization ISPC+DPCPP 2023-01-11 13:07:49 +01:00
Miroslaw Pawlowski 059879ea52 Clipping fix for Embree4, Embree3 support remove 2023-01-11 13:07:49 +01:00
Miroslaw Pawlowski 34af6ace0a Separated device and host code 2023-01-11 13:07:49 +01:00
Miroslaw Pawlowski d964f08228 Added JIT compiled CI job for GPU 2023-01-11 13:07:49 +01:00
Miroslaw Pawlowski eb8c6688df Update to Embree4 rtcNewSYCLDevice and rtcIntersect changes 2023-01-11 13:07:49 +01:00
Will Usher 3f88f0ce66 For testing: default to pull the innersource repos for OSPRay GPU build 2023-01-11 13:07:49 +01:00
Will Usher 1afe5f611a Use new reusable docker workflow for GPU 2023-01-11 13:07:49 +01:00
Will Usher 5f4cb57836 Update superbuild to allow overriding git repos and branches 2023-01-11 13:07:49 +01:00
Miroslaw Pawlowski 0b9e2bb02d Separated object type definition from dispatching code 2023-01-11 13:07:49 +01:00
Miroslaw Pawlowski 129df5fb92 Unified renderer launching between ISPC and SYCL 2023-01-11 13:07:49 +01:00
Miroslaw Pawlowski efd242fd4e Update to Embree4 IN_ARGUMENTS API change 2023-01-11 13:07:49 +01:00
Will Usher e0ae5f05e4 Update to Embree4 rtcNewSYCLDevice API change 2023-01-11 13:07:49 +01:00
Will Usher 4898a99719 Update to Embree4 devel/API changes 2023-01-11 13:07:49 +01:00
Will Usher 81c172e275 Fix up MPI module execution with updated ISPCDevice
Need to commit it to create the ISPCRTDevice now, but it'd be better if
we didn't need the ISPCDevice at all here.
2023-01-11 13:07:49 +01:00
Will Usher 00190ef343 add missing ISPC symbols for windows 2023-01-11 13:07:49 +01:00
Will Usher fae79d9d5e Add GPU superbuild and CI job using innersource repos 2023-01-11 13:07:49 +01:00
Will Usher 04c1c44e66 Rename DPCPP LargeGRF to SYCL, do require Embree w/ SYCL support for GPU 2023-01-11 13:07:49 +01:00
Miroslaw Pawlowski 34cbc9c308 Removed Renderer SYCL kernel, optimized number of indirect calls, made compatible with latest Embree 2023-01-11 13:07:49 +01:00
Will Usher e1273b0256 Add -O0 for debug builds to force no optimization 2023-01-11 13:07:49 +01:00
Will Usher f655001a96 Support using Embree4 for CPU only builds as well 2023-01-11 13:07:49 +01:00
Will Usher 10e9487f77 Fix execution of ospTestSuite with the GPU module
It was linking the CPU module directly and thus the CPU module would
still be used instead of the GPU module

Test suite needs to link embree/openvkl directly now since it's not
linking the CPU module and getting them indirectly
2023-01-11 13:07:49 +01:00
Will Usher edd9401828 Use Embree sphere point for spheres by default 2023-01-11 13:07:49 +01:00
Will Usher 69249704b7 Fix QuadLight with intensity distributions 2023-01-11 13:07:49 +01:00
Will Usher 9a3331665d Support CPU builds with Embree3
Embree3 motion blur/clipping re-enabled
2023-01-11 13:07:49 +01:00
Will Usher ff0b333c71 CMake: GPU module check that geom user and filter fn in geom are off
Having them on results in extremely long compile times, as found by
Mirek
2023-01-11 13:07:49 +01:00
Will Usher ef6d9fe0f8 Rename DPCPP defines/text to SYCL. Fix non-sycl compiler CPU build 2023-01-11 13:07:49 +01:00
Will Usher 077d494b2f Add basic curves geometry support for GPU 2023-01-11 13:07:49 +01:00
Will Usher 0a136c95e0 Add native API interop support to share L0/SYCL context with app
This allows directly sharing USM allocations made by the application
with OSPRay on the GPU
2023-01-11 13:07:49 +01:00
Will Usher bbf3cfc243 Resolve bugs, disabled features, issues that were causing test failures 2023-01-11 13:07:49 +01:00
Will Usher bd572d3799 CMake options for GPU: ZEBin build and PartitionUnit 2023-01-11 13:07:49 +01:00
Will Usher c856b0b25a Port PixelFilters, Distribution2D, move math constants to USM
MicrofacetAlbedoTables also moved to USM
2023-01-11 13:07:49 +01:00
Will Usher ba884d5050 Update MPI module 2023-01-11 13:07:49 +01:00
Will Usher 1a3c29d648 Update SparseFB and usage of it for SYCL
Also fix handling of failing to find Embree/OpenVKL when building OSPRay
and clean up some issues/missing stuff

reenable transparent shadow code

add instID/geomID/primID AOV writes to AO Renderer
2023-01-11 13:07:49 +01:00
Will Usher a3a466089b Configure DPCPP/GPU target flags to match Embree
Installed cmake config: Don't look for OpenVKL when volumes are disabled

Only require C++17 for GPU module
2023-01-11 13:07:49 +01:00
Will Usher 078c589aaa Start running OSPRay as DPC++ on the GPU
Use an enum + switch statements to avoid issues/limitations with
function ptrs.

Renable volumes with OpenVKL when running on CPU w/ enable volumes

Put both CPU and GPU modules behind CMake flags

workaround odd bug with AO renderer and intervals

Add spheres geometry and port to use Embree sphere point

Push math constants for RNG to USM instead of in global constant

WA for `Material_dispatch_getTransparency` hang, working path tracer

Re-enable subdivision surfaces for CPU-only

Port Texture2D to use switch statement dispatch

Migrate all materials to switch dispatch

Add option for large grf, does improve performance

Workaround for TextureParam get3f bug

Update headers and APIs for L0 interop header updates/deprecations
2023-01-11 13:07:49 +01:00
Will Usher 73f4c42d9b Add support for CMake cross-compilation toolchains in the superbuild 2022-11-16 14:51:15 +01:00
Will Usher 003b647c75 Fix inconsistent Mesh surface differentials when not given texcoords
Update test images for new tests and fixed results of old tests
2022-11-08 16:32:36 -08:00
Will Usher e78ee5f2f8 Add artifact-on-failure to all test jobs, artifact-out to Win tests 2022-11-04 11:01:48 +01:00
Moushumi Maria 4d86a353f2 Fix a crash in pathtracer when there are no lights, closes #530
Do not compute CDF if there is no light

Do not add light when the scene is empty

Empty world

Handle unused parameter
2022-10-31 10:14:01 -06:00
Miroslaw Pawlowski 1122689881 TF valueRange changed to value in all testing code 2022-10-25 20:20:06 +02:00
Trevor Thomson b5c714a0b7 GitHub cleanup
- Remove Protex
- Remove GitLab CI
- Update submodule
- Enable schedule
- Ensure macos release jobs execute on x86_64
2022-10-12 14:16:59 +02:00
Trevor Thomson 649a743961 Add github actions workflows 2022-09-16 12:35:50 +00:00
Miroslaw Pawlowski d1bed79b3c centos7 CI issue fix 2022-09-02 16:34:43 +02:00
Miroslaw Pawlowski bb10f82450 Fixed a bug that a second copy of ObjectFactory<Device> table was created in OSPRay modules 2022-09-01 18:08:54 +02:00
Miroslaw Pawlowski 6c9b1489bf denoiser linker error fix 2022-08-02 11:44:31 +02:00
Krzysztof Raszkowski 4e8d2d42a0 ci: change Intel MPI version from 2021.2 to 2021.6 2022-08-01 11:15:57 +02:00
Miroslaw Pawlowski 01abb2e970 Device passed to all device created objects and used for all shared memory allocations, new ObjectFactory 2022-07-28 18:10:36 +02:00
Miroslaw Pawlowski 653b146cd3 Patched ISPCRT 2022-07-28 17:38:05 +02:00
Johannes Günther ae1cba844c Stop testing Ubuntu 16 2022-07-28 17:38:05 +02:00
Moushumi Maria 2a05a9c6c1 Build custom ISPCRT in superbuild 2022-07-28 17:38:05 +02:00
Moushumi Maria f9d7785cad Allocate array data with ISPCRT 2022-07-28 17:38:05 +02:00
Miroslaw Pawlowski 964a41de26 all ISPC shared memory allocated with ISPCRT 2022-07-28 17:38:05 +02:00
Johannes Günther 85d816070b Fix dynamicScene and used BVH quality, closes #537 2022-07-27 11:47:47 +02:00
Johannes Günther ec8671a320 Support single ISPC target on Windows 2022-07-26 11:43:30 +02:00
Johannes Günther df49686230 Fix material parameter documentation, closes #535 2022-07-25 10:58:40 +02:00
Johannes Günther bf25836fd5 Pick exact version of rkcommon, closes #529 2022-07-25 10:58:40 +02:00
Will Usher 13bdd11b99 Use the numParticles passed in constructor as the default value 2022-07-06 19:33:41 -07:00
Will Usher f3f1416563 Use an atexit handler to shutdown to handle benchmark lib calling exit 2022-06-20 11:26:52 +00:00
Johannes Günther d7762836ce Bump version 2022-06-20 13:18:45 +02:00
Johannes Günther fdda0889f9 Merge branch 'release-2.10.x' 2022-06-14 12:46:09 +02:00
Johannes Günther d3322a74a3 Wrapper and tests for packed VDB volumes 2022-06-14 11:18:47 +02:00
Johannes Günther ade96f0442 Fine control over ISA on superbuild 2022-06-13 13:06:51 +02:00
Johannes Günther 86145c6041 Linux release with icx 2022-06-13 11:42:13 +02:00
Johannes Günther 52836d0c3e Sync docu and requirements 2022-06-13 11:41:35 +02:00
Miroslaw Pawlowski d660e4ac14 Changed TransferFunction parameter to box1f, removed toVec2() 2022-06-10 18:45:09 +02:00
Johannes Günther 58433bf2d4 Update dependencies 2022-06-10 15:28:06 +02:00
Johannes Günther 13990355a7 Enable SunSky for SciVis and fix crash changing it 2022-06-10 11:29:36 +02:00
Johannes Günther cd250ef031 Also install SDK headers of MPI module and cleanup, closes #526 2022-06-10 08:46:35 +02:00
Nadir Román Guerrero b759e340b7 Install cpu module ispc headers into SDK 2022-06-09 20:12:51 +02:00
Carson Brownlee 7d080b6eb3 adding face varying attributes to subd/meshes 2022-06-09 19:57:51 +02:00
Johannes Günther 3f0eb05b78 Test ID buffers 2022-06-03 11:51:26 +02:00
Johannes Günther 918fe73f70 Harmonize instIDs across geometry & volume BVHs 2022-06-03 11:51:26 +02:00
Johannes Günther 8e78559521 cleanup volumeID 2022-06-03 11:51:26 +02:00
Will Usher 71b8700170 Add support for ID buffers in MPI offload and distributed 2022-06-03 11:51:26 +02:00
Carson Brownlee c16152674a Adding FB id buffers. Prim, object, instance IDs.
record depth also for volumes
refine VolumetricModel_postIntersect
2022-06-03 11:51:26 +02:00
Johannes Günther a9956f0c35 Move makeRandomColor to rkcommon 2022-05-05 18:47:24 +02:00
Will Usher 79916120c2 Use getDataSafe from rkcommon now 2022-05-05 18:44:57 +02:00
Johannes Günther 9153539635 Switch to single-year Copyright format 2022-05-02 13:43:07 +02:00
Johannes Günther d552f2ecf2 Workaround compile issue 2022-04-22 17:57:46 +02:00
Johannes Günther 80c6a18e69 Fix clipping with ray-parallel planes, closes #520 2022-04-22 09:57:05 +02:00
Trevor Thomson 34040261a5 Use new centos:7 image with packages for kw support 2022-04-20 16:22:41 +02:00
Will Usher 8742857bff fix missing override specifier on DFB::getCurrentProgress 2022-04-15 11:22:33 -07:00
Will Usher 951d4b79d0 Refactor task management to launch tasks in ISPC
RenderTaskDesc now describes a region of the image to be rendered by a
thread and potentially stopped based on the adaptive rendering
termination criteria

- Inner parallel for launch moved to ISPC, runs over these render tasks
- Tile data stored in framebuffer instead of as stack vars to allocate
them ahead of time
- Fused render + write kernels for Renderers and PathTracer
- Sparse FB stores individual tiles for use in DFB and multidevice
- Refactor FB's to use fcn ptrs in ISPC for writing image data
- DFB data parallel: Store region's partial images in SparseFB layers
- Store FB channels in ISPC side memory

- SparseFB can have accumIDs without accum buffering
DFB needs the SparseFB to track accumIDs without accumulating into its
local data, since the accumulation must be done at the distributed level
during the tile operation. So we need to make a SparseFB without
accumulation buffering but with accumulation IDs

- Refactor tile ops to pixel ops to run during dispatch or as kernel
Decoupling the parallelism of per-pixel operations from the Tile size
gives us more flexibility in how/when to run these post-processing
operations in the pipeline.

- Multidevice Pixel ops are run by the subdevices in the sparse fb,
frame operations are not currently run in multidevice.
- Refactor separate ISPC/C++ Tile structs to shared Tile struct
- Update test image data for MPI distributed and readme about how to
  generate baseline images
- Sort tasks in z-order, SparseFB tasks are sorted locally in each tile

- Use thread local storage to reduce contention on progress atomic
This emulates the same reporting frequency we had before in OSPRay where
the outer parallel for over tiles would report progress, while the inner
loop over pixels did not report each individual pixel.
2022-04-14 08:10:13 -07:00
Will Usher 587de6cf84 Fix issue with OpenMPI arg handling, closes #518 2022-04-14 10:11:48 +02:00
Will Usher 3d425603c7 Resolve bad lifetime tracking in MPIOffload and Worker, fixes #518
We need to use Ref's here to sync the app's retain/release calls with
the internal state tracking objects the offload and offload worker
maintain to communicate with each other. Without this, we either push
the tracking to be done with the internal MPIDistributedDevice's ref
count, which leads to leaks where we don't see we should free things in
time; or if we don't use ref counting, we delete things too early
leading to a crash
2022-04-12 18:31:09 +02:00
Trevor Thomson ce690955b4 Manage all docker images as job templates 2022-03-11 15:25:32 -05:00
Trevor Thomson b699bc55b4 Klocwork build requires on centos7-mod 2022-03-09 09:50:42 -05:00
Trevor Thomson df63f1dfa3 Define specific templates for centos7 with different gcc versions; define templates for arch and centos8 2022-03-09 09:50:42 -05:00
Trevor Thomson 85ed539e28 Switch to cross-project centos:7 image 2022-03-09 09:50:42 -05:00
Johannes Günther 152d5fc414 Fix KW issues 2022-03-08 17:39:37 +01:00
Johannes Günther 15d5bd1077 Fix warnings 2022-03-08 16:19:57 +01:00
Miroslaw Pawlowski 01beea16f1 (part 2 of 2) introduced Shared Struct - a new way of sharing data with ISPC 2022-02-28 17:13:32 +00:00
Johannes Günther 384cfade35 Bump CR year 2022-02-23 17:14:28 +01:00
Johannes Günther 0fa608232a Bump CR year 2022-02-15 23:37:16 +01:00
Johannes Günther 6fe34350f9 Bump version 2022-02-15 23:30:44 +01:00
Johannes Günther bc891f413f Merge branch 'release-2.9.x' 2022-02-15 22:13:00 +01:00
Johannes Günther bf877c9e36 Update dependencies and README 2022-02-15 19:09:01 +01:00
Johannes Günther ce42e06709 Online blending for shadow catcher 2022-02-10 18:29:04 +00:00
Bruce Cherniak 3efa6f9146 Fix GeometryLights for ShadowCatcher 2022-02-10 18:29:03 +00:00
David E DeMarle 28ca5a96f1 refactor mpidevice to use OSPRayDevice instead of vkl/embree
Removes vkl/embree devices and add an ospray device.
Delegates setParam and new* to internal device to let it do
that it needs to.
Remove createLocalObject helpers. They appear to be a legacy
 that are not needed today.
Ensure subdevice has a valid embree device for distributed
 world to use.

Also clang-format touched files.
2022-02-10 16:27:14 +00:00
Johannes Günther 31264b66eb Refactor cylinder light 2022-02-09 13:27:10 +01:00
Johannes Günther 95f7589541 Lumious intensity distribution also for quad and sphere light 2022-02-09 13:27:10 +01:00
Johannes Günther 765991f40b Refactor SpotLight
- replace world2light and light2world by c0 and c90
- calc invarient AngularAttenuation and IntensityDistr before branching
2022-02-09 13:27:10 +01:00
Roba Binyahib 23185f67f6 adding support for dynamic load balancing in Offload device
init DynamicLoadBalancer outline
sending half of workload to thief
sending half of received workload to stored lifelines
adding functions to the Dynamic Load Balancer class to handle the work queue
adding structs for the different messages
creating ObjectHandle at the renderFrame API call
passing the loadBalancer to ThreadedRenderTask
enabling static balancer through environment variable
threading sync
2022-02-02 10:13:53 -07:00
Will Usher 5c4c3f8232 Add support for Intel oneAPI DPCPP compiler 2022-01-27 17:02:54 +00:00
Will Usher 1549c1b32c Resolve comm dup crash due to leaking FBs, obj handle less error prone
Refactor ObjectHandle creation and use to be less error prone
Also add handle validation checking in distributed device for
debugging
2022-01-25 15:31:39 -08:00
Johannes Günther e9ed53ec50 Fix spelling 2022-01-14 13:57:14 +00:00
Johannes Günther 9d0966919a Add protex scan 2021-12-22 12:51:23 +01:00
Will Usher 9a8963c0d6 Allow rebinding of group for instance, geometry, volume in MultiDevice 2021-12-20 10:16:33 -08:00
Johannes Günther 0a2ecdfd25 Allow rebinding of group for instance, fix it for of geometry/volume 2021-12-20 15:35:23 +01:00
Will Usher 1e9400a75a Change TileError to use rkcommon AlignedVector instead of aligned_malloc
This fixes a bug where the TileError class was not copyable but didn't
delete the copy ctor and copy-assign operators, allowing for a double
free when copying them.
2021-12-17 11:54:05 -08:00
Trevor Thomson 250c95a251 Avoid unknown option for macos linker 2021-12-16 13:16:54 -05:00
Johannes Günther 67dfbc0318 Cleanup 2021-12-15 12:48:55 +01:00
Sean McDuffee 06c4001431 switch to regular area sample for scivis 2021-12-14 18:05:24 +01:00
Sean McDuffee 8838b006d6 add solid angle sampling to quad lights 2021-12-14 18:05:24 +01:00
Johannes Günther e18f3d15bd static_assert 2021-12-10 17:26:23 +01:00
Miroslaw Pawlowski 3475ae1166 (part 1 of 2) introduced Shared Struct - a new way of sharing data with ISPC 2021-12-08 09:49:59 +01:00
Roba Binyahib e7ab776b76 fixing math bug 2021-12-06 15:30:23 -07:00
Trevor Thomson 733807c076 Migrate files for CPU module
Define global variables for categories of apps
Fix inconsistent default device in C99 header
2021-12-02 09:36:14 +00:00
Johannes Günther 49cecc70f3 Deformation motion blur for Mesh 2021-11-30 10:11:23 +01:00
Johannes Günther 7cb98c9310 Bump version 2021-11-26 11:05:20 +01:00
Will Usher 2b90ed0c43 Support 3D ISPC task launches in OSPRay's ISPC task system 2021-11-15 09:18:23 -08:00
Trevor Thomson 80df2e9a92 Merge branch 'master' into devel 2021-11-04 09:56:50 -04:00
Trevor Thomson fe4b3806f8 Merge branch 'release-2.8.x' 2021-11-03 16:45:40 -04:00
Trevor Thomson f0d485990d Update hashes for verifying downloads 2021-11-03 14:11:03 -04:00
Johannes Günther eeff6a95f6 Update dependencies 2021-10-30 11:31:00 +02:00
Johannes Günther 19018de25e Sync README 2021-10-30 11:31:00 +02:00
Johannes Günther 5559419d21 Handle numerical issues with rolling shutter 2021-10-30 11:31:00 +02:00
Miroslaw Pawlowski 1bdc4e13c7 removed cppEquivalent from ISPC classes 2021-10-29 22:35:35 +02:00
Sean McDuffee 04f7149fd1 Add cylinder light 2021-10-29 20:52:14 +02:00
Johannes Günther bd6c657fd6 Support quaternion motion blur 2021-10-29 11:00:36 +02:00
Johannes Günther 82e3564a57 Refactor MotionTransform
- to be used with composition
- encapsulate setting Embree transforms
2021-10-27 18:07:03 +02:00
Bruce Cherniak d53a6832c4 For Debug EyeLight renderer, flip backfacing normals 2021-10-27 14:46:58 +02:00
Johannes Günther 8c7f62383b Temporarily disable some MPIDistribTests when compiled with MSVC15 2021-10-27 10:33:32 +02:00
Johannes Günther 3bb1f557a9 Support rolling shutter effect 2021-10-27 10:33:20 +02:00
Johannes Günther 6db0860142 Test remaining stereo modes for MotionCamera as well 2021-10-22 17:54:20 +02:00
Johannes Günther bbbfb2ef07 Smarter CMake build type for superbuild as well 2021-10-22 14:44:30 +02:00
Johannes Günther 3f69d3b3f0 Adjust QuadLight MB test params to match GeometricLight one 2021-10-18 07:18:24 +02:00
Johannes Günther dee4cfbbe8 Fix Mesh_sampleArea for quads 2021-10-18 07:18:24 +02:00
Will Usher 68ca7afb62 doc: Fix MPI tutorial links in doc 2021-10-15 09:13:34 +02:00
Miroslaw Pawlowski cbf9d26d02 lights instancing and motion blur with tests 2021-10-14 09:28:40 +02:00
Will Usher a33e486ef3 ci: Begin running MPI Distributed rendering tests 2021-10-06 10:15:03 -07:00
Will Usher ff80074872 Split up test suite into utils lib + tests app
Fix a typo in test suite
2021-10-04 10:26:40 -07:00
Greg Johnson c1b27d0b19 CI: additional benchmark jobs; scheduled benchmark runs. 2021-09-30 13:23:47 -05:00
Johannes Günther b81afca8f7 Merge branch 'master' into devel 2021-09-30 09:54:43 +02:00
Carlo Cabrera a884edc34a Use @loader_path instead of @executable_path on macOS
`@executable_path` resolves to the directory of "the main executable for
the process" while `@loader_path` is the directory of "the mach-o binary
which contains the load command using @loader_path" (see `man dyld`).

This means that using `@executable_path` constrains where I can put
binaries that link to `libospray` if I need `RPATH` to resolve
correctly. In particular, if I install `libospray` into (say)
`/usr/local/lib`, the linker resolves `RPATH` references correctly only
if my linked executable is in `/usr/local/*`.

On the other hand, using `@loader_path` constrains only the
location of the libraries that `libospray` depends on, and my linked
executable can be anywhere in the file system.
2021-08-31 11:21:34 +02:00
Johannes Günther 2703c1493c Guard against empty value ranges for VKL iterator 2021-08-31 05:42:54 +02:00
Johannes Günther 89ad98b14b Bump version, update VDB images 2021-08-30 05:02:04 +02:00
1512 changed files with 59825 additions and 132135 deletions
+1
View File
@@ -1 +1,2 @@
*.rc text working-tree-encoding=UTF-16LE-BOM eol=CRLF
*.patch eol=lf
+57
View File
@@ -0,0 +1,57 @@
## Copyright 2009 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
name: Baseline
on:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: read-all
jobs:
### BUILD JOBS ###
build-ubuntu2004-gcc:
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
secrets: inherit
with:
image: ubuntu:20.04
cmd: |
scripts/build/linux.sh -G Ninja -DBUILD_GLFW=OFF -DBUILD_OSPRAY_MODULE_MULTIDEVICE=ON
artifact-out: build-ubuntu2004-gcc
artifact-path: build/install/ospray build/CMakeCache.txt build/*/build/CMakeCache.txt
### Benchmarks ###
generate-ci-baseline-avx2:
needs: build-ubuntu2004-gcc
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
with:
image: ubuntu:20.04
runs-on: '"avx2"'
cmd: |
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/build/install/ospray/lib:$LD_LIBRARY_PATH
export PATH=$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH
scripts/tests/generate_baseline.sh
artifact-in: build-ubuntu2004-gcc
artifact-out: generate-ci-baseline-avx2
artifact-path: generated_test_images
generate-ci-baseline-avx512skx:
needs: build-ubuntu2004-gcc
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
with:
image: ubuntu:20.04
cmd: |
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/build/install/ospray/lib:$LD_LIBRARY_PATH
export PATH=$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH
scripts/tests/generate_baseline.sh
artifact-in: build-ubuntu2004-gcc
artifact-out: generate-ci-baseline-avx512skx
artifact-path: generated_test_images
+108
View File
@@ -0,0 +1,108 @@
## Copyright 2009 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
name: Benchmark
on:
schedule:
- cron: '30 0 * * *'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: read-all
jobs:
### BUILD JOBS ###
build-linux:
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
secrets: inherit
with:
image: rockylinux:8.7
env-from-files: .github/workflows/dpcpp.env
cmd: |
module load cmake/3.25.3
module load mpi/mpich-x86_64
export CC=clang
export CXX=clang++
scripts/build/linux.sh -DBUILD_GPU_SUPPORT=ON
artifact-out: build-linux
artifact-path: build/install/ospray build/CMakeCache.txt build/*/build/CMakeCache.txt
### Benchmarks ###
benchmark-x8280-1:
needs: build-linux
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/perf.yml@main
secrets: inherit
with:
runs-on: '"vis-perf-x8280-1"'
setup-benny: true
cmd: |
scripts/tests/run-benchmarks.sh
artifact-in: build-linux
benchmark-x8380-1:
needs: build-linux
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/perf.yml@main
secrets: inherit
with:
runs-on: '"vis-perf-x8380-1"'
setup-benny: true
cmd: |
scripts/tests/run-benchmarks.sh
artifact-in: build-linux
benchmark-a-1:
needs: build-linux
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/perf.yml@main
secrets: inherit
with:
runs-on: '"vis-perf-a3970x-1"'
setup-benny: true
cmd: |
scripts/tests/run-benchmarks.sh
artifact-in: build-linux
benchmark-adl-1:
needs: build-linux
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/perf.yml@main
secrets: inherit
with:
runs-on: '"vis-perf-i9-12900k-1"'
setup-benny: true
cmd: |
scripts/tests/run-benchmarks.sh
artifact-in: build-linux
benchmark-dg2:
needs: build-linux
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
secrets: inherit
with:
image: ubuntu:22.04
env-from-files: .github/workflows/gfx-ubuntu22.env
options: --device=/dev/dri:/dev/dri
runs-on: '"vis-perf-dg2-01"'
setup-benny: true
cmd: |
scripts/tests/run-benchmarks.sh GPU
artifact-in: build-linux
benchmark-pvc:
needs: build-linux
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
secrets: inherit
with:
image: ubuntu:22.04
env-from-files: .github/workflows/gfx-ubuntu22.env
options: --device=/dev/dri:/dev/dri
runs-on: '"vis-perf-spr-pvc-01"'
setup-benny: true
cmd: |
scripts/tests/run-benchmarks.sh GPU
artifact-in: build-linux
+242
View File
@@ -0,0 +1,242 @@
## Copyright 2022 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
name: CI Linux GPU
on:
push:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: read-all
jobs:
### BUILD JOBS ###
ubu22-mpi-dpcpp-build:
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
secrets: inherit
with:
image: ubuntu:22.04
env-from-files: .github/workflows/dpcpp.env
cmd: |
module load cmake/3.25.3
export CC=clang
export CXX=clang++
scripts/build/linux.sh -G Ninja -DBUILD_GLFW=OFF -DBUILD_GPU_SUPPORT=ON -DBUILD_OSPRAY_MODULE_MPI=ON -DBUILD_OSPRAY_MODULE_MULTIDEVICE=ON
artifact-out: build-ubuntu2204-mpi-dpcpp
artifact-path: build/install/ospray build/CMakeCache.txt build/*/build/CMakeCache.txt
ubu22-mpi-icx-build:
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
secrets: inherit
with:
image: ubuntu:22.04
env-from-files: .github/workflows/icx-linux.env .github/workflows/gfx-ubuntu22.env # OIDN AOT needs ocloc
cmd: |
module load cmake/3.25.3
scripts/build/linux.sh -G Ninja -DBUILD_GLFW=OFF -DBUILD_GPU_SUPPORT=ON -DBUILD_OSPRAY_MODULE_MPI=ON -DBUILD_OSPRAY_MODULE_MULTIDEVICE=ON -DBUILD_EMBREE_FROM_SOURCE=ON -DBUILD_OPENVKL_FROM_SOURCE=ON -DBUILD_OIDN_FROM_SOURCE=ON
artifact-out: build-ubuntu2204-mpi-icx
artifact-path: build/install/ospray build/CMakeCache.txt build/*/build/CMakeCache.txt
suse-icx-build:
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
secrets: inherit
with:
image: opensuse/leap:15.3
env-from-files: .github/workflows/icx-linux.env
cmd: |
module load cmake/3.25.3
scripts/build/linux.sh -DBUILD_GPU_SUPPORT=ON -DBUILD_EMBREE_FROM_SOURCE=ON -DBUILD_OPENVKL_FROM_SOURCE=ON
rocky8-mpich-dpcpp-build:
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
secrets: inherit
with:
image: rockylinux:8
env-from-files: .github/workflows/dpcpp.env
cmd: |
module load cmake/3.25.3
module load mpi/mpich-x86_64
export CC=clang
export CXX=clang++
scripts/build/linux.sh -DBUILD_GPU_SUPPORT=ON -DBUILD_OSPRAY_MODULE_MPI=ON -DBUILD_OSPRAY_MODULE_MULTIDEVICE=ON
artifact-out: build-rocky8-mpich-dpcpp
artifact-path: build/install/ospray build/CMakeCache.txt build/*/build/CMakeCache.txt
### TEST JOBS ###
dpcpp-dg2-ubu22-test:
needs: ubu22-mpi-dpcpp-build
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
secrets: inherit
with:
timeout-minutes: 100
image: ubuntu:22.04
env-from-files: .github/workflows/gfx-ubuntu22.env
options: --device=/dev/dri:/dev/dri
runs-on: '"dg2"'
artifact-in: build-ubuntu2204-mpi-dpcpp
artifact-out: test-ubuntu2204-dpcpp-dg2
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
artifact-on-failure: true
cmd: |
module load cmake/3.25.3
export PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH"
scripts/tests/run_gpu_tests.sh "$GITHUB_WORKSPACE"
dpcpp-pvc-ubu22-test:
needs: ubu22-mpi-dpcpp-build
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
secrets: inherit
with:
timeout-minutes: 100
image: ubuntu:22.04
env-from-files: .github/workflows/gfx-ubuntu22.env
options: --device=/dev/dri:/dev/dri
runs-on: '"pvc"'
artifact-in: build-ubuntu2204-mpi-dpcpp
artifact-out: test-ubuntu2204-dpcpp-pvc
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
artifact-on-failure: true
cmd: |
module load cmake/3.25.3
export PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH"
scripts/tests/run_gpu_tests.sh "$GITHUB_WORKSPACE"
mpi-dpcpp-pvc-ubu22-test:
needs: ubu22-mpi-dpcpp-build
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
secrets: inherit
with:
timeout-minutes: 100
image: ubuntu:22.04
env-from-files: .github/workflows/gfx-ubuntu22.env
options: --device=/dev/dri:/dev/dri
runs-on: '"pvc"'
artifact-in: build-ubuntu2204-mpi-dpcpp
artifact-out: test-ubuntu2204-mpi-dpcpp-pvc
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
artifact-on-failure: true
cmd: |
module load cmake/3.25.3
export PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH"
OMPI_ALLOW_RUN_AS_ROOT=1 OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 scripts/tests/run_gpu_tests.sh "$GITHUB_WORKSPACE" SKIP_GPU TEST_MPI
multidev-dpcpp-pvc-ubu22-test:
needs: ubu22-mpi-dpcpp-build
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
secrets: inherit
with:
timeout-minutes: 100
image: ubuntu:22.04
env-from-files: .github/workflows/gfx-ubuntu22.env
options: --device=/dev/dri:/dev/dri
runs-on: '"pvc"'
artifact-in: build-ubuntu2204-mpi-dpcpp
artifact-out: test-ubuntu2204-multidev-dpcpp-pvc
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
artifact-on-failure: true
cmd: |
module load cmake/3.25.3
export PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH"
scripts/tests/run_gpu_tests.sh "$GITHUB_WORKSPACE" SKIP_GPU TEST_MULTIDEVICE
icx-dg2-ubu22-test:
needs: ubu22-mpi-icx-build
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
secrets: inherit
with:
timeout-minutes: 100
image: ubuntu:22.04
env-from-files: .github/workflows/icx-linux.env .github/workflows/gfx-ubuntu22.env
options: --device=/dev/dri:/dev/dri
runs-on: '"dg2"'
artifact-in: build-ubuntu2204-mpi-icx
artifact-out: test-ubuntu2204-icx-dg2
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
artifact-on-failure: true
cmd: |
export PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH"
scripts/tests/run_gpu_tests.sh "$GITHUB_WORKSPACE"
mpi-icx-dg2-ubu22-test:
needs: ubu22-mpi-icx-build
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
secrets: inherit
with:
timeout-minutes: 100
image: ubuntu:22.04
env-from-files: .github/workflows/icx-linux.env .github/workflows/gfx-ubuntu22.env
options: --device=/dev/dri:/dev/dri
runs-on: '"dg2"'
artifact-in: build-ubuntu2204-mpi-icx
artifact-out: test-ubuntu2204-mpi-icx-dg2
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
artifact-on-failure: true
cmd: |
export PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH"
OMPI_ALLOW_RUN_AS_ROOT=1 OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 scripts/tests/run_gpu_tests.sh "$GITHUB_WORKSPACE" SKIP_GPU TEST_MPI
icx-pvc-ubu22-test:
needs: ubu22-mpi-icx-build
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
secrets: inherit
with:
timeout-minutes: 100
image: ubuntu:22.04
env-from-files: .github/workflows/icx-linux.env .github/workflows/gfx-ubuntu22.env
options: --device=/dev/dri:/dev/dri
runs-on: '"pvc"'
artifact-in: build-ubuntu2204-mpi-icx
artifact-out: test-ubuntu2204-icx-pvc
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
artifact-on-failure: true
cmd: |
export PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH"
scripts/tests/run_gpu_tests.sh "$GITHUB_WORKSPACE"
mpi-icx-pvc-ubu22-test:
needs: ubu22-mpi-icx-build
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
secrets: inherit
with:
timeout-minutes: 100
image: ubuntu:22.04
env-from-files: .github/workflows/icx-linux.env .github/workflows/gfx-ubuntu22.env
options: --device=/dev/dri:/dev/dri
runs-on: '"pvc"'
artifact-in: build-ubuntu2204-mpi-icx
artifact-out: test-ubuntu2204-mpi-icx-pvc
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
artifact-on-failure: true
cmd: |
export PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH"
OMPI_ALLOW_RUN_AS_ROOT=1 OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 scripts/tests/run_gpu_tests.sh "$GITHUB_WORKSPACE" SKIP_GPU TEST_MPI
multidev-icx-pvc-ubu22-test:
needs: ubu22-mpi-icx-build
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
secrets: inherit
with:
timeout-minutes: 100
image: ubuntu:22.04
env-from-files: .github/workflows/icx-linux.env .github/workflows/gfx-ubuntu22.env
options: --device=/dev/dri:/dev/dri
runs-on: '"pvc"'
artifact-in: build-ubuntu2204-mpi-icx
artifact-out: test-ubuntu2204-multidev-icx-pvc
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
artifact-on-failure: true
cmd: |
export PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH"
scripts/tests/run_gpu_tests.sh "$GITHUB_WORKSPACE" SKIP_GPU TEST_MULTIDEVICE
+432
View File
@@ -0,0 +1,432 @@
## Copyright 2009 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
name: CI Linux
on:
push:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: read-all
jobs:
### BUILD JOBS ###
build-arch-clang:
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
secrets: inherit
with:
image: archlinux:latest
cmd: |
export CC=clang
export CXX=clang++
scripts/build/linux.sh -G Ninja -DBUILD_GLFW=OFF
build-arch-clang-extras:
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
secrets: inherit
with:
image: archlinux:latest
cmd: |
export CC=clang
export CXX=clang++
scripts/build/linux.sh -G Ninja -DBUILD_GLFW=OFF -DBUILD_OSPRAY_CI_EXTRAS=ON -DBUILD_OSPRAY_MODULE_MPI=ON -DBUILD_OSPRAY_MODULE_MULTIDEVICE=ON
build-arch-gcc:
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
secrets: inherit
with:
image: archlinux:latest
cmd: |
scripts/build/linux.sh -G Ninja -DBUILD_GLFW=OFF
build-ubuntu2404-gcc-extras:
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
secrets: inherit
with:
image: ubuntu:24.04
cmd: |
scripts/build/linux.sh -G Ninja -DBUILD_GLFW=OFF -DBUILD_OSPRAY_CI_EXTRAS=ON
build-rocky8-gcc:
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
secrets: inherit
with:
image: rockylinux:8
cmd: |
scripts/build/linux.sh -DBUILD_EMBREE_FROM_SOURCE=ON -DBUILD_OPENVKL_FROM_SOURCE=ON -DBUILD_OIDN=OFF -DBUILD_ISA_AVX512=OFF -DTBB_VERSION=2021.9.0
artifact-out: build-rocky8-gcc
artifact-path: build/install/ospray build/CMakeCache.txt build/*/build/CMakeCache.txt
build-rocky8-icx:
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
secrets: inherit
with:
image: rockylinux:8
cmd: |
module load cmake
module load intel/2022.1
export CC=icx
export CXX=icpx
export CXXFLAGS="-fhonor-infinities -fhonor-nans"
export CFLAGS=$CXXFLAGS
export LDFLAGS="-static-intel"
scripts/build/linux.sh -DBUILD_EMBREE_FROM_SOURCE=ON -DBUILD_OPENVKL_FROM_SOURCE=ON -DBUILD_OIDN=OFF -DTBB_VERSION=2021.9.0
artifact-out: build-rocky8-icx
artifact-path: build/install/ospray build/CMakeCache.txt build/*/build/CMakeCache.txt
build-rocky8-mpi-impi:
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
secrets: inherit
with:
image: rockylinux:8
cmd: |
module load cmake
module load impi/2021.6
scripts/build/linux.sh -DBUILD_EMBREE_FROM_SOURCE=ON -DBUILD_OPENVKL_FROM_SOURCE=ON -DBUILD_OIDN=OFF -DBUILD_OSPRAY_MODULE_MPI=ON -DBUILD_ISA_AVX512=OFF -DTBB_VERSION=2021.9.0
build-rocky8-mpi-mpich:
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
secrets: inherit
with:
image: rockylinux:8
cmd: |
module load cmake
module load mpi/mpich-x86_64
scripts/build/linux.sh -DBUILD_EMBREE_FROM_SOURCE=ON -DBUILD_OPENVKL_FROM_SOURCE=ON -DBUILD_OIDN=OFF -DBUILD_OSPRAY_MODULE_MPI=ON -DBUILD_ISA_AVX512=OFF -DTBB_VERSION=2021.9.0
artifact-out: build-rocky8-mpi-mpich
artifact-path: build/install/ospray build/CMakeCache.txt build/*/build/CMakeCache.txt
build-rocky8-mpi-openmpi:
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
secrets: inherit
with:
image: rockylinux:8
cmd: |
module load cmake
module load mpi/openmpi-x86_64
scripts/build/linux.sh -DBUILD_EMBREE_FROM_SOURCE=ON -DBUILD_OPENVKL_FROM_SOURCE=ON -DBUILD_OIDN=OFF -DBUILD_OSPRAY_MODULE_MPI=ON -DBUILD_ISA_AVX512=OFF -DTBB_VERSION=2021.9.0
build-centos8:
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
secrets: inherit
with:
image: centos:8
cmd: |
scripts/build/linux.sh -G Ninja
artifact-out: build-centos8
artifact-path: build/install/ospray build/CMakeCache.txt build/*/build/CMakeCache.txt
build-centos8-mpi-mpich:
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
secrets: inherit
with:
image: centos:8
cmd: |
module load mpi/mpich-x86_64
scripts/build/linux.sh -DBUILD_OSPRAY_MODULE_MPI=ON
build-centos8-mpi-openmpi:
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
secrets: inherit
with:
image: centos:8
cmd: |
module load mpi/openmpi-x86_64
scripts/build/linux.sh -DBUILD_OSPRAY_MODULE_MPI=ON
build-rocky8-oidn-mpi:
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
secrets: inherit
with:
image: rockylinux:8
cmd: |
module load cmake/3.15.2
module load mpi/mpich-x86_64
scripts/build/linux.sh -DBUILD_OSPRAY_MODULE_MPI=ON
artifact-out: build-rocky8-oidn-mpi
artifact-path: build/install/ospray build/CMakeCache.txt build/*/build/CMakeCache.txt
build-linux-debug:
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
secrets: inherit
with:
image: archlinux:latest
cmd: |
export CC=clang
export CXX=clang++
export CFLAGS=-fsanitize=address
export CXXFLAGS=-fsanitize=address
export LDFLAGS=-fsanitize=address
scripts/build/linux.sh -G Ninja -DBUILD_GLFW=OFF -DCMAKE_BUILD_TYPE=Debug -DBUILD_OSPRAY_MODULE_MPI=ON
artifact-out: build-linux-debug
artifact-path: build/install/ospray build/CMakeCache.txt build/*/build/CMakeCache.txt build/install/embree
build-ubuntu2404-gcc:
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
secrets: inherit
with:
image: ubuntu:24.04
cmd: |
scripts/build/linux.sh -G Ninja -DBUILD_GLFW=OFF
artifact-out: build-ubuntu2404-gcc
artifact-path: build/install/ospray build/CMakeCache.txt build/*/build/CMakeCache.txt
build-ubuntu2004-gcc:
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
secrets: inherit
with:
image: ubuntu:20.04
cmd: |
scripts/build/linux.sh -G Ninja -DBUILD_GLFW=OFF -DBUILD_OSPRAY_MODULE_MULTIDEVICE=ON
artifact-out: build-ubuntu2004-gcc
artifact-path: build/install/ospray build/CMakeCache.txt build/*/build/CMakeCache.txt
build-ubuntu2204-oidn-mpi:
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
secrets: inherit
with:
image: ubuntu:22.04
cmd: |
scripts/build/linux.sh -DBUILD_OSPRAY_MODULE_MPI=ON
artifact-out: build-ubuntu2204-oidn-mpi
artifact-path: build/install/ospray build/CMakeCache.txt build/*/build/CMakeCache.txt
build-ubuntu2204-arm:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/perf.yml@main
with:
runs-on: '[ "Linux", "ARM64" ]'
cmd: |
scripts/build/linux.sh -DBUILD_GLFW=OFF -DBUILD_TBB_FROM_SOURCE=ON -DBUILD_EMBREE_FROM_SOURCE=ON -DBUILD_OPENVKL_FROM_SOURCE=ON -DBUILD_OIDN_FROM_SOURCE=ON
artifact-out: build-ubuntu2204-arm
artifact-path: build/install/ospray build/CMakeCache.txt build/*/build/CMakeCache.txt
### TEST JOBS ###
test-rocky8-gcc-avx2:
needs: build-rocky8-gcc
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
with:
image: rockylinux:8
cmd: |
PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH" scripts/tests/run_tests.sh "$GITHUB_WORKSPACE" AVX2
artifact-in: build-rocky8-gcc
artifact-out: test-rocky8-gcc-avx2
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
artifact-on-failure: true
test-rocky8-gcc-mpi-mpich-avx2:
needs: build-rocky8-mpi-mpich
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
with:
image: rockylinux:8
cmd: |
module load cmake
module load mpi/mpich-x86_64
PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH" scripts/tests/run_tests.sh "$GITHUB_WORKSPACE" AVX2 TEST_MPI
artifact-in: build-rocky8-mpi-mpich
artifact-out: test-rocky8-gcc-mpi-mpich-avx2
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
artifact-on-failure: true
test-rocky8-icx-avx2:
needs: build-rocky8-icx
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
with:
image: rockylinux:8
runs-on: '"avx2"'
cmd: |
PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH" scripts/tests/run_tests.sh "$GITHUB_WORKSPACE" AVX2
artifact-in: build-rocky8-icx
artifact-out: test-rocky8-icx-avx2
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
artifact-on-failure: true
test-rocky8-icx-avx512skx:
needs: build-rocky8-icx
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
with:
image: rockylinux:8
runs-on: '"avx512"'
cmd: |
PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH" scripts/tests/run_tests.sh "$GITHUB_WORKSPACE" AVX512SKX
artifact-in: build-rocky8-icx
artifact-out: test-rocky8-icx-avx512skx
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
artifact-on-failure: true
test-centos8-avx512skx:
needs: build-centos8
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
with:
image: centos:8
runs-on: '"avx512"'
cmd: |
PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH" scripts/tests/run_tests.sh "$GITHUB_WORKSPACE" AVX512SKX
artifact-in: build-centos8
artifact-out: test-centos8-avx512skx
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
artifact-on-failure: true
test-rocky8-oidn-mpi-avx512skx:
needs: build-rocky8-oidn-mpi
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
with:
image: rockylinux:8
runs-on: '"avx512"'
cmd: |
module load cmake/3.15.2
module load mpi/mpich-x86_64
export OIDN_DEFAULT_DEVICE=cpu
PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH" scripts/tests/run_tests.sh "$GITHUB_WORKSPACE" AVX512SKX TEST_MPI
artifact-in: build-rocky8-oidn-mpi
artifact-out: test-rocky8-oidn-mpi-avx512skx
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
artifact-on-failure: true
test-find-ospray:
needs: build-centos8
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
with:
image: centos:8
cmd: |
module load cmake
mkdir buildtut
cd buildtut
cmake -D ospray_DIR=`echo $GITHUB_WORKSPACE/build/install/ospray/lib/cmake/ospray-*` ../apps/ospTutorial/ospTutorialFindospray
cmake --build .
artifact-in: build-centos8
test-ubuntu2404-gcc-avx512skx:
needs: build-ubuntu2404-gcc
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
with:
image: ubuntu:24.04
runs-on: '"avx512"'
cmd: |
PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH" scripts/tests/run_tests.sh "$GITHUB_WORKSPACE" AVX512SKX
artifact-in: build-ubuntu2404-gcc
artifact-out: test-ubuntu2404-gcc-avx512skx
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
artifact-on-failure: true
test-ubuntu2004-gcc-avx2:
needs: build-ubuntu2004-gcc
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
with:
image: ubuntu:20.04
runs-on: '"avx2"'
cmd: |
PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH" scripts/tests/run_tests.sh "$GITHUB_WORKSPACE" AVX2
artifact-in: build-ubuntu2004-gcc
artifact-out: test-ubuntu2004-gcc-avx2
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
artifact-on-failure: true
test-ubuntu2004-gcc-avx512skx:
needs: build-ubuntu2004-gcc
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
with:
image: ubuntu:20.04
runs-on: '"avx512"'
cmd: |
PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH" scripts/tests/run_tests.sh "$GITHUB_WORKSPACE" AVX512SKX TEST_MULTIDEVICE
artifact-in: build-ubuntu2004-gcc
artifact-out: test-ubuntu2004-gcc-avx512skx
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
artifact-on-failure: true
test-ubuntu2204-oidn-mpi-avx2-dg2:
needs: build-ubuntu2204-oidn-mpi
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
secrets: inherit
with:
image: ubuntu:22.04
env-from-files: .github/workflows/dpcpp.env .github/workflows/gfx-ubuntu22.env
submodules: true
options: --device=/dev/dri:/dev/dri
runs-on: '"dg2"'
cmd: |
export PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH"
export OIDN_DEFAULT_DEVICE=sycl
export OIDN_VERBOSE=2
mkdir build_regression_tests
cd build_regression_tests
cmake -D OSPRAY_TEST_ISA=AVX2 $GITHUB_WORKSPACE/test_image_data
cmake --build . --target ospray_test_data
ospTestSuite --baseline-dir=regression_test_baseline --gtest_filter="DenoiserOp.DenoiserOp"
OMPI_ALLOW_RUN_AS_ROOT=1 OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 mpiexec -np 1 ospTestSuite --baseline-dir=regression_test_baseline --gtest_filter="DenoiserOp.DenoiserOp" --osp:load-modules=mpi_offload --osp:device=mpiOffload : -np 2 ospray_mpi_worker
artifact-in: build-ubuntu2204-oidn-mpi
test-ubuntu2204-arm:
needs: build-ubuntu2204-arm
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/perf.yml@main
with:
runs-on: '[ "Linux", "ARM64" ]'
cmd: |
PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH" scripts/tests/run_tests.sh "$GITHUB_WORKSPACE" AVX512SKX
artifact-in: build-ubuntu2204-arm
artifact-out: test-ubuntu2204-arm
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
#artifact-on-failure: true
test-tutorials:
needs: build-centos8
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
with:
image: centos:8
cmd: scripts/tests/run_tutorials.sh
artifact-in: build-centos8
test-mpi-tutorials:
needs: build-rocky8-oidn-mpi
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
with:
image: rockylinux:8
cmd: |
module load cmake/3.15.2
module load mpi/mpich-x86_64
scripts/tests/run_tutorials.sh TEST_MPI
artifact-in: build-rocky8-oidn-mpi
sanitize-cpu:
needs: build-linux-debug
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
with:
image: archlinux:latest
cmd: |
export PATH=$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/build/install/embree/lib:$GITHUB_WORKSPACE/build/install/ospray/lib:$LD_LIBRARY_PATH
export TBB_ENABLE_SANITIZERS=1
scripts/tests/run_tests.sh $GITHUB_WORKSPACE AVX512SKX
artifact-in: build-linux-debug
sanitize-bench:
needs: build-linux-debug
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
with:
image: archlinux:latest
cmd: |
export PATH=$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/build/install/embree/lib:$GITHUB_WORKSPACE/build/install/ospray/lib:$LD_LIBRARY_PATH
export TBB_ENABLE_SANITIZERS=1
build/install/ospray/bin/ospBenchmark --benchmark_min_time=0s
artifact-in: build-linux-debug
sanitize-mpi:
needs: build-linux-debug
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
with:
image: archlinux:latest
cmd: |
export PATH=$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/build/install/embree/lib:$GITHUB_WORKSPACE/build/install/ospray/lib:$LD_LIBRARY_PATH
export TBB_ENABLE_SANITIZERS=1
OMPI_ALLOW_RUN_AS_ROOT=1 OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 scripts/tests/run_tests.sh $GITHUB_WORKSPACE AVX512SKX SKIP_CPU TEST_MPI
artifact-in: build-linux-debug
+89
View File
@@ -0,0 +1,89 @@
## Copyright 2009 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
name: CI MacOS
on:
push:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: read-all
jobs:
### BUILD JOBS ###
build-osx-clang:
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/macos.yml@main
secrets: inherit
with:
runs-on: '["x86_64", "build"]'
cmd: |
scripts/build/macosx.sh -DBUILD_OSPRAY_MODULE_MULTIDEVICE=ON
artifact-out: build-osx-clang
artifact-path: build/install/ospray build/CMakeCache.txt build/*/build/CMakeCache.txt
build-osx-arm:
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/macos.yml@main
secrets: inherit
with:
runs-on: '["arm", "build"]'
cmd: |
scripts/build/macosx.sh -DBUILD_TBB_FROM_SOURCE=ON -DBUILD_OPENVKL_FROM_SOURCE=ON
artifact-out: build-osx-arm
artifact-path: build/install/ospray build/CMakeCache.txt build/*/build/CMakeCache.txt
build-osx-x64-on-arm:
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/macos.yml@main
secrets: inherit
with:
runs-on: '["arm", "build"]'
cmd: |
scripts/build/macosx.sh -DCMAKE_TOOLCHAIN_FILE=../scripts/superbuild/toolchains/macos-rosetta.cmake -DBUILD_TBB_FROM_SOURCE=ON -DBUILD_EMBREE_FROM_SOURCE=ON -DBUILD_OPENVKL_FROM_SOURCE=ON -DBUILD_OIDN_FROM_SOURCE=ON -DBUILD_ISA_AVX=OFF -DBUILD_ISA_AVX2=OFF -DBUILD_ISA_AVX512=OFF
artifact-out: build-osx-x64
artifact-path: build/install/ospray build/CMakeCache.txt build/*/build/CMakeCache.txt
### TEST JOBS ###
test-osx-clang:
needs: build-osx-clang
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/macos.yml@main
with:
runs-on: '["x86_64", "avx2", "build"]'
cmd: |
export PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH"
scripts/tests/run_tests.sh "$GITHUB_WORKSPACE" AVX2 TEST_MULTIDEVICE
artifact-in: build-osx-clang
artifact-out: test-osx-clang
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
artifact-on-failure: true
test-osx-arm:
needs: build-osx-arm
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/macos.yml@main
with:
runs-on: '["arm", "build"]'
cmd: |
export PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH"
scripts/tests/run_tests.sh "$GITHUB_WORKSPACE" AVX512SKX
artifact-in: build-osx-arm
artifact-out: test-osx-arm
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
artifact-on-failure: true
test-osx-x64-on-arm:
needs: build-osx-x64-on-arm
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/macos.yml@main
with:
runs-on: '["arm", "build"]'
cmd: |
export PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH"
scripts/tests/run_tests.sh "$GITHUB_WORKSPACE" AVX512SKX
artifact-in: build-osx-x64
artifact-out: test-osx-x64
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
artifact-on-failure: true
+118
View File
@@ -0,0 +1,118 @@
## Copyright 2023 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
name: CI Windows GPU
on:
push:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: read-all
jobs:
### BUILD JOBS ###
dpcpp-build:
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
secrets: inherit
with:
runs-on: '["build", "mpi"]'
env-from-files: .github/workflows/dpcpp.env
cmd: |
$env:SYCL_BUNDLE_ROOT = $env:DPCPP_ROOT
# disable warnings which lead to excessively large log files
$env:CXXFLAGS = '-w'
$env:CFLAGS = '-w'
scripts\build\win.ps1 -G Ninja -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_C_COMPILER=clang-cl -DBUILD_GPU_SUPPORT=ON -DBUILD_OSPRAY_MODULE_MPI=ON
artifact-out: build-windows-dpcpp
artifact-path: build/install/ospray build/CMakeCache.txt build/ospray/build/CMakeCache.txt
icx-build:
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
secrets: inherit
with:
runs-on: '["build", "mpi"]'
env-from-files: .github/workflows/icx-windows.env
ocloc-version: 77a13ae6-6100-4ddc-b069-0086ff44730c/ocloc_win_101.5082
cmd: |
# disable warnings which lead to excessively large log files
$env:CXXFLAGS = '-w'
$env:CFLAGS = '-w'
scripts\build\win.ps1 -G Ninja -DCMAKE_CXX_COMPILER=icx -DCMAKE_C_COMPILER=icx -DBUILD_GPU_SUPPORT=ON -DBUILD_OSPRAY_MODULE_MPI=ON -DBUILD_EMBREE_FROM_SOURCE=ON -DBUILD_OPENVKL_FROM_SOURCE=ON -DBUILD_OIDN_FROM_SOURCE=ON
artifact-out: build-windows-icx
artifact-path: build/install/ospray build/CMakeCache.txt build/ospray/build/CMakeCache.txt
### TEST JOBS ###
dpcpp-test:
needs: dpcpp-build
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
secrets: inherit
with:
timeout-minutes: 100
runs-on: '"dg2"'
env-from-files: .github/workflows/gfx-windows.env
cmd: |
$env:Path += ";$env:GITHUB_WORKSPACE\build\install\ospray\bin"
scripts\tests\run_gpu_tests.ps1 "$env:GITHUB_WORKSPACE"
artifact-in: build-windows-dpcpp
artifact-out: test-windows-dpcpp
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
artifact-on-failure: true
mpi-dpcpp-test:
needs: dpcpp-build
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
secrets: inherit
with:
timeout-minutes: 100
runs-on: '["dg2"]' # FIXME, "mpi"
env-from-files: .github/workflows/gfx-windows.env
cmd: |
$env:Path += ";C:\Program Files (x86)\Intel\oneAPI\mpi\latest\libfabric\bin\utils;C:\Program Files (x86)\Intel\oneAPI\mpi\latest\libfabric\bin;C:\Program Files (x86)\Intel\oneAPI\mpi\latest\bin\release;C:\Program Files (x86)\Intel\oneAPI\mpi\latest\bin"
$env:Path += ";$env:GITHUB_WORKSPACE\build\install\ospray\bin"
scripts\tests\run_gpu_tests.ps1 "$env:GITHUB_WORKSPACE" SKIP_GPU TEST_MPI
artifact-in: build-windows-dpcpp
artifact-out: test-windows-dpcpp-mpi
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
artifact-on-failure: true
icx-test:
needs: icx-build
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
secrets: inherit
with:
timeout-minutes: 100
runs-on: '"dg2"'
env-from-files: .github/workflows/icx-windows.env .github/workflows/gfx-windows.env
cmd: |
$env:Path += ";$env:GITHUB_WORKSPACE\build\install\ospray\bin"
scripts\tests\run_gpu_tests.ps1 "$env:GITHUB_WORKSPACE"
artifact-in: build-windows-icx
artifact-out: test-windows-icx
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
artifact-on-failure: true
mpi-icx-test:
needs: icx-build
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
secrets: inherit
with:
timeout-minutes: 100
runs-on: '["dg2"]' # FIXME, "mpi"
env-from-files: .github/workflows/icx-windows.env .github/workflows/gfx-windows.env
cmd: |
$env:Path += ";C:\Program Files (x86)\Intel\oneAPI\mpi\latest\libfabric\bin\utils;C:\Program Files (x86)\Intel\oneAPI\mpi\latest\libfabric\bin;C:\Program Files (x86)\Intel\oneAPI\mpi\latest\bin\release;C:\Program Files (x86)\Intel\oneAPI\mpi\latest\bin"
$env:Path += ";$env:GITHUB_WORKSPACE\build\install\ospray\bin"
scripts\tests\run_gpu_tests.ps1 "$env:GITHUB_WORKSPACE" SKIP_GPU TEST_MPI
artifact-in: build-windows-icx
artifact-out: test-windows-icx-mpi
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
artifact-on-failure: true
+114
View File
@@ -0,0 +1,114 @@
## Copyright 2009 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
name: CI Windows
on:
push:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: read-all
jobs:
### BUILD JOBS ###
build-windows-msvc15:
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
secrets: inherit
with:
cmd: |
scripts\build\win.ps1 -G "Visual Studio 15 2017 Win64"
artifact-out: build-windows-msvc15
artifact-path: build/install/ospray build/CMakeCache.txt build/ospray/build/CMakeCache.txt
build-windows-msvc16-mpi_and_md:
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
secrets: inherit
with:
runs-on: '["build", "mpi"]'
cmd: |
scripts\build\win.ps1 -G "Visual Studio 16 2019" -DBUILD_OSPRAY_MODULE_MPI=ON -DBUILD_OSPRAY_MODULE_MULTIDEVICE=ON
artifact-out: build-windows-msvc16-mpi_and_md
artifact-path: build/install/ospray build/CMakeCache.txt build/ospray/build/CMakeCache.txt
build-windows-msvc17:
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
secrets: inherit
with:
cmd: |
scripts\build\win.ps1 -G "Visual Studio 17 2022"
artifact-out: build-windows-msvc17
artifact-path: build/install/ospray build/CMakeCache.txt build/ospray/build/CMakeCache.txt
### TEST JOBS ###
test-windows-msvc15-avx2:
needs: build-windows-msvc15
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
with:
runs-on: '"avx2"'
cmd: |
$env:Path += ";$env:GITHUB_WORKSPACE\build\install\ospray\bin"
scripts\tests\run_tests.ps1 "$env:GITHUB_WORKSPACE" AVX2
artifact-in: build-windows-msvc15
artifact-out: test-windows-msvc15-avx2
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
artifact-on-failure: true
test-windows-msvc15-avx512skx:
needs: build-windows-msvc15
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
with:
runs-on: '"avx512"'
cmd: |
$env:Path += ";$env:GITHUB_WORKSPACE\build\install\ospray\bin"
scripts\tests\run_tests.ps1 "$env:GITHUB_WORKSPACE" AVX512SKX
artifact-in: build-windows-msvc15
artifact-out: test-windows-msvc15-avx512
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
artifact-on-failure: true
test-windows-msvc16-avx2:
needs: build-windows-msvc16-mpi_and_md
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
with:
runs-on: '["avx2", "mpi"]'
cmd: |
$env:Path += ";$env:GITHUB_WORKSPACE\build\install\ospray\bin"
scripts\tests\run_tests.ps1 "$env:GITHUB_WORKSPACE" AVX2 TEST_MULTIDEVICE TEST_MPI
artifact-in: build-windows-msvc16-mpi_and_md
artifact-out: test-windows-msvc16-mpi_and_md-avx2
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
artifact-on-failure: true
test-windows-msvc16-avx512skx:
needs: build-windows-msvc16-mpi_and_md
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
with:
runs-on: '["avx512", "mpi"]'
cmd: |
$env:Path += ";$env:GITHUB_WORKSPACE\build\install\ospray\bin"
echo $env:Path
scripts\tests\run_tests.ps1 "$env:GITHUB_WORKSPACE" AVX512SKX TEST_MULTIDEVICE TEST_MPI
artifact-in: build-windows-msvc16-mpi_and_md
artifact-out: test-windows-msvc16-mpi_and_md-avx512skx
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
artifact-on-failure: true
test-windows-msvc17:
needs: build-windows-msvc17
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
with:
runs-on: '"avx512"'
cmd: |
$env:Path += ";$env:GITHUB_WORKSPACE\build\install\ospray\bin"
scripts\tests\run_tests.ps1 "$env:GITHUB_WORKSPACE" AVX512SKX
artifact-in: build-windows-msvc17
artifact-out: test-windows-msvc17-avx512
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
artifact-on-failure: true
+1
View File
@@ -0,0 +1 @@
DPCPP_VERSION=intel-llvm/nightly-2023-10-26-rk
+1
View File
@@ -0,0 +1 @@
GFX_DRIVER_VERSION=linux-latest
+1
View File
@@ -0,0 +1 @@
GFX_DRIVER_VERSION=windows-101.5445
+1
View File
@@ -0,0 +1 @@
DPCPP_VERSION=intel/2024.1.0
+1
View File
@@ -0,0 +1 @@
DPCPP_VERSION=oneAPI/compiler/2024.1
+162
View File
@@ -0,0 +1,162 @@
## Copyright 2024 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
name: public CI Linux
on:
push:
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
generate-baseline-images:
runs-on: ubuntu-latest
container:
image: ubuntu:22.04
steps:
- name: Install packages
run: |
echo "Installing build dependencies..."
apt update
apt upgrade -y
apt install -y build-essential cmake ninja-build libglfw3-dev libgl1-mesa-dev libxinerama-dev libxcursor-dev libxi-dev git
- name: Checkout Repository
uses: actions/checkout@v4
- name: Generate baseline images
run: |
git config --global --add safe.directory `pwd`
mkdir build_regression_tests
cd build_regression_tests
cmake ../test_image_data
cmake --build . --target ospray_test_data --parallel 8
- name: Upload baseline images
uses: actions/upload-artifact@v4
with:
name: baseline-images
path: |
build_regression_tests/regression_test_baseline/*.png
build_regression_tests/regression_test_baseline/*.exr
build_regression_tests/regression_test_baseline/*.jpg
compression-level: 1
build-rocky-8:
runs-on: ubuntu-latest
container:
image: rockylinux:8
steps:
- name: Install packages
run: |
echo "Installing build dependencies..."
dnf update -y
dnf install -y git cmake mesa-libGL-devel libXrandr-devel libXinerama-devel libXcursor-devel libXi-devel
dnf group install -y "Development Tools"
- name: Checkout Repository
uses: actions/checkout@v4
- name: Build
run: |
git config --global --add safe.directory `pwd`
mkdir build
cd build
cmake ../scripts/superbuild
cmake --build . --parallel 8
- name: Upload build
uses: actions/upload-artifact@v4
with:
name: build-rocky-8
path: build/install/ospray
test-rocky-8:
needs: [build-rocky-8, generate-baseline-images]
runs-on: ubuntu-latest
container:
image: rockylinux:8
steps:
- name: Download build
uses: actions/download-artifact@v4
with:
name: build-rocky-8
- name: Download baseline images
uses: actions/download-artifact@v4
with:
name: baseline-images
path: regression_test_baseline
- name: Run tests
run: |
chmod +x ./bin/*
./bin/ospTutorial
./bin/ospTestSuite
build-ubuntu-2204:
runs-on: ubuntu-latest
container:
image: ubuntu:22.04
steps:
- name: Install packages
run: |
echo "Installing build dependencies..."
apt update
apt upgrade -y
apt install -y build-essential cmake ninja-build libglfw3-dev libgl1-mesa-dev libxinerama-dev libxcursor-dev libxi-dev git
- name: Checkout Repository
uses: actions/checkout@v4
- name: Build
run: |
git config --global --add safe.directory `pwd`
mkdir build
cd build
cmake ../scripts/superbuild
cmake --build . --parallel 8
- name: Upload build
uses: actions/upload-artifact@v4
with:
name: build-ubuntu-2204
path: build/install/ospray
test-ubuntu-2204:
needs: [build-ubuntu-2204, generate-baseline-images]
runs-on: ubuntu-latest
container:
image: ubuntu:22.04
steps:
- name: Download build
uses: actions/download-artifact@v4
with:
name: build-ubuntu-2204
- name: Download baseline images
uses: actions/download-artifact@v4
with:
name: baseline-images
path: regression_test_baseline
- name: Run tests
run: |
chmod +x ./bin/*
./bin/ospTutorial
./bin/ospTestSuite
+536
View File
@@ -0,0 +1,536 @@
## Copyright 2009 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
name: Release
on:
push:
branches:
- devel
- '**release**'
- master
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: read-all
jobs:
### DOC JOBS ###
pdf:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
with:
image: ospray/docker-images:docu
submodules: true
cmd: |
cd doc
git clone --depth 1 -b release-2.12.x https://${RENDERKIT_GITHUB_TOKEN}@github.com/intel-innersource/documentation.graphics.renderkit.ospray-website.git ospray-doc
make pdf
make checklinks
artifact-out: pdf
artifact-path: readme.pdf
### BUILD JOBS ###
release-linux:
needs: pdf
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
secrets: inherit
with:
image: rockylinux:8
env-from-files: .github/workflows/dpcpp.env
cmd: |
module load cmake/3.25.3
module load mpi/mpich-x86_64
export CC=clang
export CXX=clang++
scripts/release/linux.sh
cp build_release/*.gz $STORAGE_PATH/packages/renderkit/ || true
artifact-in: pdf
artifact-out: release-linux
artifact-path: build_release/*.gz
release-linux-arm:
needs: pdf
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/perf.yml@main
secrets: inherit
with:
runs-on: '[ "Linux", "ARM64" ]'
env-from-files: .github/workflows/dpcpp.env
cmd: |
scripts/release/linux.sh -DBUILD_GLFW=OFF -DBUILD_TBB_FROM_SOURCE=ON -DBUILD_EMBREE_FROM_SOURCE=ON -DBUILD_OPENVKL_FROM_SOURCE=ON -DBUILD_OIDN_FROM_SOURCE=ON
cp build_release/*.gz $STORAGE_PATH/packages/renderkit/ || true
artifact-in: pdf
artifact-out: release-linux-arm
artifact-path: build_release/*.gz
release-osx:
needs: pdf
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/macos.yml@main
with:
runs-on: '["sign", "x86_64"]'
cmd: |
export CC=clang
export CXX=clang++
scripts/release/macosx.sh
cp build_release/*.zip $STORAGE_PATH/packages/renderkit/ || true
artifact-in: pdf
artifact-out: release-osx
artifact-path: build_release/*.zip
release-osx-arm:
needs: pdf
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/macos.yml@main
with:
runs-on: '["arm", "build"]'
cmd: |
scripts/release/macosx.sh -DBUILD_TBB_FROM_SOURCE=ON -DBUILD_OPENVKL_FROM_SOURCE=ON
cp build_release/*.zip $STORAGE_PATH/packages/renderkit/ || true
artifact-in: pdf
artifact-out: release-osx-arm
artifact-path: build_release/*.zip
release-windows:
needs: pdf
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
secrets: inherit
with:
runs-on: '["build", "mpi"]'
env-from-files: .github/workflows/dpcpp.env
cmd: |
$env:SYCL_BUNDLE_ROOT = $env:DPCPP_ROOT
# disable warnings which lead to excessively large log files
$env:CXXFLAGS = '-w'
$env:CFLAGS = '-w'
$exitCode = 0 # keep job status to properly fail
scripts\release\win.ps1 -G Ninja -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_C_COMPILER=clang-cl
if ($LastExitCode) { $exitCode++ }
& $env:SIGN_FILE_WINDOWS ospray*.msi
if ($LastExitCode) { $exitCode++ }
cp (Get-ChildItem *.zip | Select-Object -Expand FullName) $env:STORAGE_PATH/packages/renderkit/
cp (Get-ChildItem *.msi | Select-Object -Expand FullName) $env:STORAGE_PATH/packages/renderkit/
exit $exitCode
artifact-in: pdf
artifact-out: release-windows
artifact-path: "build_release/ospray*.zip build_release/ospray*.msi"
### SCAN JOBS ###
static-analysis:
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/static_analysis.yml@main
with:
coverity: true
project: OSPRay
prebuild: >
module load impi/latest &&
echo "Configure dependencies" &&
cmake -L -S scripts/superbuild -B build_deps -DBUILD_DEPENDENCIES_ONLY=ON -DBUILD_EMBREE_FROM_SOURCE=ON -DBUILD_OPENVKL_FROM_SOURCE=ON -DBUILD_OIDN_FROM_SOURCE=ON -DBUILD_OSPRAY_MODULE_MPI=ON -DINSTALL_IN_SEPARATE_DIRECTORIES=OFF -DBUILD_ISA_AVX512=OFF &&
echo "Build dependencies" &&
cmake --build build_deps &&
INSTALL_DIR=$(pwd)/build_deps/install &&
export CMAKE_PREFIX_PATH=${INSTALL_DIR} &&
echo "Configure OSPRay" &&
cmake -L -S . -B build -DTBB_ROOT=$INSTALL_DIR -DOSPRAY_MODULE_DENOISER=ON -DOSPRAY_MODULE_BILINEAR_PATCH=ON -DOSPRAY_MODULE_MPI=ON &&
echo "Done: Configure OSPRay"
build: cmake --build build
binary-analysis:
needs:
- release-linux
- release-osx
- release-windows
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/binary_analysis.yml@main
with:
project: ospray
artifact-in-linux: release-linux
artifact-in-macos: release-osx
artifact-in-windows: release-windows
path: build_release/ospray-*
binary-analysis-arm:
needs:
- release-linux-arm
- release-osx-arm
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/binary_analysis.yml@main
with:
project: ospray
artifact-in-linux: release-linux-arm
artifact-in-macos: release-osx-arm
path: build_release/ospray-*
artifact-out-name: binary-analysis-arm
antivirus-scan:
needs:
- release-linux
- release-osx
- release-windows
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/antivirus_scan.yml@main
with:
project: ospray
artifact-in-linux: release-linux
artifact-in-macos: release-osx
artifact-in-windows: release-windows
path: build_release/ospray-*
antivirus-scan-arm:
needs:
- release-linux-arm
- release-osx-arm
secrets: inherit
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/antivirus_scan.yml@main
with:
project: ospray
artifact-in-linux: release-linux-arm
artifact-in-macos: release-osx-arm
path: build_release/ospray-*
artifact-out-name: antivirus-scan-arm
### TEST JOBS ###
test-rocky-cpu:
needs: release-linux
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
with:
image: rockylinux:8
cmd: |
module load cmake/3.15.2
tar -xzf build_release/*.gz
export PATH=$GITHUB_WORKSPACE/$(ls -d1 ./ospray-*/bin):$PATH
scripts/tests/run_tests.sh $GITHUB_WORKSPACE AVX512SKX
artifact-in: release-linux
test-rocky-mpi-cpu:
needs: release-linux
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
with:
image: rockylinux:8
cmd: |
module load cmake/3.15.2
module load mpi/mpich-x86_64
tar -xzf build_release/*.gz
export PATH=$GITHUB_WORKSPACE/$(ls -d1 ./ospray-*/bin):$PATH
scripts/tests/run_tests.sh $GITHUB_WORKSPACE AVX512SKX SKIP_CPU TEST_MPI
artifact-in: release-linux
test-ubuntu-oidnsycl:
needs: release-linux
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
secrets: inherit
with:
timeout-minutes: 100
image: ubuntu:22.04
env-from-files: .github/workflows/gfx-ubuntu22.env
options: --device=/dev/dri:/dev/dri
runs-on: '"dg2"'
cmd: |
module load cmake/3.15.2
tar -xzf build_release/*.gz
export PATH=$GITHUB_WORKSPACE/$(ls -d1 ./ospray-*/bin):$PATH
export OIDN_DEFAULT_DEVICE=sycl
export OIDN_VERBOSE=2
mkdir build_regression_tests
cd build_regression_tests
cmake -G Ninja -D OSPRAY_TEST_ISA=AVX2 $GITHUB_WORKSPACE/test_image_data
cmake --build . --target ospray_test_data
ospTestSuite --baseline-dir=regression_test_baseline --gtest_filter="DenoiserOp.DenoiserOp"
artifact-in: release-linux
test-ubuntu-cpu:
needs: release-linux
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
with:
image: ubuntu:22.04
cmd: |
tar -xzf build_release/*.gz
export OIDN_VERBOSE=2
export PATH=$GITHUB_WORKSPACE/$(ls -d1 ./ospray-*/bin):$PATH
scripts/tests/run_tests.sh $GITHUB_WORKSPACE AVX512SKX
artifact-in: release-linux
test-ubuntu-mpi-cpu:
needs: release-linux
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
with:
image: ubuntu:22.04
cmd: |
tar -xzf build_release/*.gz
update-alternatives --set mpi-x86_64-linux-gnu /usr/include/x86_64-linux-gnu/mpich
update-alternatives --set mpirun /usr/bin/mpirun.mpich
OSPDIR=$GITHUB_WORKSPACE/$(ls -d1 ./ospray-*/)
ln -s /usr/lib/x86_64-linux-gnu/libmpich.so.12 $OSPDIR/lib/libmpi.so.12 # XXX find better way
ln -s /usr/lib/x86_64-linux-gnu/libmpichcxx.so.12 $OSPDIR/lib/libmpicxx.so.12
export OIDN_VERBOSE=2
export PATH=$OSPDIR/bin:$PATH
scripts/tests/run_tests.sh $GITHUB_WORKSPACE AVX512SKX SKIP_CPU TEST_MPI
artifact-in: release-linux
test-ubuntu-dg2:
needs: release-linux
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
with:
timeout-minutes: 100
image: ubuntu:22.04
runs-on: '"dg2"'
env-from-files: .github/workflows/gfx-ubuntu22.env
options: --device=/dev/dri:/dev/dri
cmd: |
tar -xzf build_release/*.gz
export PATH=$GITHUB_WORKSPACE/$(ls -d1 ./ospray-*/bin):$PATH
scripts/tests/run_gpu_tests.sh $GITHUB_WORKSPACE
artifact-in: release-linux
test-ubuntu-mpi-dg2:
needs: release-linux
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
with:
timeout-minutes: 100
image: ubuntu:22.04
runs-on: '"dg2"'
env-from-files: .github/workflows/gfx-ubuntu22.env
options: --device=/dev/dri:/dev/dri
cmd: |
tar -xzf build_release/*.gz
update-alternatives --set mpi-x86_64-linux-gnu /usr/include/x86_64-linux-gnu/mpich
update-alternatives --set mpirun /usr/bin/mpirun.mpich
OSPDIR=$GITHUB_WORKSPACE/$(ls -d1 ./ospray-*/)
ln -s /usr/lib/x86_64-linux-gnu/libmpich.so.12 $OSPDIR/lib/libmpi.so.12 # XXX find better way
ln -s /usr/lib/x86_64-linux-gnu/libmpichcxx.so.12 $OSPDIR/lib/libmpicxx.so.12
export OIDN_VERBOSE=2
export PATH=$OSPDIR/bin:$PATH
scripts/tests/run_gpu_tests.sh $GITHUB_WORKSPACE SKIP_GPU TEST_MPI
artifact-in: release-linux
test-ubuntu-pvc:
needs: release-linux
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
with:
timeout-minutes: 100
image: ubuntu:22.04
runs-on: '"pvc"'
env-from-files: .github/workflows/gfx-ubuntu22.env
options: --device=/dev/dri:/dev/dri
cmd: |
tar -xzf build_release/*.gz
export PATH=$GITHUB_WORKSPACE/$(ls -d1 ./ospray-*/bin):$PATH
scripts/tests/run_gpu_tests.sh $GITHUB_WORKSPACE
artifact-in: release-linux
test-ubuntu-mpi-pvc:
needs: release-linux
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
with:
timeout-minutes: 100
image: ubuntu:22.04
runs-on: '"pvc"'
env-from-files: .github/workflows/gfx-ubuntu22.env
options: --device=/dev/dri:/dev/dri
cmd: |
tar -xzf build_release/*.gz
update-alternatives --set mpi-x86_64-linux-gnu /usr/include/x86_64-linux-gnu/mpich
update-alternatives --set mpirun /usr/bin/mpirun.mpich
OSPDIR=$GITHUB_WORKSPACE/$(ls -d1 ./ospray-*/)
ln -s /usr/lib/x86_64-linux-gnu/libmpich.so.12 $OSPDIR/lib/libmpi.so.12 # XXX find better way
ln -s /usr/lib/x86_64-linux-gnu/libmpichcxx.so.12 $OSPDIR/lib/libmpicxx.so.12
export OIDN_VERBOSE=2
export PATH=$OSPDIR/bin:$PATH
scripts/tests/run_gpu_tests.sh $GITHUB_WORKSPACE SKIP_GPU TEST_MPI
artifact-in: release-linux
test-ubuntu-cpu-arm:
needs: release-linux-arm
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/perf.yml@main
with:
runs-on: '[ "Linux", "ARM64" ]'
cmd: |
tar -xzf build_release/*.gz
export OIDN_VERBOSE=2
export PATH=$GITHUB_WORKSPACE/$(ls -d1 ./ospray-*/bin):$PATH
scripts/tests/run_tests.sh $GITHUB_WORKSPACE AVX512SKX
artifact-in: release-linux-arm
test-ubuntu-mpi-cpu-arm:
needs: release-linux-arm
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/perf.yml@main
with:
runs-on: '[ "Linux", "ARM64" ]'
cmd: |
tar -xzf build_release/*.gz
export OIDN_VERBOSE=2
export PATH=$GITHUB_WORKSPACE/$(ls -d1 ./ospray-*/bin):$PATH
scripts/tests/run_tests.sh $GITHUB_WORKSPACE AVX512SKX SKIP_CPU TEST_MPI
artifact-in: release-linux-arm
test-osx-avx2:
needs: release-osx
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/macos.yml@main
with:
runs-on: '["x86_64", "build", "avx2"]'
cmd: |
unzip build_release/*.zip
export PATH=$GITHUB_WORKSPACE/$(ls -d1 ./ospray-*/bin):$PATH
scripts/tests/run_tests.sh $GITHUB_WORKSPACE AVX2
artifact-in: release-osx
test-osx-avx512:
needs: release-osx
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/macos.yml@main
with:
runs-on: '["x86_64", "build", "avx512"]'
cmd: |
unzip build_release/*.zip
export PATH=$GITHUB_WORKSPACE/$(ls -d1 ./ospray-*/bin):$PATH
scripts/tests/run_tests.sh $GITHUB_WORKSPACE AVX512SKX
artifact-in: release-osx
test-osx-arm:
needs: release-osx-arm
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/macos.yml@main
with:
runs-on: '["arm", "build"]'
cmd: |
unzip build_release/*.zip
export PATH=$GITHUB_WORKSPACE/$(ls -d1 ./ospray-*/bin):$PATH
scripts/tests/run_tests.sh $GITHUB_WORKSPACE AVX512SKX
artifact-in: release-osx-arm
test-osx-signing:
needs: release-osx
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/macos.yml@main
secrets: inherit
with:
runs-on: '["sign", "x86_64" ]'
cmd: |
unzip build_release/*.zip
sign-path-verify: ospray-*
artifact-in: release-osx
test-osx-signing-arm:
needs: release-osx-arm
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/macos.yml@main
secrets: inherit
with:
runs-on: '"arm"'
cmd: |
unzip build_release/*.zip
sign-path-verify: ospray-*
artifact-in: release-osx-arm
test-windows-signing:
needs: release-windows
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
with:
cmd: |
$exitCode = 0 # keep job status to properly fail
Expand-Archive build_release/*.zip -DestinationPath .
if ($LastExitCode) { $exitCode++ }
$msiFile = (Get-ChildItem build_release/*.msi | Select-Object -Expand FullName)
Start-Process msiexec "/a $msiFile /qn TARGETDIR=$env:GITHUB_WORKSPACE" -Wait
if ($LastExitCode) { $exitCode++ }
& $env:SIGN_FILE_WINDOWS -t build_release\*.msi (Get-ChildItem "Intel\OSPRay*\bin\*" | Select-Object -Expand FullName) (Get-ChildItem "ospray-*\bin\*" | Select-Object -Expand FullName)
if ($LastExitCode) { $exitCode++ }
exit $exitCode
artifact-in: release-windows
test-windows-cpu:
needs: release-windows
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
with:
runs-on: '"avx512"'
cmd: |
$exitCode = 0 # keep job status to properly fail
Expand-Archive build_release/*.zip -DestinationPath .
if ($LastExitCode) { $exitCode++ }
$env:Path += ";" + (Get-ChildItem ospray-*\bin | Select-Object -Expand FullName)
scripts\tests\run_tests.ps1 $env:GITHUB_WORKSPACE AVX512SKX
if ($LastExitCode) { $exitCode++ }
exit $exitCode
artifact-in: release-windows
test-windows-mpi-cpu:
needs: release-windows
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
with:
runs-on: '["avx512", "mpi"]'
cmd: |
$exitCode = 0 # keep job status to properly fail
Expand-Archive build_release/*.zip -DestinationPath .
if ($LastExitCode) { $exitCode++ }
$env:Path += ";" + (Get-ChildItem ospray-*\bin | Select-Object -Expand FullName)
scripts\tests\run_tests.ps1 $env:GITHUB_WORKSPACE AVX512SKX SKIP_CPU TEST_MPI
if ($LastExitCode) { $exitCode++ }
exit $exitCode
artifact-in: release-windows
test-windows-oidnsycl:
needs: release-windows
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
secrets: inherit
with:
timeout-minutes: 100
runs-on: '"dg2"'
env-from-files: .github/workflows/gfx-windows.env
cmd: |
$exitCode = 0 # keep job status to properly fail
Expand-Archive build_release/*.zip -DestinationPath .
if ($LastExitCode) { $exitCode++ }
$env:Path += ";" + (Get-ChildItem ospray-*\bin | Select-Object -Expand FullName)
$env:OIDN_DEFAULT_DEVICE="sycl"
$env:OIDN_VERBOSE="2"
md build_regression_tests
cd build_regression_tests
cmake -G Ninja -D OSPRAY_TEST_ISA=AVX2 $env:GITHUB_WORKSPACE\test_image_data
if ($LastExitCode) { $exitCode++ }
cmake --build . --config Release --target ospray_test_data
if ($LastExitCode) { $exitCode++ }
ospTestSuite.exe --baseline-dir=regression_test_baseline --gtest_filter="DenoiserOp.DenoiserOp"
if ($LastExitCode) { $exitCode++ }
exit $exitCode
artifact-in: release-windows
test-windows-dg2:
needs: release-windows
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
with:
timeout-minutes: 100
runs-on: '"dg2"'
env-from-files: .github/workflows/gfx-windows.env
cmd: |
$exitCode = 0 # keep job status to properly fail
$env:Path += ";C:\Program Files (x86)\Intel\oneAPI\mpi\latest\libfabric\bin\utils;C:\Program Files (x86)\Intel\oneAPI\mpi\latest\libfabric\bin;C:\Program Files (x86)\Intel\oneAPI\mpi\latest\bin\release;C:\Program Files (x86)\Intel\oneAPI\mpi\latest\bin"
Expand-Archive build_release/*.zip -DestinationPath .
if ($LastExitCode) { $exitCode++ }
$env:Path += ";" + (Get-ChildItem ospray-*\bin | Select-Object -Expand FullName)
scripts\tests\run_gpu_tests.ps1 $env:GITHUB_WORKSPACE
if ($LastExitCode) { $exitCode++ }
exit $exitCode
artifact-in: release-windows
test-windows-mpi-dg2:
needs: release-windows
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
with:
timeout-minutes: 100
runs-on: '"dg2"' # FIXME: mpi
env-from-files: .github/workflows/gfx-windows.env
cmd: |
$exitCode = 0 # keep job status to properly fail
$env:Path += ";C:\Program Files (x86)\Intel\oneAPI\mpi\latest\libfabric\bin\utils;C:\Program Files (x86)\Intel\oneAPI\mpi\latest\libfabric\bin;C:\Program Files (x86)\Intel\oneAPI\mpi\latest\bin\release;C:\Program Files (x86)\Intel\oneAPI\mpi\latest\bin"
Expand-Archive build_release/*.zip -DestinationPath .
if ($LastExitCode) { $exitCode++ }
$env:Path += ";" + (Get-ChildItem ospray-*\bin | Select-Object -Expand FullName)
scripts\tests\run_gpu_tests.ps1 $env:GITHUB_WORKSPACE SKIP_GPU TEST_MPI
if ($LastExitCode) { $exitCode++ }
exit $exitCode
artifact-in: release-windows
+107
View File
@@ -0,0 +1,107 @@
## Copyright 2009 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
name: Scheduled
on:
schedule:
- cron: '30 0 * * *'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: read-all
jobs:
### BUILD JOBS ###
build-arch-clang-devel:
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
secrets: inherit
with:
image: archlinux:latest
cmd: |
export CC=clang
export CXX=clang++
scripts/build/linux.sh -G Ninja -DBUILD_GLFW=OFF -DBUILD_OSPRAY_CI_EXTRAS=ON -DBUILD_EMBREE_FROM_SOURCE=ON -DBUILD_OPENVKL_FROM_SOURCE=ON -DEMBREE_VERSION=devel -DBUILD_OIDN_FROM_SOURCE=ON -DOIDN_VERSION=devel -DOPENVKL_VERSION=devel -DRKCOMMON_VERSION=devel
build-linux-debug-all:
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
secrets: inherit
with:
image: archlinux:latest
cmd: |
export CC=clang
export CXX=clang++
scripts/build/linux.sh -G Ninja -DCMAKE_BUILD_TYPE=Debug -DDEPENDENCIES_BUILD_TYPE=Debug -DBUILD_GLFW=OFF -DBUILD_OSPRAY_CI_EXTRAS=ON -DBUILD_EMBREE_FROM_SOURCE=ON -DBUILD_OPENVKL_FROM_SOURCE=ON -DBUILD_OIDN=OFF -DBUILD_OSPRAY_MODULE_MPI=ON -DBUILD_OSPRAY_MODULE_MULTIDEVICE=ON
artifact-out: build-linux-debug-all
artifact-path: build/install/ospray build/CMakeCache.txt build/*/build/CMakeCache.txt
# build-mpi-cluster:
# with:
# runs-on: '["Cluster", "build"]'
# script:
# - module load cmake
# - module load impi
# - module load gnu
# - scripts/build/linux.sh -DBUILD_OSPRAY_MODULE_MPI=ON -DOSPRAY_BUILD_GLM=OFF -DBUILD_OSPRAY_MODULE_MULTIDEVICE=ON
# <<: *build_artifacts
build-windows-debug-all:
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
secrets: inherit
with:
runs-on: '["build", "NAS", "mpi"]'
cmd: |
scripts\build\win.ps1 -G "Visual Studio 17 2022" -buildType Debug -DBUILD_OSPRAY_CI_EXTRAS=ON -DBUILD_EMBREE_FROM_SOURCE=ON -DBUILD_OPENVKL_FROM_SOURCE=ON -DBUILD_ISA_AVX512=OFF -DBUILD_OIDN=OFF -DBUILD_OSPRAY_MODULE_MPI=ON -DBUILD_OSPRAY_MODULE_MULTIDEVICE=ON
artifact-out: build-windows-debug-all
artifact-path: build/install/ospray build/CMakeCache.txt build/ospray/build/CMakeCache.txt
build-windows-no-volume:
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
secrets: inherit
with:
cmd: |
scripts\build\win.ps1 -G "Visual Studio 17 2022" -DBUILD_ISA_AVX=OFF -DOSPRAY_BUILD_ISA=AVX2 -DBUILD_OPENVKL=OFF
### TEST JOBS ###
test-linux-debug-all:
needs: build-linux-debug-all
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/docker.yml@main
with:
image: archlinux:latest
runs-on: '"avx512"'
cmd: |
PATH="$GITHUB_WORKSPACE/build/install/ospray/bin:$PATH" scripts/tests/run_tests.sh "$GITHUB_WORKSPACE" AVX512SKX
artifact-in: build-linux-debug-all
artifact-out: test-linux-debug-all
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
artifact-on-failure: true
# test-mpi-cluster:
# <<: *test_job_unix_avx512skx
# tags: [cluster]
# script:
# - module load impi
# - module load gnu
# - LD_LIBRARY_PATH="$CI_PROJECT_DIR/build/install/ospray/lib:$LD_LIBRARY_PATH" PATH="$CI_PROJECT_DIR/build/install/ospray/bin:$PATH" scripts/tests/run_tests.sh "$CI_PROJECT_DIR" AVX512SKX TEST_MPI TEST_MULTIDEVICE
# env:
# needs: build-mpi-cluster
# needs: ${{ env.needs }}
test-windows-debug-all:
needs: build-windows-debug-all
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
with:
runs-on: '"avx2"'
cmd: |
$env:Path += ";$env:GITHUB_WORKSPACE\build\install\ospray\bin"
scripts\tests\run_tests.ps1 "$env:GITHUB_WORKSPACE" AVX2
artifact-in: build-windows-debug-all
artifact-out: test-windows-debug-all-avx2
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
artifact-on-failure: true
+7 -3
View File
@@ -2,7 +2,7 @@
*#
bin
*.user*
build*
/build*
install*
*.sw?
tags
@@ -23,12 +23,16 @@ ispc
readme.pdf
!/modules
/modules/*
!/modules/pluggableGeometryExample
!/modules/simdGeometryExample
!/modules/cpu
!/modules/denoiser
!/modules/mpi
!/modules/multiDevice
!/modules/pluggableGeometryExample
!/modules/simdGeometryExample
*.vim
.idea/
premake.local.*
cmake-build*/
.clangd
compile_commands.json
.cache/
-736
View File
@@ -1,736 +0,0 @@
## Copyright 2009-2021 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
stages:
- build
- docu
- test
- benchmark
- scan1
- scan2
- release
- scan3
- mirror
variables:
GIT_DEPTH: "15"
KW_PROJECT_NAME: ospray
ErrorActionPreference: STOP
.job_template: &build_job_docker
stage: build
tags: [docker]
image: $DOCKER_REGISTRY/ospray/docker-images:arch # default image
script:
- scripts/build_gitlab/linux.sh
.job_template: &build_job_docker_modules
stage: build
tags:
- docker
- modules
image: $DOCKER_REGISTRY/ospray/docker-images:centos7-mod
script:
- scripts/build_gitlab/linux.sh
.job_template: &build_artifacts
artifacts:
paths:
- build/install/ospray
- build/CMakeCache.txt
- build/*/build/CMakeCache.txt
expire_in: 3 day
.job_template: &build_artifacts_all
artifacts:
paths:
- build/install
- build/CMakeCache.txt
- build/*/build/CMakeCache.txt
expire_in: 3 day
.job_template: &release_job
stage: release
needs: [pdf]
only:
- devel
- master
- /release/
.job_template: &test_job
stage: test
tags: [docker]
artifacts:
paths:
- build_regression_tests/tests*.xml
- build_regression_tests/failed*
expire_in: 1 week
when: always
.job_template: &test_job_unix_avx2
<<: *test_job
tags: [docker, avx2]
script:
- LD_LIBRARY_PATH="$CI_PROJECT_DIR/build/install/ospray/lib:$LD_LIBRARY_PATH" PATH="$CI_PROJECT_DIR/build/install/ospray/bin:$PATH" scripts/tests/run_tests.sh "$CI_PROJECT_DIR" AVX2
.job_template: &test_job_unix_avx512skx
<<: *test_job
tags: [docker, avx512vl]
script:
- LD_LIBRARY_PATH="$CI_PROJECT_DIR/build/install/ospray/lib:$LD_LIBRARY_PATH" PATH="$CI_PROJECT_DIR/build/install/ospray/bin:$PATH" scripts/tests/run_tests.sh "$CI_PROJECT_DIR" AVX512SKX
.job_template: &test_job_unix_mpi_avx2
<<: *test_job
tags: [docker, avx2, modules]
script:
- LD_LIBRARY_PATH="$CI_PROJECT_DIR/build/install/ospray/lib:$LD_LIBRARY_PATH" PATH="$CI_PROJECT_DIR/build/install/ospray/bin:$PATH" scripts/tests/run_tests.sh "$CI_PROJECT_DIR" AVX2 TEST_MPI
.job_template: &test_job_unix_sanitize
<<: *test_job
tags: [docker, avx512vl]
script:
- export LSAN_OPTIONS="suppressions=$CI_PROJECT_DIR/scripts/tests/sanitize_ignore.txt"
- export LD_LIBRARY_PATH="$CI_PROJECT_DIR/build/install/ospray/lib:$LD_LIBRARY_PATH"
- PATH="$CI_PROJECT_DIR/build/install/ospray/bin:$PATH" scripts/tests/run_tests.sh "$CI_PROJECT_DIR" AVX512SKX
- build/install/ospray/bin/ospBenchmark --benchmark_min_time=0
.job_template: &test_job_windows_avx2
<<: *test_job
script:
- $env:Path += ";$CI_PROJECT_DIR\build\install\ospray\bin"
- scripts\tests\run_tests.ps1 "$CI_PROJECT_DIR" AVX2
.job_template: &test_job_windows_avx512skx
<<: *test_job
script:
- $env:Path += ";$CI_PROJECT_DIR\build\install\ospray\bin"
- scripts\tests\run_tests.ps1 "$CI_PROJECT_DIR" AVX512SKX
.job_template: &benchmark_job
stage: benchmark
when: manual
script:
- scripts/tests/run-benchmarks.sh
### BUILD JOBS ###
build-arch-gcc:
<<: *build_job_docker
script:
- scripts/build_gitlab/linux.sh -G Ninja -DBUILD_GLFW=OFF
build-arch-clang:
<<: *build_job_docker
script:
- export CC=clang
- export CXX=clang++
- scripts/build_gitlab/linux.sh -G Ninja -DBUILD_GLFW=OFF
build-arch-gcc-extras:
<<: *build_job_docker
script:
- scripts/build_gitlab/linux.sh -G Ninja -DBUILD_GLFW=OFF -DBUILD_OSPRAY_CI_EXTRAS=ON -DBUILD_OIDN=ON
build-arch-clang-extras:
<<: *build_job_docker
script:
- export CC=clang
- export CXX=clang++
- scripts/build_gitlab/linux.sh -G Ninja -DBUILD_GLFW=OFF -DBUILD_OSPRAY_CI_EXTRAS=ON -DBUILD_OIDN=ON
build-arch-clang-devel:
<<: *build_job_docker
script:
- export CC=clang
- export CXX=clang++
- scripts/build_gitlab/linux.sh -G Ninja -DBUILD_GLFW=OFF -DBUILD_OSPRAY_CI_EXTRAS=ON -DBUILD_EMBREE_FROM_SOURCE=ON -DEMBREE_VERSION=devel -DBUILD_OIDN=ON -DBUILD_OIDN_FROM_SOURCE=ON -DOIDN_VERSION=devel -DOPENVKL_VERSION=devel -DRKCOMMON_VERSION=devel
only: [schedules]
build-linux-debug-all:
<<: *build_job_docker
script:
- export CC=clang
- export CXX=clang++
- scripts/build_gitlab/linux.sh -G Ninja -DCMAKE_BUILD_TYPE=Debug -DDEPENDENCIES_BUILD_TYPE=Debug -DBUILD_GLFW=OFF -DBUILD_OSPRAY_CI_EXTRAS=ON -DBUILD_EMBREE_FROM_SOURCE=ON -DBUILD_OIDN=ON -DBUILD_OIDN_FROM_SOURCE=ON -DBUILD_OSPRAY_MODULE_MPI=ON -DBUILD_OSPRAY_MODULE_MULTIDEVICE=ON
<<: *build_artifacts
only: [schedules]
build-ubuntu1604-gcc:
<<: *build_job_docker
image: $DOCKER_REGISTRY/ospray/docker-images:ubuntu16.04
script:
- scripts/build_gitlab/linux.sh -G Ninja
<<: *build_artifacts
build-ubuntu1804-gcc:
<<: *build_job_docker
image: $DOCKER_REGISTRY/ospray/docker-images:ubuntu18.04
script:
- scripts/build_gitlab/linux.sh -G Ninja -DBUILD_GLFW=OFF
<<: *build_artifacts
build-ubuntu2004-gcc:
<<: *build_job_docker
image: $DOCKER_REGISTRY/ospray/docker-images:ubuntu20.04
script:
- scripts/build_gitlab/linux.sh -G Ninja -DBUILD_GLFW=OFF -DBUILD_OSPRAY_MODULE_MULTIDEVICE=ON
<<: *build_artifacts
build-centos8:
<<: *build_job_docker
image: $DOCKER_REGISTRY/ospray/docker-images:centos8
script:
- scripts/build_gitlab/linux.sh -G Ninja
<<: *build_artifacts
build-centos7-icc:
<<: *build_job_docker_modules
script:
- module load cmake
- module load intel
- export CC=icc
- export CXX=icpc
- scripts/build_gitlab/linux.sh
build-centos7-icc15:
<<: *build_job_docker_modules
script:
- module load cmake
- module load intel/2015
- export CC=icc
- export CXX=icpc
- scripts/build_gitlab/linux.sh
build-centos7-gcc:
<<: *build_job_docker
image: $DOCKER_REGISTRY/ospray/docker-images:centos7
<<: *build_artifacts
build-centos7-mpi-impi:
<<: *build_job_docker_modules
script:
- module load cmake
- module load intel/2021.2
- scripts/build_gitlab/linux.sh -DBUILD_OSPRAY_MODULE_MPI=ON
<<: *build_artifacts
build-centos7-mpi-openmpi:
<<: *build_job_docker_modules
script:
- module load cmake
- module load mpi/openmpi-x86_64
- scripts/build_gitlab/linux.sh -DBUILD_OSPRAY_MODULE_MPI=ON
build-centos7-mpi-mpich:
<<: *build_job_docker_modules
script:
- module load cmake
- module load mpi/mpich-x86_64
- scripts/build_gitlab/linux.sh -DBUILD_OSPRAY_MODULE_MPI=ON
<<: *build_artifacts
build-centos8-mpi-openmpi:
<<: *build_job_docker
image: $DOCKER_REGISTRY/ospray/docker-images:centos8
script:
- module load mpi/openmpi-x86_64
- scripts/build_gitlab/linux.sh -DBUILD_OSPRAY_MODULE_MPI=ON
build-centos8-mpi-mpich:
<<: *build_job_docker
image: $DOCKER_REGISTRY/ospray/docker-images:centos8
script:
- module load mpi/mpich-x86_64
- scripts/build_gitlab/linux.sh -DBUILD_OSPRAY_MODULE_MPI=ON
build-mpi-cluster:
stage: build
tags: [cluster]
script:
- module load cmake
- module load impi
- module load gnu
- scripts/build_gitlab/linux.sh -DBUILD_OSPRAY_MODULE_MPI=ON -DOSPRAY_BUILD_GLM=OFF -DBUILD_OSPRAY_MODULE_MULTIDEVICE=ON
<<: *build_artifacts
only: [schedules]
build-linux-debug:
<<: *build_job_docker
script:
- export CFLAGS=-fsanitize=address
- export CXXFLAGS=-fsanitize=address
- export LDFLAGS=-fsanitize=address
- scripts/build_gitlab/linux.sh -G Ninja -DBUILD_GLFW=OFF -DCMAKE_BUILD_TYPE=Debug
<<: *build_artifacts
build-osx-clang:
stage: build
tags:
- osx
- clang
script:
- scripts/build_gitlab/macosx.sh -DBUILD_OSPRAY_MODULE_MULTIDEVICE=ON
<<: *build_artifacts
build-osx-arm:
stage: build
tags:
- mac-arm
script:
- scripts/build_gitlab/macosx.sh -DBUILD_TBB_FROM_SOURCE=ON -DBUILD_EMBREE_FROM_SOURCE=ON -DBUILD_OIDN=ON -DBUILD_OIDN_FROM_SOURCE=ON
<<: *build_artifacts_all
build-windows-msvc15:
stage: build
tags:
- win
- msvc15
script:
- scripts\build_gitlab\win.ps1 "Visual Studio 15 2017 Win64" "v141" "Release" "OFF" "OFF"
<<: *build_artifacts
build-windows-debug-all:
stage: build
tags:
- win
- msvc15
- mpi
script:
- scripts\build_gitlab\win.ps1 "Visual Studio 15 2017 Win64" "v141" "Debug" "ON" "ON"
<<: *build_artifacts
only: [schedules]
build-windows-msvc16-mpi_and_md:
stage: build
tags:
- win
- msvc16
- mpi
script:
- scripts\build_gitlab\win.ps1 "Visual Studio 16 2019" "v142" "Release" "ON" "ON"
<<: *build_artifacts
#build-windows-icc:
# stage: build
# script:
# - scripts\build_gitlab\win.ps1 "Visual Studio 14 2015 Win64" "Intel C++ Compiler 17.0"
# tags:
# - icc17
# - win
# <<: *build_artifacts
### TEST JOBS ###
test-centos7-gcc-avx2:
<<: *test_job_unix_avx2
image: $DOCKER_REGISTRY/ospray/docker-images:centos7
needs: [build-centos7-gcc]
test-centos8-avx512skx:
<<: *test_job_unix_avx512skx
image: $DOCKER_REGISTRY/ospray/docker-images:centos8
needs: [build-centos8]
test-ubuntu1604-gcc-avx2:
<<: *test_job_unix_avx2
image: $DOCKER_REGISTRY/ospray/docker-images:ubuntu16.04
needs: [build-ubuntu1604-gcc]
test-ubuntu1804-gcc-avx512skx:
<<: *test_job_unix_avx512skx
image: $DOCKER_REGISTRY/ospray/docker-images:ubuntu18.04
needs: [build-ubuntu1804-gcc]
test-ubuntu2004-gcc-avx2:
<<: *test_job_unix_avx2
image: $DOCKER_REGISTRY/ospray/docker-images:ubuntu20.04
needs: [build-ubuntu2004-gcc]
test-ubuntu2004-gcc-avx512skx:
<<: *test_job_unix_avx512skx
image: $DOCKER_REGISTRY/ospray/docker-images:ubuntu20.04
needs: [build-ubuntu2004-gcc]
script:
- LD_LIBRARY_PATH="$CI_PROJECT_DIR/build/install/ospray/lib:$LD_LIBRARY_PATH" PATH="$CI_PROJECT_DIR/build/install/ospray/bin:$PATH" scripts/tests/run_tests.sh "$CI_PROJECT_DIR" AVX512SKX TEST_MULTIDEVICE
test-centos7-gcc-mpi-mpich-avx2:
<<: *test_job_unix_mpi_avx2
image: $DOCKER_REGISTRY/ospray/docker-images:centos7-mod
needs: [build-centos7-mpi-mpich]
before_script:
- module load cmake
- module load mpi/mpich-x86_64
test-centos7-gcc-mpi-impi-avx2:
<<: *test_job_unix_mpi_avx2
image: $DOCKER_REGISTRY/ospray/docker-images:centos7-mod
needs: [build-centos7-mpi-impi]
before_script:
- module load cmake
- module load intel/2021.2
# Note: no omnipath/infiniband/shm comm access for MPI within
# Docker container, just use sockets for running validation test
- export FI_PROVIDER=sockets
test-mpi-cluster:
<<: *test_job_unix_avx512skx
tags: [cluster]
script:
- module load impi
- module load gnu
- LD_LIBRARY_PATH="$CI_PROJECT_DIR/build/install/ospray/lib:$LD_LIBRARY_PATH" PATH="$CI_PROJECT_DIR/build/install/ospray/bin:$PATH" scripts/tests/run_tests.sh "$CI_PROJECT_DIR" AVX512SKX TEST_MPI TEST_MULTIDEVICE
needs: [build-mpi-cluster]
only: [schedules]
sanitize-linux-debug:
<<: *test_job_unix_sanitize
image: $DOCKER_REGISTRY/ospray/docker-images:arch
needs: [build-linux-debug]
test-linux-debug-all:
<<: *test_job_unix_avx512skx
image: $DOCKER_REGISTRY/ospray/docker-images:arch
needs: [build-linux-debug-all]
only: [schedules]
test-osx-clang:
<<: *test_job
tags: [osx]
needs: [build-osx-clang]
script:
- DYLD_FALLBACK_LIBRARY_PATH="$CI_PROJECT_DIR/build/install/ospray/lib:$DYLD_FALLBACK_LIBRARY_PATH" PATH="$CI_PROJECT_DIR/build/install/ospray/bin:$PATH" scripts/tests/run_tests.sh "$CI_PROJECT_DIR" AVX2 TEST_MULTIDEVICE
test-osx-arm:
<<: *test_job
tags: [mac-arm]
needs: [build-osx-arm]
script:
- DYLD_FALLBACK_LIBRARY_PATH="$CI_PROJECT_DIR/build/install/ospray/lib:$DYLD_FALLBACK_LIBRARY_PATH" PATH="$CI_PROJECT_DIR/build/install/ospray/bin:$PATH" scripts/tests/run_tests.sh "$CI_PROJECT_DIR" AVX2
test-tutorials:
stage: test
tags: [docker]
image: $DOCKER_REGISTRY/ospray/docker-images:centos7
needs: [build-centos7-gcc]
script:
- scripts/tests/run_tutorials.sh
test-find-ospray:
stage: test
tags:
- docker
- modules
image: $DOCKER_REGISTRY/ospray/docker-images:centos7-mod
needs: [build-centos7-gcc]
script:
- module load cmake
- mkdir buildtut
- cd buildtut
- cmake -D ospray_DIR=`echo $CI_PROJECT_DIR/build/install/ospray/lib/cmake/ospray-*` ../apps/ospTutorial/ospTutorialFindospray
- cmake --build .
test-windows-msvc15-avx2:
<<: *test_job_windows_avx2
tags: [win, msvc15, avx2]
needs: [build-windows-msvc15]
allow_failure: true
test-windows-msvc15-avx512skx:
<<: *test_job_windows_avx512skx
tags: [win, msvc15, avx512vl]
needs: [build-windows-msvc15]
test-windows-debug-all:
<<: *test_job_windows_avx2
tags: [win, msvc15, avx2]
needs: [build-windows-debug-all]
only: [schedules]
test-windows-msvc16-avx2:
<<: *test_job_windows_avx2
tags: [win, msvc16, avx2]
needs: [build-windows-msvc16-mpi_and_md]
allow_failure: true
script:
- $env:Path += ";$CI_PROJECT_DIR\build\install\ospray\bin"
- scripts\tests\run_tests.ps1 "$CI_PROJECT_DIR" AVX2 TEST_MULTIDEVICE
test-windows-msvc16-avx512skx:
<<: *test_job_windows_avx512skx
tags: [win, msvc16, avx512vl]
needs: [build-windows-msvc16-mpi_and_md]
script:
- $env:Path += ";$CI_PROJECT_DIR\build\install\ospray\bin"
- scripts\tests\run_tests.ps1 "$CI_PROJECT_DIR" AVX512SKX TEST_MULTIDEVICE
generate-ci-baseline-avx2:
<<: *test_job_unix_avx2
image: $DOCKER_REGISTRY/ospray/docker-images:ubuntu20.04
needs: [build-ubuntu2004-gcc]
script:
- LD_LIBRARY_PATH="$CI_PROJECT_DIR/build/install/ospray/lib:$LD_LIBRARY_PATH" PATH="$CI_PROJECT_DIR/build/install/ospray/bin:$PATH" scripts/tests/generate_baseline.sh
artifacts:
paths:
- generated_test_images
expire_in: 3 day
when: manual
generate-ci-baseline-avx512skx:
<<: *test_job_unix_avx512skx
image: $DOCKER_REGISTRY/ospray/docker-images:ubuntu20.04
needs: [build-ubuntu2004-gcc]
script:
- LD_LIBRARY_PATH="$CI_PROJECT_DIR/build/install/ospray/lib:$LD_LIBRARY_PATH" PATH="$CI_PROJECT_DIR/build/install/ospray/bin:$PATH" scripts/tests/generate_baseline.sh
artifacts:
paths:
- generated_test_images
expire_in: 3 day
when: manual
### Benchmarks ###
benchmark-x8280-1:
<<: *benchmark_job
tags: [vis-perf-x8280-1]
needs: [build-centos8]
### Documentation ###
.job_template: &doc-defaults
stage: docu
tags: [docker]
image: $DOCKER_REGISTRY/ospray/docker-images:docu
needs: []
variables:
GIT_SUBMODULE_STRATEGY: normal
pdf:
<<: *doc-defaults
script:
- cd doc
- make pdf
- make checklinks
artifacts:
paths:
- readme.pdf
expire_in: 1 week
web:
<<: *doc-defaults
script:
- cd doc
- make www
artifacts:
paths:
- doc/www/*
expire_in: 1 week
spec:
<<: *doc-defaults
script:
- cd doc
- make spec
- mv www/images _images
artifacts:
paths:
- doc/ospray-spec.*
- doc/_images/*
expire_in: 1 week
### RELEASE JOBS ###
release-linux:
<<: *release_job
tags: [modules]
image: $DOCKER_REGISTRY/ospray/docker-images:centos7-mod
script:
- source $SPACK_SETUP_ENV
- module load cmake/3.15.2
- module load mpich/3.2
- scripts/release/linux.sh
artifacts:
paths:
- build_release/*.gz
expire_in: 3 day
release-osx-clang:
<<: *release_job
tags:
- clang
- osx
- sign
script:
- export CC=clang
- export CXX=clang++
- scripts/release/macosx.sh
- $SIGN_FILE_MAC -o runtime -e scripts/release/ospray.entitlements build_release/ospray-*pkg
- scripts/release/macosx_notarization.sh build_release/ospray-*.pkg
artifacts:
paths:
- build_release/*.zip
- build_release/*.pkg
expire_in: 3 day
release-windows:
<<: *release_job
tags:
- msvc15
- win
- mpi
script:
- scripts\release\win.ps1 "Visual Studio 15 2017 Win64"
- ;& $env:SIGN_FILE_WINDOWS ospray*.msi
artifacts:
paths:
- build_release\ospray*.zip
- build_release\ospray*.msi
expire_in: 3 day
### SCAN JOBS ###
kw-build:
stage: scan1
tags: [docker]
image: $DOCKER_REGISTRY/ospray/docker-images:centos7-mod
needs: []
script:
- module load cmake
- module load intel/2021.2
- scripts/build_gitlab/kw.sh
- test -s $CI_PROJECT_DIR/klocwork/build.log
- test -s $CI_PROJECT_DIR/klocwork/build_name
artifacts:
paths:
- ./klocwork/*
expire_in: 3 day
protex:
stage: scan1
tags: [docker]
image: $DOCKER_REGISTRY/ospray/docker-images:centos7
needs: []
script:
- scripts/scan/protex.sh
kw-scan:
stage: scan2
tags: [docker]
image: $DOCKER_REGISTRY/ospray/docker-images:centos7
needs: [kw-build]
script:
- scripts/scan/kw-check-issues.sh
kw-gen-report:
stage: scan2
tags: [docker]
image: $DOCKER_REGISTRY/ospray/docker-images:centos7
needs: [kw-build]
only:
- devel
- master
- /release/
script:
- scripts/scan/kw-gen-report.sh
- scripts/scan/store-files.sh $CI_PROJECT_NAME $CI_PIPELINE_ID klocwork "klocwork/report.log"
artifacts:
paths:
- ./klocwork/report.log
bdba:
<<: *release_job
stage: scan3
tags: [docker]
image: $DOCKER_REGISTRY/ospray/docker-images:centos7
needs:
- release-linux
- release-osx-clang
- release-windows
script:
- scripts/scan/bdba.sh "build_release/ospray*"
- scripts/scan/store-files.sh $CI_PROJECT_NAME $CI_PIPELINE_ID bdba "ospray-*.pdf"
- scripts/scan/store-files.sh $CI_PROJECT_NAME $CI_PIPELINE_ID bdba "ospray-*.csv"
artifacts:
paths:
- build_release/ospray-*
- ospray-*
av:
<<: *release_job
stage: scan3
tags: [docker]
image: $DOCKER_REGISTRY/clamav:ubuntu20.04
needs:
- release-linux
- release-osx-clang
- release-windows
script:
- freshclam | tee -a /tmp/av_scan.log
- clamscan -va --max-filesize=512M --max-scansize=1024M --alert-broken --alert-exceeds-max build_release/ospray-* | tee -a /tmp/av_scan.log
- scripts/scan/store-files.sh $CI_PROJECT_NAME $CI_PIPELINE_ID av /tmp/av_scan.log
artifacts:
paths:
- build_release/ospray-*
test-release-linux:
<<: *test_job_unix_avx512skx
<<: *release_job
stage: scan3
image: $DOCKER_REGISTRY/ospray/docker-images:centos7-mod
needs: [release-linux]
script:
- source $SPACK_SETUP_ENV
- module load cmake/3.15.2
- module load mpich/3.2
- tar xzf build_release/*.gz
- PATH="$CI_PROJECT_DIR/`ls -d1 ospray-*/bin`:$PATH" scripts/tests/run_tests.sh "$CI_PROJECT_DIR" AVX512SKX TEST_MPI
test-release-osx:
<<: *test_job
<<: *release_job
stage: scan3
tags: [osx, sign]
needs: [release-osx-clang]
script:
- unzip build_release/*.zip
- PATH="$CI_PROJECT_DIR/`ls -d1 ospray-*/bin`:$PATH" scripts/tests/run_tests.sh "$CI_PROJECT_DIR" AVX2
- $SIGN_FILE_MAC -t $CI_PROJECT_DIR/ospray-*/bin/* $CI_PROJECT_DIR/ospray-*/lib/*.dylib $CI_PROJECT_DIR/build_release/*.pkg
test-release-windows-zip:
<<: *test_job
<<: *release_job
stage: scan3
tags: [win, mpi, avx512vl]
needs: [release-windows]
script:
- Expand-Archive build_release/*.zip -DestinationPath .
- $env:Path += ";" + (Get-ChildItem $CI_PROJECT_DIR\ospray-*\bin | Select-Object -Expand FullName)
- scripts\tests\run_tests.ps1 "$CI_PROJECT_DIR" AVX512SKX TEST_MPI
- ;& $env:SIGN_FILE_WINDOWS -t (Get-ChildItem $CI_PROJECT_DIR\ospray-*\bin\* | Select-Object -Expand FullName)
test-release-windows-msi:
<<: *test_job
<<: *release_job
stage: scan3
tags: [win, mpi, avx512vl]
needs: [release-windows]
script:
- msiexec.exe /a (Get-ChildItem build_release/*.msi | Select-Object -Expand FullName) /qn TARGETDIR=$CI_PROJECT_DIR
- $env:Path += ";$CI_PROJECT_DIR\Intel\OSPRay v2\bin"
- scripts\tests\run_tests.ps1 "$CI_PROJECT_DIR" AVX512SKX TEST_MPI
- ;& $env:SIGN_FILE_WINDOWS -t $CI_PROJECT_DIR/build_release/*.msi (Get-ChildItem "$CI_PROJECT_DIR\Intel\OSPRay v2\bin\*" | Select-Object -Expand FullName)
### Mirror ###
mirror:
stage: mirror
tags: [docker]
image: $DOCKER_REGISTRY/ospray/docker-images:centos7-mod
only: [devel]
dependencies: []
script:
- git remote add github https://${GITHUB_TOKEN}github.com/ospray/ospray.git
- git push github HEAD:devel
-4
View File
@@ -1,4 +0,0 @@
[submodule "doc-binaries"]
path = doc/ospray-doc
url = ../ospray-doc.git
branch = .
+280 -24
View File
@@ -1,33 +1,290 @@
Version History
---------------
### 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
to be accumulated is known in advance and set as the
`targetFrames` parameter at the framebuffer
- 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
float textures `OSP_TEXTURE_RA32F`
- New parameter `limitIndirectLightSamples` for the `pathtracer` which
limits the number of light samples after the first non-specular
(i.e., diffuse and glossy) bounce to at most one
- Implement MIP Mapping for better texture filtering. If the
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
- 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
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
### Changes in v3.1.0:
- Principled and Luminous materials support emissive textures
- Add native support for disc and oriented disc geometry
- Add support for mirror repeat and clamp to edge texture wrap modes
- GPU device now also supports motion blur
- Improve noise in reflections of ThinGlass
- Improve adaptive accumulation: working with GPU, fix correlations
- Fix indirectly seen albedo and normal buffer
- Fix artifacts when using specular texture for Principled
- Fixes for PixelFilter
- Parameter was ignored (always using the default Gaussian)
- Avoid a shift/misalignment within the pixel for first sample
- 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)
### Changes in v3.0.0:
- Beta support for Intel Xe GPUs (Intel Arc™ GPUs a Intel Data Center
GPU Flex and Max Series), exploiting ray tracing hardware support.
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).
Note that the following features are not implemented yet or are not
working correctly on the new `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
- Further known issues
- Some delay on start-up or when changing the scene, because
kernel code is JIT compiled and specialized. JIT compilation
can be cached by setting environment variable
`SYCL_CACHE_PERSISTENT=1`, then consecutive starts or
rendering the same scene configuration is without delay
- For some combination of compiler, GPU driver and scene the
rendered images might show artifacts (e.g., vertical lines
or small blocks)
- Multidevice does not support `OSPImageOperation`s for
denoising or tone mapping
- Add implicit indexing for `mesh` geometry
- Add support for transferring ownership of temporary buffers:
`ospNewSharedData` accepts an optional deleter callback
- Optimizations for MPI module, supported by new integrated
performance tracing framework
- Optimize `scivis` gradient shading
- Main thread does not set FTZ/DAZ anymore for denormals handling
- Compute intersection epsilon for Mesh to avoid rendering artifacts
due to self-intersection
- Fix energy conservation of Pricipled material under certain
parameter combinations
- Fix `denoiser` to not wipe the alpha channel
- 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
- Breaking API changes
- Renamed `OSP_TEXTURE_FILTER_BILINEAR` to
`OSP_TEXTURE_FILTER_LINEAR ` and
`OSP_VOLUME_FILTER_TRI[LINEAR|CUBIC]` to
`OSP_VOLUME_FILTER_[LINEAR|CUBIC]`
- Most enums now use storage type `uint32`
- `gridSpacing` of spherical regular volume defaults to full
sphere
- Remove deprecated parameters and API calls
- error callback signatures without user pointer
- first argument of `ospNewMaterial`
- module name `ispc`; use `cpu`
- `volume` texture and `isosurface` geometry:
`volumetricModel`; use `OSPVolume volume`
- Transfer function `vec2f valueRange`; use `box1f value`
- `hdri` and `sun-sky` lights: `intensityQuantity`
`OSP_INTENSITY_QUANTITY_RADIANCE`
- `spot` light with `intensityDistribution`:
`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
version. The `denoiser` now uses HDR mode
- New parameter `maxScatteringEvents` for the `pathtracer` which
limits the number of non-specular (i.e., diffuse and glossy) bounces
- Optimized dynamic load balancing for MPI devices
- Fix crash when using small image resolution and many MPI ranks
- Fix crash in `pathtracer` when `lightSamples > 0` but there are
lights in the scene
- Fix transparent shadows with too high `minContribution` setting
- The new minimum version for ISPC is v1.20.0
- Release binaries on Linux are built on Rocky 8
### Changes in v2.11.0:
- Support single ISPC target on Windows
- OSPRay's superbuild can now be provided a CMake toolchain file for
cross-compilation
- Add support for double pumped NEON instruction on ARM64
- Reduce the memory overhead of the `mpiOffload` device and resolve
memory and `MPI_Comm` handle leaks
- 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
- 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
data
- Fix `dynamicScene` flag on World and Group to influence BVH quality
again: default is now "high", which should improve rendering
performance, depending on the scene; and "low" when `dynamicScene`
is enabled (improving BVH build performance)
- Fix a crash in `pathtracer` when there are no lights
- Fix a data corruption bug when setting string parameters for objects
in the `mpiOffload` device
- Various documentation fixes
- OSPRay now has a new dependency, which is ISPC Run Time (ISPCRT) in
minimum 1.19.0 version
- Adapt to Embree v4.0.0 API changes, which is thus the new minimum
version; additionally, the new minimum version for Open VKL is
v1.3.2 and for ISPC v1.19.0
- Removed support of MSVC14.0 (Visual Studio 2015) and the second
generation Intel Xeon Phi processor (codename Knights Landing)
### Changes in v2.10.0:
- Add support for primitive, object, and instance ID buffers as
framebuffer channels
- Support face-varying attributes for Mesh and Subdivision geometry
- Replace CMake variable `OSPRAY_PIXELS_PER_JOB` by
`OSPRAY_RENDER_TASK_SIZE`; variance tracking for adaptive
accumulation is now per task instead of per tile, allowing for more
granular adaptation
- OSPRay now requires minimum Open VKL v1.3.0 to bring the following
improvements:
- VDB volumes added support for contiguous data layouts, which can
provide improved performance (`nodesPackedDense`,
`nodesPackedTile` parameters)
- Particle volumes are more memory efficiency and improved
performance
- OSPRay now requires minimum ISPC v1.18.0 for Open VKL and to include
a fix for parallel dispatch of uniform function pointers
- MPI Offload: resolve object life time tracking issue that would
result in framebuffer and data info being release too early, leading
to a crash
- Fix crash with OpenMPI due to argument handling
- Fix clipping when rays are parallel to clipping planes
- Fix missing SDK headers from CPU and MPI module
- Deprecated the `vec2f valueRange` parameter of the `piecewiseLinear`
transfer function, use `box1f value` instead
### Changes in v2.9.0:
- Add support for multi-segment deformation motion blur for `mesh`
geometry
- OSPRay now requires minimum Open VKL v1.2.0 to bring the following
improvements:
- Structured regular volumes support for cell-centered data via
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
- Support for photometric lights (e.g., IES or EULUMDAT) also for
`sphere` and `quad` lights. When setting `intensityDistribution`,
other values for `intensityQuantity` than
`OSP_INTENSITY_QUANTITY_SCALE` are deprecated
- Changed CMake variables for enabling app categories:
- `OSPRAY_ENABLE_APPS_BENCHMARK` replaces `OSPRAY_APPS_BENCHMARK`
- `OSPRAY_ENABLE_APPS_EXAMPLES` replaces `OSPRAY_APPS_EXAMPLES`
- `OSPRAY_ENABLE_APPS_TUTORIALS` replaces `OSPRAY_APPS_TUTORIALS`
- `OSPRAY_ENABLE_APPS_TESTING` replaces `OSPRAY_APPS_TESTING`
- Improve sampling of quad lights in the `pathtracer` (solid angle
instead of area)
- Instances can now have the group object rebound via a parameter
- Fix leaking framebuffers in the MPI Offload device
- Resolve possible race condition in assigning IDs to distributed
objects in the MPI device
- Move ISPC module to `modules/` folder and renamed the module to
`cpu`
- Minimum version of rkcommon is 1.9.0, which brings the following
improvements:
- Add detection of Intel oneAPI DPC++/C++ compiler
- Fix memory leak
### Changes in v2.8.0:
- Lights can be now part of `OSPGroup` and thus instanced like
geometries and volumes and thus lights also support motion blur
(with the path tracer)
- Add cylinder light (with solid area sampling)
- Add support for rolling shutter of cameras
- Add support for quaternion motion blur for instance and camera to
allow for smoothly interpolated rotations
- Fix illumination from emissive quad meshes
### 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 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
- 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
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
- Add support for transformation and camera motion blur (with the path
tracer) via `shutter` parameter of the camera and `motion.transform`
array and `time` parameter of the instance and camera
- OSPRay can now be built for ARM64 CPUs with NEON (e.g., Apple M1)
using the superbuild. Thus, new minimum versions are for ISPC
1.16.0, for Embree 3.13.1 and for rkcommon 1.7.0
- OSPRay now requires minimum Open VKL v1.0.0 to bring the
following improvements:
- OSPRay now requires minimum Open VKL v1.0.0 to bring the following
improvements:
- Configurable `background` values for all volume types (default
`NaN`), defining region outside the volume domain
- Better default sampling rate for scaled VDB volumes, improved
@@ -65,30 +322,30 @@ Version History
only supported quantity for these lights, the value
`OSP_INTENSITY_QUANTITY_RADIANCE` is deprecated. When
`OSP_INTENSITY_QUANTITY_SCALE` is used for `sunSky` the default
value of `intensity` is `0.025` to match the old behaviour
value of `intensity` is `0.025` to match the old behavior
- The MPI module is included in the releases packages. An
[MPICH-ABI](https://www.mpich.org/abi/) compatible build is provided
for Linux that can be run with the Intel oneAPI HPC Toolki, MPICH,
and other MPICH-ABI compatible MPI distributions. The Windows
release is built against MPI provided in the Intel oneAPI HPC
Toolkit
- OSPRay now requires minimum Open VKL v0.13.0 to bring the
following improvements:
- Support half precision float (fp16) voxel data in strutured
- OSPRay now requires minimum Open VKL v0.13.0 to bring the following
improvements:
- Support half precision float (fp16) voxel data in structured
volumes (regular and spherical) and VDB volume
- Supporting tricubic filtering via `VKL_FILTER_TRICUBIC` filter
for VDB volume
- Fixed artifacts for isosurfaces of unstructured volumes
- Performance improvements for isosurfaces when multiple
isovalues are selected
- Performance improvements for isosurfaces when multiple isovalues
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
object on the rank that owns that object. Other ranks will report
no hit
- Messages issued from ISPC code use the same reporting path as the C++
code, thus now the whole OSPRay console output can be consistently
filtered with log levels
object on the rank that owns that object. Other ranks will report no
hit
- Messages issued from ISPC code use the same reporting path as the
C++ code, thus now the whole OSPRay console output can be
consistently filtered with log levels
- Open VKL and Embree internal errors are now correctly mapped to
their corresponding OSPRay errors
- Fix behavior of committing the framebuffer in distributed rendering
@@ -133,7 +390,7 @@ Version History
### Changes in v2.4.0:
- The pathtracer optionally allows for alpha blending even if the
- The `pathtracer` optionally allows for alpha blending even if the
background is seen through refractive objects like glass, by
enabling `backgroundRefraction`
- OSPRay now requires minimum Open VKL v0.11.0 to bring the following
@@ -146,7 +403,7 @@ Version History
and spherical)
- Expose parameter `horizonExtension` of Sun-sky light, which extends
the sky dome by stretching the horizon over the lower hemisphere
- Optimize handling of geometry lights by the pathtracer
- Optimize handling of geometry lights by the `pathtracer`
- The optional `denoiser` image operation now respects frame
cancellation, requiring Intel® Open Image Denoise with minimum
version 1.2.3
@@ -373,9 +630,9 @@ Version History
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 controled with enums and named strings (where
- Log levels are now controlled with enums and named strings (where
applicable)
- A new flag was also introduced which turns all OSP_LOG_WARNING
- A new flag was also introduced which turns all `OSP_LOG_WARNING`
messages into errors, which are submitted to the error callback
instead of the message callback
- Any unused parameters an object ignores now emit a warning
@@ -1118,4 +1375,3 @@ changes.
- Corrected memory management for shared data buffers
- Updated to ISPC 1.8.1
- Resolved issue in XML parser
+7 -6
View File
@@ -1,7 +1,7 @@
## Copyright 2009-2020 Intel Corporation
## Copyright 2009 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.8)
##############################################################
# Language setup
@@ -20,6 +20,7 @@ set(CMAKE_C_EXTENSIONS OFF)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_INSTALL_MESSAGE LAZY)
##############################################################
# Establish project
@@ -38,10 +39,10 @@ list(APPEND CMAKE_MODULE_PATH
${PROJECT_SOURCE_DIR}/cmake/compiler
)
include(ispc)
include(ospray_macros)
include(ospray_options)
include(package)
include(ispc)
if (OSPRAY_INSTALL_DEPENDENCIES)
include(ospray_redistribute_deps)
@@ -54,12 +55,12 @@ endif()
## Main OSPRay library ##
add_subdirectory(ospray)
## OSPRay sample apps ##
add_subdirectory(apps)
## Modules ##
add_subdirectory(modules)
## OSPRay sample apps ##
add_subdirectory(apps)
## Regression test images target ##
add_subdirectory(test_image_data)
+1411 -1023
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -7,7 +7,7 @@ be overly strict. However, deviations from this document should be
supported with technical reasoning.
This document is relatively simple and meant as a "quick overview" of
expecations for OSPRay. A more complete set of guidelines for all of C++
expectations for OSPRay. A more complete set of guidelines for all of C++
can be found in the [ISO C++ Core
Guidelines](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md).
@@ -157,7 +157,7 @@ The following are concerns specific to ISPC:
```
- Prefer omitting `uniform`/`varying` qualifiers for structs. Only
apply them if they need to be consistenly the same for both
apply them if they need to be consistently the same for both
`uniform` and `varying` instances of the struct.
### OSPRay ISPCDevice Specific Design Choices
+9 -34
View File
@@ -1,43 +1,11 @@
## Copyright 2009-2020 Intel Corporation
## Copyright 2009 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
cmake_dependent_option(
OSPRAY_APPS_BENCHMARK
"Enable building, installing, and packaging of benchmark tools."
ON
OSPRAY_ENABLE_APPS
OFF
)
cmake_dependent_option(
OSPRAY_APPS_EXAMPLES
"Enable building, installing, and packaging of ospExamples."
ON
OSPRAY_ENABLE_APPS
OFF
)
cmake_dependent_option(
OSPRAY_APPS_TUTORIALS
"Enable building, installing, and packaging of tutorial apps."
ON
OSPRAY_ENABLE_APPS
OFF
)
cmake_dependent_option(
OSPRAY_APPS_TESTING
"Enable building, installing, and packaging of test tools."
ON
OSPRAY_ENABLE_APPS
OFF
)
cmake_dependent_option(
OSPRAY_APPS_ENABLE_GLM
"Build ospray_cpp glm tests/tutorial"
OFF
"OSPRAY_APPS_TESTING OR OSPRAY_APPS_TUTORIALS"
"OSPRAY_ENABLE_APPS_TESTING OR OSPRAY_ENABLE_APPS_TUTORIALS"
OFF
)
@@ -51,4 +19,11 @@ if (OSPRAY_APPS_ENABLE_GLM)
endif()
endif()
if (OSPRAY_ENABLE_APPS_EXAMPLES)
# prefer libGL over libOpenGl for better compatibility with SWR
set(OpenGL_GL_PREFERENCE "LEGACY")
find_package(OpenGL 3 REQUIRED)
find_package(glfw3 REQUIRED)
endif()
add_all_subdirectories()
+4 -4
View File
@@ -1,9 +1,9 @@
## Copyright 2009-2021 Intel Corporation
## Copyright 2009 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
if (NOT OSPRAY_APPS_BENCHMARK AND
NOT OSPRAY_APPS_EXAMPLES AND
NOT OSPRAY_APPS_TESTING)
if (NOT OSPRAY_ENABLE_APPS_BENCHMARK AND
NOT OSPRAY_ENABLE_APPS_EXAMPLES AND
NOT OSPRAY_ENABLE_APPS_TESTING)
return()
endif()
+5 -5
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2021 Intel Corporation
// Copyright 2017 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "ArcballCamera.h"
@@ -84,7 +84,7 @@ void ArcballCamera::updateCamera()
invCamera = rcp(camera);
}
void ArcballCamera::setRotation(rkcommon::math::quaternionf q)
void ArcballCamera::setRotation(rkcommon::math::quatf q)
{
rotation = q;
updateCamera();
@@ -95,16 +95,16 @@ void ArcballCamera::updateWindowSize(const rkcommon::math::vec2i &windowSize)
invWindowSize = rkcommon::math::vec2f(1) / rkcommon::math::vec2f(windowSize);
}
rkcommon::math::quaternionf ArcballCamera::screenToArcball(
rkcommon::math::quatf ArcballCamera::screenToArcball(
const rkcommon::math::vec2f &p)
{
const float dist = dot(p, p);
// If we're on/in the sphere return the point on it
if (dist <= 1.f) {
return rkcommon::math::quaternionf(0, p.x, p.y, std::sqrt(1.f - dist));
return rkcommon::math::quatf(0, p.x, p.y, std::sqrt(1.f - dist));
} else {
// otherwise we project the point onto the sphere
const rkcommon::math::vec2f unitDir = normalize(p);
return rkcommon::math::quaternionf(0, unitDir.x, unitDir.y, 0);
return rkcommon::math::quatf(0, unitDir.x, unitDir.y, 0);
}
}
+4 -4
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2021 Intel Corporation
// Copyright 2017 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
@@ -23,7 +23,7 @@ class ArcballCamera
rkcommon::math::vec3f upDir() const;
rkcommon::math::AffineSpace3f transform() const;
void setRotation(rkcommon::math::quaternionf);
void setRotation(rkcommon::math::quatf);
void updateWindowSize(const rkcommon::math::vec2i &windowSize);
@@ -31,10 +31,10 @@ class ArcballCamera
void updateCamera();
// Project the point in [-1, 1] screen space onto the arcball sphere
rkcommon::math::quaternionf screenToArcball(const rkcommon::math::vec2f &p);
rkcommon::math::quatf screenToArcball(const rkcommon::math::vec2f &p);
float zoomSpeed;
rkcommon::math::vec2f invWindowSize;
rkcommon::math::AffineSpace3f centerTranslation, translation, invCamera;
rkcommon::math::quaternionf rotation;
rkcommon::math::quatf rotation;
};
+1 -1
View File
@@ -1,4 +1,4 @@
## Copyright 2009-2020 Intel Corporation
## Copyright 2009 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
add_library(arcball_camera STATIC ArcballCamera.cpp)
+2 -2
View File
@@ -1,9 +1,9 @@
## Copyright 2009-2021 Intel Corporation
## Copyright 2009 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
ospray_disable_compiler_warnings()
if (OSPRAY_APPS_EXAMPLES)
if (OSPRAY_ENABLE_APPS_EXAMPLES)
add_subdirectory(imgui)
endif()
+37 -8
View File
@@ -1,19 +1,47 @@
## Copyright 2009-2021 Intel Corporation
## Copyright 2009 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
cmake_minimum_required(VERSION 3.14)
include(FetchContent)
set(FETCHCONTENT_QUIET ON)
set(FETCHCONTENT_TRY_FIND_PACKAGE_MODE NEVER)
FetchContent_Declare(
imgui
GIT_REPOSITORY https://github.com/ocornut/imgui
GIT_TAG ${OSPRAY_IMGUI_GIT_TAG}
# `patch` is not available on all systems, so use `git apply` instead.
# The patch command first resets the repository to a clean state. That
# is because CMake wants to apply the patch again when CMake needs to
# reconfigure, which fails.
PATCH_COMMAND git reset --hard && git apply -v -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/imgui.patch
)
FetchContent_MakeAvailable(imgui)
mark_as_advanced(FETCHCONTENT_BASE_DIR)
mark_as_advanced(FETCHCONTENT_FULLY_DISCONNECTED)
mark_as_advanced(FETCHCONTENT_QUIET)
mark_as_advanced(FETCHCONTENT_SOURCE_DIR_IMGUI)
mark_as_advanced(FETCHCONTENT_UPDATES_DISCONNECTED)
mark_as_advanced(FETCHCONTENT_UPDATES_DISCONNECTED_IMGUI)
ospray_disable_compiler_warnings()
add_library(ospray_imgui SHARED
imgui.cpp
imgui_draw.cpp
imgui_tables.cpp
imgui_widgets.cpp
${imgui_SOURCE_DIR}/imgui.cpp
${imgui_SOURCE_DIR}/imgui_draw.cpp
${imgui_SOURCE_DIR}/imgui_tables.cpp
${imgui_SOURCE_DIR}/imgui_widgets.cpp
${imgui_SOURCE_DIR}/backends/imgui_impl_opengl3.cpp
${imgui_SOURCE_DIR}/backends/imgui_impl_glfw.cpp
)
target_link_libraries(ospray_imgui
PUBLIC
glfw
${OPENGL_LIBRARIES}
rkcommon::rkcommon
)
ospray_install_library(ospray_imgui apps)
@@ -21,7 +49,8 @@ ospray_install_library(ospray_imgui apps)
target_include_directories(
ospray_imgui
INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}>
$<BUILD_INTERFACE:${imgui_SOURCE_DIR}>
$<BUILD_INTERFACE:${imgui_SOURCE_DIR}/backends>
PRIVATE
${CMAKE_CURRENT_LIST_DIR}
${imgui_SOURCE_DIR}
)
-116
View File
@@ -1,116 +0,0 @@
//-----------------------------------------------------------------------------
// COMPILE-TIME OPTIONS FOR DEAR IMGUI
// Runtime options (clipboard callbacks, enabling various features, etc.) can generally be set via the ImGuiIO structure.
// You can use ImGui::SetAllocatorFunctions() before calling ImGui::CreateContext() to rewire memory allocation functions.
//-----------------------------------------------------------------------------
// A) You may edit imconfig.h (and not overwrite it when updating Dear ImGui, or maintain a patch/rebased branch with your modifications to it)
// B) or '#define IMGUI_USER_CONFIG "my_imgui_config.h"' in your project and then add directives in your own file without touching this template.
//-----------------------------------------------------------------------------
// You need to make sure that configuration settings are defined consistently _everywhere_ Dear ImGui is used, which include the imgui*.cpp
// files but also _any_ of your code that uses Dear ImGui. This is because some compile-time options have an affect on data structures.
// Defining those options in imconfig.h will ensure every compilation unit gets to see the same data structure layouts.
// Call IMGUI_CHECKVERSION() from your .cpp files to verify that the data structures your files are using are matching the ones imgui.cpp is using.
//-----------------------------------------------------------------------------
#pragma once
//---- Define assertion handler. Defaults to calling assert().
// If your macro uses multiple statements, make sure is enclosed in a 'do { .. } while (0)' block so it can be used as a single statement.
//#define IM_ASSERT(_EXPR) MyAssert(_EXPR)
//#define IM_ASSERT(_EXPR) ((void)(_EXPR)) // Disable asserts
//---- Define attributes of all API symbols declarations, e.g. for DLL under Windows
// Using dear imgui via a shared library is not recommended, because of function call overhead and because we don't guarantee backward nor forward ABI compatibility.
#ifdef _WIN32
# ifdef ospray_imgui_EXPORTS
# define IMGUI_API __declspec(dllexport)
# else
# define IMGUI_API __declspec(dllimport)
# endif
#else
# define IMGUI_API
#endif
//---- Don't define obsolete functions/enums/behaviors. Consider enabling from time to time after updating to avoid using soon-to-be obsolete function/names.
//#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS
//---- Disable all of Dear ImGui or don't implement standard windows.
// It is very strongly recommended to NOT disable the demo windows during development. Please read comments in imgui_demo.cpp.
//#define IMGUI_DISABLE // Disable everything: all headers and source files will be empty.
//#define IMGUI_DISABLE_DEMO_WINDOWS // Disable demo windows: ShowDemoWindow()/ShowStyleEditor() will be empty. Not recommended.
//#define IMGUI_DISABLE_METRICS_WINDOW // Disable metrics/debugger window: ShowMetricsWindow() will be empty.
//---- Don't implement some functions to reduce linkage requirements.
//#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS // [Win32] Don't implement default clipboard handler. Won't use and link with OpenClipboard/GetClipboardData/CloseClipboard etc.
//#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS // [Win32] Don't implement default IME handler. Won't use and link with ImmGetContext/ImmSetCompositionWindow.
//#define IMGUI_DISABLE_WIN32_FUNCTIONS // [Win32] Won't use and link with any Win32 function (clipboard, ime).
//#define IMGUI_ENABLE_OSX_DEFAULT_CLIPBOARD_FUNCTIONS // [OSX] Implement default OSX clipboard handler (need to link with '-framework ApplicationServices', this is why this is not the default).
//#define IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS // Don't implement ImFormatString/ImFormatStringV so you can implement them yourself (e.g. if you don't want to link with vsnprintf)
//#define IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS // Don't implement ImFabs/ImSqrt/ImPow/ImFmod/ImCos/ImSin/ImAcos/ImAtan2 so you can implement them yourself.
//#define IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS // Don't implement ImFileOpen/ImFileClose/ImFileRead/ImFileWrite so you can implement them yourself if you don't want to link with fopen/fclose/fread/fwrite. This will also disable the LogToTTY() function.
//#define IMGUI_DISABLE_DEFAULT_ALLOCATORS // Don't implement default allocators calling malloc()/free() to avoid linking with them. You will need to call ImGui::SetAllocatorFunctions().
//---- Include imgui_user.h at the end of imgui.h as a convenience
//#define IMGUI_INCLUDE_IMGUI_USER_H
//---- Pack colors to BGRA8 instead of RGBA8 (to avoid converting from one to another)
//#define IMGUI_USE_BGRA_PACKED_COLOR
//---- Use 32-bit for ImWchar (default is 16-bit) to support unicode planes 1-16. (e.g. point beyond 0xFFFF like emoticons, dingbats, symbols, shapes, ancient languages, etc...)
//#define IMGUI_USE_WCHAR32
//---- Avoid multiple STB libraries implementations, or redefine path/filenames to prioritize another version
// By default the embedded implementations are declared static and not available outside of imgui cpp files.
//#define IMGUI_STB_TRUETYPE_FILENAME "my_folder/stb_truetype.h"
//#define IMGUI_STB_RECT_PACK_FILENAME "my_folder/stb_rect_pack.h"
//#define IMGUI_DISABLE_STB_TRUETYPE_IMPLEMENTATION
//#define IMGUI_DISABLE_STB_RECT_PACK_IMPLEMENTATION
//---- Use stb_printf's faster implementation of vsnprintf instead of the one from libc (unless IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS is defined)
// Requires 'stb_sprintf.h' to be available in the include path. Compatibility checks of arguments and formats done by clang and GCC will be disabled in order to support the extra formats provided by STB sprintf.
// #define IMGUI_USE_STB_SPRINTF
//---- Define constructor and implicit cast operators to convert back<>forth between your math types and ImVec2/ImVec4.
// This will be inlined as part of ImVec2 and ImVec4 class declarations.
/*
#define IM_VEC2_CLASS_EXTRA \
ImVec2(const MyVec2& f) { x = f.x; y = f.y; } \
operator MyVec2() const { return MyVec2(x,y); }
#define IM_VEC4_CLASS_EXTRA \
ImVec4(const MyVec4& f) { x = f.x; y = f.y; z = f.z; w = f.w; } \
operator MyVec4() const { return MyVec4(x,y,z,w); }
*/
//---- Use 32-bit vertex indices (default is 16-bit) is one way to allow large meshes with more than 64K vertices.
// Your renderer backend will need to support it (most example renderer backends support both 16/32-bit indices).
// Another way to allow large meshes while keeping 16-bit indices is to handle ImDrawCmd::VtxOffset in your renderer.
// Read about ImGuiBackendFlags_RendererHasVtxOffset for details.
//#define ImDrawIdx unsigned int
//---- Override ImDrawCallback signature (will need to modify renderer backends accordingly)
//struct ImDrawList;
//struct ImDrawCmd;
//typedef void (*MyImDrawCallback)(const ImDrawList* draw_list, const ImDrawCmd* cmd, void* my_renderer_user_data);
//#define ImDrawCallback MyImDrawCallback
//---- Debug Tools: Macro to break in Debugger
// (use 'Metrics->Tools->Item Picker' to pick widgets with the mouse and break into them for easy debugging.)
//#define IM_DEBUG_BREAK IM_ASSERT(0)
//#define IM_DEBUG_BREAK __debugbreak()
//---- Debug Tools: Have the Item Picker break in the ItemAdd() function instead of ItemHoverable(),
// (which comes earlier in the code, will catch a few extra items, allow picking items other than Hovered one.)
// This adds a small runtime cost which is why it is not enabled by default.
//#define IMGUI_DEBUG_TOOL_ITEM_PICKER_EX
//---- Debug Tools: Enable slower asserts
//#define IMGUI_DEBUG_PARANOID
//---- Tip: You can add extra functions within the ImGui:: namespace, here or in your own headers files.
/*
namespace ImGui
{
void MyFunction(const char* name, const MyMatrix44& v);
}
*/
File diff suppressed because it is too large Load Diff
-2725
View File
File diff suppressed because it is too large Load Diff
+44
View File
@@ -0,0 +1,44 @@
--- a/imconfig.h
+++ b/imconfig.h
@@ -21,20 +21,29 @@
//---- Define attributes of all API symbols declarations, e.g. for DLL under Windows
// Using Dear ImGui via a shared library is not recommended, because of function call overhead and because we don't guarantee backward nor forward ABI compatibility.
+#ifdef _WIN32
+# ifdef ospray_imgui_EXPORTS
+# define IMGUI_API __declspec(dllexport)
+# else
+# define IMGUI_API __declspec(dllimport)
+# endif
+#else
+# define IMGUI_API
+#endif
// DLL users: heaps and globals are not shared across DLL boundaries! You will need to call SetCurrentContext() + SetAllocatorFunctions()
// for each static/DLL boundary you are calling from. Read "Context and Memory Allocators" section of imgui.cpp for more details.
//#define IMGUI_API __declspec( dllexport )
//#define IMGUI_API __declspec( dllimport )
//---- Don't define obsolete functions/enums/behaviors. Consider enabling from time to time after updating to clean your code of obsolete function/names.
-//#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS
//#define IMGUI_DISABLE_OBSOLETE_KEYIO // 1.87+ disable legacy io.KeyMap[]+io.KeysDown[] in favor io.AddKeyEvent(). This is automatically done by IMGUI_DISABLE_OBSOLETE_FUNCTIONS.
//---- Disable all of Dear ImGui or don't implement standard windows/tools.
// It is very strongly recommended to NOT disable the demo windows and debug tool during development. They are extremely useful in day to day work. Please read comments in imgui_demo.cpp.
//#define IMGUI_DISABLE // Disable everything: all headers and source files will be empty.
-//#define IMGUI_DISABLE_DEMO_WINDOWS // Disable demo windows: ShowDemoWindow()/ShowStyleEditor() will be empty.
-//#define IMGUI_DISABLE_DEBUG_TOOLS // Disable metrics/debugger and other debug tools: ShowMetricsWindow(), ShowDebugLogWindow() and ShowIDStackToolWindow() will be empty.
+#define IMGUI_DISABLE_DEMO_WINDOWS // Disable demo windows: ShowDemoWindow()/ShowStyleEditor() will be empty.
+#define IMGUI_DISABLE_DEBUG_TOOLS // Disable metrics/debugger and other debug tools: ShowMetricsWindow(), ShowDebugLogWindow() and ShowIDStackToolWindow() will be empty.
//---- Don't implement some functions to reduce linkage requirements.
//#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS // [Win32] Don't implement default clipboard handler. Won't use and link with OpenClipboard/GetClipboardData/CloseClipboard etc. (user32.lib/.a, kernel32.lib/.a)
@@ -44,7 +53,7 @@
//#define IMGUI_ENABLE_OSX_DEFAULT_CLIPBOARD_FUNCTIONS // [OSX] Implement default OSX clipboard handler (need to link with '-framework ApplicationServices', this is why this is not the default).
//#define IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS // Don't implement ImFormatString/ImFormatStringV so you can implement them yourself (e.g. if you don't want to link with vsnprintf)
//#define IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS // Don't implement ImFabs/ImSqrt/ImPow/ImFmod/ImCos/ImSin/ImAcos/ImAtan2 so you can implement them yourself.
-//#define IMGUI_DISABLE_FILE_FUNCTIONS // Don't implement ImFileOpen/ImFileClose/ImFileRead/ImFileWrite and ImFileHandle at all (replace them with dummies)
+#define IMGUI_DISABLE_FILE_FUNCTIONS // Don't implement ImFileOpen/ImFileClose/ImFileRead/ImFileWrite and ImFileHandle at all (replace them with dummies)
//#define IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS // Don't implement ImFileOpen/ImFileClose/ImFileRead/ImFileWrite and ImFileHandle so you can implement them yourself if you don't want to link with fopen/fclose/fread/fwrite. This will also disable the LogToTTY() function.
//#define IMGUI_DISABLE_DEFAULT_ALLOCATORS // Don't implement default allocators calling malloc()/free() to avoid linking with them. You will need to call ImGui::SetAllocatorFunctions().
//#define IMGUI_DISABLE_SSE // Disable use of SSE intrinsics even if available
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-639
View File
@@ -1,639 +0,0 @@
// [DEAR IMGUI]
// This is a slightly modified version of stb_rect_pack.h 1.00.
// Those changes would need to be pushed into nothings/stb:
// - Added STBRP__CDECL
// Grep for [DEAR IMGUI] to find the changes.
// stb_rect_pack.h - v1.00 - public domain - rectangle packing
// Sean Barrett 2014
//
// Useful for e.g. packing rectangular textures into an atlas.
// Does not do rotation.
//
// Not necessarily the awesomest packing method, but better than
// the totally naive one in stb_truetype (which is primarily what
// this is meant to replace).
//
// Has only had a few tests run, may have issues.
//
// More docs to come.
//
// No memory allocations; uses qsort() and assert() from stdlib.
// Can override those by defining STBRP_SORT and STBRP_ASSERT.
//
// This library currently uses the Skyline Bottom-Left algorithm.
//
// Please note: better rectangle packers are welcome! Please
// implement them to the same API, but with a different init
// function.
//
// Credits
//
// Library
// Sean Barrett
// Minor features
// Martins Mozeiko
// github:IntellectualKitty
//
// Bugfixes / warning fixes
// Jeremy Jaussaud
// Fabian Giesen
//
// Version history:
//
// 1.00 (2019-02-25) avoid small space waste; gracefully fail too-wide rectangles
// 0.99 (2019-02-07) warning fixes
// 0.11 (2017-03-03) return packing success/fail result
// 0.10 (2016-10-25) remove cast-away-const to avoid warnings
// 0.09 (2016-08-27) fix compiler warnings
// 0.08 (2015-09-13) really fix bug with empty rects (w=0 or h=0)
// 0.07 (2015-09-13) fix bug with empty rects (w=0 or h=0)
// 0.06 (2015-04-15) added STBRP_SORT to allow replacing qsort
// 0.05: added STBRP_ASSERT to allow replacing assert
// 0.04: fixed minor bug in STBRP_LARGE_RECTS support
// 0.01: initial release
//
// LICENSE
//
// See end of file for license information.
//////////////////////////////////////////////////////////////////////////////
//
// INCLUDE SECTION
//
#ifndef STB_INCLUDE_STB_RECT_PACK_H
#define STB_INCLUDE_STB_RECT_PACK_H
#define STB_RECT_PACK_VERSION 1
#ifdef STBRP_STATIC
#define STBRP_DEF static
#else
#define STBRP_DEF extern
#endif
#ifdef __cplusplus
extern "C" {
#endif
typedef struct stbrp_context stbrp_context;
typedef struct stbrp_node stbrp_node;
typedef struct stbrp_rect stbrp_rect;
#ifdef STBRP_LARGE_RECTS
typedef int stbrp_coord;
#else
typedef unsigned short stbrp_coord;
#endif
STBRP_DEF int stbrp_pack_rects (stbrp_context *context, stbrp_rect *rects, int num_rects);
// Assign packed locations to rectangles. The rectangles are of type
// 'stbrp_rect' defined below, stored in the array 'rects', and there
// are 'num_rects' many of them.
//
// Rectangles which are successfully packed have the 'was_packed' flag
// set to a non-zero value and 'x' and 'y' store the minimum location
// on each axis (i.e. bottom-left in cartesian coordinates, top-left
// if you imagine y increasing downwards). Rectangles which do not fit
// have the 'was_packed' flag set to 0.
//
// You should not try to access the 'rects' array from another thread
// while this function is running, as the function temporarily reorders
// the array while it executes.
//
// To pack into another rectangle, you need to call stbrp_init_target
// again. To continue packing into the same rectangle, you can call
// this function again. Calling this multiple times with multiple rect
// arrays will probably produce worse packing results than calling it
// a single time with the full rectangle array, but the option is
// available.
//
// The function returns 1 if all of the rectangles were successfully
// packed and 0 otherwise.
struct stbrp_rect
{
// reserved for your use:
int id;
// input:
stbrp_coord w, h;
// output:
stbrp_coord x, y;
int was_packed; // non-zero if valid packing
}; // 16 bytes, nominally
STBRP_DEF void stbrp_init_target (stbrp_context *context, int width, int height, stbrp_node *nodes, int num_nodes);
// Initialize a rectangle packer to:
// pack a rectangle that is 'width' by 'height' in dimensions
// using temporary storage provided by the array 'nodes', which is 'num_nodes' long
//
// You must call this function every time you start packing into a new target.
//
// There is no "shutdown" function. The 'nodes' memory must stay valid for
// the following stbrp_pack_rects() call (or calls), but can be freed after
// the call (or calls) finish.
//
// Note: to guarantee best results, either:
// 1. make sure 'num_nodes' >= 'width'
// or 2. call stbrp_allow_out_of_mem() defined below with 'allow_out_of_mem = 1'
//
// If you don't do either of the above things, widths will be quantized to multiples
// of small integers to guarantee the algorithm doesn't run out of temporary storage.
//
// If you do #2, then the non-quantized algorithm will be used, but the algorithm
// may run out of temporary storage and be unable to pack some rectangles.
STBRP_DEF void stbrp_setup_allow_out_of_mem (stbrp_context *context, int allow_out_of_mem);
// Optionally call this function after init but before doing any packing to
// change the handling of the out-of-temp-memory scenario, described above.
// If you call init again, this will be reset to the default (false).
STBRP_DEF void stbrp_setup_heuristic (stbrp_context *context, int heuristic);
// Optionally select which packing heuristic the library should use. Different
// heuristics will produce better/worse results for different data sets.
// If you call init again, this will be reset to the default.
enum
{
STBRP_HEURISTIC_Skyline_default=0,
STBRP_HEURISTIC_Skyline_BL_sortHeight = STBRP_HEURISTIC_Skyline_default,
STBRP_HEURISTIC_Skyline_BF_sortHeight
};
//////////////////////////////////////////////////////////////////////////////
//
// the details of the following structures don't matter to you, but they must
// be visible so you can handle the memory allocations for them
struct stbrp_node
{
stbrp_coord x,y;
stbrp_node *next;
};
struct stbrp_context
{
int width;
int height;
int align;
int init_mode;
int heuristic;
int num_nodes;
stbrp_node *active_head;
stbrp_node *free_head;
stbrp_node extra[2]; // we allocate two extra nodes so optimal user-node-count is 'width' not 'width+2'
};
#ifdef __cplusplus
}
#endif
#endif
//////////////////////////////////////////////////////////////////////////////
//
// IMPLEMENTATION SECTION
//
#ifdef STB_RECT_PACK_IMPLEMENTATION
#ifndef STBRP_SORT
#include <stdlib.h>
#define STBRP_SORT qsort
#endif
#ifndef STBRP_ASSERT
#include <assert.h>
#define STBRP_ASSERT assert
#endif
// [DEAR IMGUI] Added STBRP__CDECL
#ifdef _MSC_VER
#define STBRP__NOTUSED(v) (void)(v)
#define STBRP__CDECL __cdecl
#else
#define STBRP__NOTUSED(v) (void)sizeof(v)
#define STBRP__CDECL
#endif
enum
{
STBRP__INIT_skyline = 1
};
STBRP_DEF void stbrp_setup_heuristic(stbrp_context *context, int heuristic)
{
switch (context->init_mode) {
case STBRP__INIT_skyline:
STBRP_ASSERT(heuristic == STBRP_HEURISTIC_Skyline_BL_sortHeight || heuristic == STBRP_HEURISTIC_Skyline_BF_sortHeight);
context->heuristic = heuristic;
break;
default:
STBRP_ASSERT(0);
}
}
STBRP_DEF void stbrp_setup_allow_out_of_mem(stbrp_context *context, int allow_out_of_mem)
{
if (allow_out_of_mem)
// if it's ok to run out of memory, then don't bother aligning them;
// this gives better packing, but may fail due to OOM (even though
// the rectangles easily fit). @TODO a smarter approach would be to only
// quantize once we've hit OOM, then we could get rid of this parameter.
context->align = 1;
else {
// if it's not ok to run out of memory, then quantize the widths
// so that num_nodes is always enough nodes.
//
// I.e. num_nodes * align >= width
// align >= width / num_nodes
// align = ceil(width/num_nodes)
context->align = (context->width + context->num_nodes-1) / context->num_nodes;
}
}
STBRP_DEF void stbrp_init_target(stbrp_context *context, int width, int height, stbrp_node *nodes, int num_nodes)
{
int i;
#ifndef STBRP_LARGE_RECTS
STBRP_ASSERT(width <= 0xffff && height <= 0xffff);
#endif
for (i=0; i < num_nodes-1; ++i)
nodes[i].next = &nodes[i+1];
nodes[i].next = NULL;
context->init_mode = STBRP__INIT_skyline;
context->heuristic = STBRP_HEURISTIC_Skyline_default;
context->free_head = &nodes[0];
context->active_head = &context->extra[0];
context->width = width;
context->height = height;
context->num_nodes = num_nodes;
stbrp_setup_allow_out_of_mem(context, 0);
// node 0 is the full width, node 1 is the sentinel (lets us not store width explicitly)
context->extra[0].x = 0;
context->extra[0].y = 0;
context->extra[0].next = &context->extra[1];
context->extra[1].x = (stbrp_coord) width;
#ifdef STBRP_LARGE_RECTS
context->extra[1].y = (1<<30);
#else
context->extra[1].y = 65535;
#endif
context->extra[1].next = NULL;
}
// find minimum y position if it starts at x1
static int stbrp__skyline_find_min_y(stbrp_context *c, stbrp_node *first, int x0, int width, int *pwaste)
{
stbrp_node *node = first;
int x1 = x0 + width;
int min_y, visited_width, waste_area;
STBRP__NOTUSED(c);
STBRP_ASSERT(first->x <= x0);
#if 0
// skip in case we're past the node
while (node->next->x <= x0)
++node;
#else
STBRP_ASSERT(node->next->x > x0); // we ended up handling this in the caller for efficiency
#endif
STBRP_ASSERT(node->x <= x0);
min_y = 0;
waste_area = 0;
visited_width = 0;
while (node->x < x1) {
if (node->y > min_y) {
// raise min_y higher.
// we've accounted for all waste up to min_y,
// but we'll now add more waste for everything we've visted
waste_area += visited_width * (node->y - min_y);
min_y = node->y;
// the first time through, visited_width might be reduced
if (node->x < x0)
visited_width += node->next->x - x0;
else
visited_width += node->next->x - node->x;
} else {
// add waste area
int under_width = node->next->x - node->x;
if (under_width + visited_width > width)
under_width = width - visited_width;
waste_area += under_width * (min_y - node->y);
visited_width += under_width;
}
node = node->next;
}
*pwaste = waste_area;
return min_y;
}
typedef struct
{
int x,y;
stbrp_node **prev_link;
} stbrp__findresult;
static stbrp__findresult stbrp__skyline_find_best_pos(stbrp_context *c, int width, int height)
{
int best_waste = (1<<30), best_x, best_y = (1 << 30);
stbrp__findresult fr;
stbrp_node **prev, *node, *tail, **best = NULL;
// align to multiple of c->align
width = (width + c->align - 1);
width -= width % c->align;
STBRP_ASSERT(width % c->align == 0);
// if it can't possibly fit, bail immediately
if (width > c->width || height > c->height) {
fr.prev_link = NULL;
fr.x = fr.y = 0;
return fr;
}
node = c->active_head;
prev = &c->active_head;
while (node->x + width <= c->width) {
int y,waste;
y = stbrp__skyline_find_min_y(c, node, node->x, width, &waste);
if (c->heuristic == STBRP_HEURISTIC_Skyline_BL_sortHeight) { // actually just want to test BL
// bottom left
if (y < best_y) {
best_y = y;
best = prev;
}
} else {
// best-fit
if (y + height <= c->height) {
// can only use it if it first vertically
if (y < best_y || (y == best_y && waste < best_waste)) {
best_y = y;
best_waste = waste;
best = prev;
}
}
}
prev = &node->next;
node = node->next;
}
best_x = (best == NULL) ? 0 : (*best)->x;
// if doing best-fit (BF), we also have to try aligning right edge to each node position
//
// e.g, if fitting
//
// ____________________
// |____________________|
//
// into
//
// | |
// | ____________|
// |____________|
//
// then right-aligned reduces waste, but bottom-left BL is always chooses left-aligned
//
// This makes BF take about 2x the time
if (c->heuristic == STBRP_HEURISTIC_Skyline_BF_sortHeight) {
tail = c->active_head;
node = c->active_head;
prev = &c->active_head;
// find first node that's admissible
while (tail->x < width)
tail = tail->next;
while (tail) {
int xpos = tail->x - width;
int y,waste;
STBRP_ASSERT(xpos >= 0);
// find the left position that matches this
while (node->next->x <= xpos) {
prev = &node->next;
node = node->next;
}
STBRP_ASSERT(node->next->x > xpos && node->x <= xpos);
y = stbrp__skyline_find_min_y(c, node, xpos, width, &waste);
if (y + height <= c->height) {
if (y <= best_y) {
if (y < best_y || waste < best_waste || (waste==best_waste && xpos < best_x)) {
best_x = xpos;
STBRP_ASSERT(y <= best_y);
best_y = y;
best_waste = waste;
best = prev;
}
}
}
tail = tail->next;
}
}
fr.prev_link = best;
fr.x = best_x;
fr.y = best_y;
return fr;
}
static stbrp__findresult stbrp__skyline_pack_rectangle(stbrp_context *context, int width, int height)
{
// find best position according to heuristic
stbrp__findresult res = stbrp__skyline_find_best_pos(context, width, height);
stbrp_node *node, *cur;
// bail if:
// 1. it failed
// 2. the best node doesn't fit (we don't always check this)
// 3. we're out of memory
if (res.prev_link == NULL || res.y + height > context->height || context->free_head == NULL) {
res.prev_link = NULL;
return res;
}
// on success, create new node
node = context->free_head;
node->x = (stbrp_coord) res.x;
node->y = (stbrp_coord) (res.y + height);
context->free_head = node->next;
// insert the new node into the right starting point, and
// let 'cur' point to the remaining nodes needing to be
// stiched back in
cur = *res.prev_link;
if (cur->x < res.x) {
// preserve the existing one, so start testing with the next one
stbrp_node *next = cur->next;
cur->next = node;
cur = next;
} else {
*res.prev_link = node;
}
// from here, traverse cur and free the nodes, until we get to one
// that shouldn't be freed
while (cur->next && cur->next->x <= res.x + width) {
stbrp_node *next = cur->next;
// move the current node to the free list
cur->next = context->free_head;
context->free_head = cur;
cur = next;
}
// stitch the list back in
node->next = cur;
if (cur->x < res.x + width)
cur->x = (stbrp_coord) (res.x + width);
#ifdef _DEBUG
cur = context->active_head;
while (cur->x < context->width) {
STBRP_ASSERT(cur->x < cur->next->x);
cur = cur->next;
}
STBRP_ASSERT(cur->next == NULL);
{
int count=0;
cur = context->active_head;
while (cur) {
cur = cur->next;
++count;
}
cur = context->free_head;
while (cur) {
cur = cur->next;
++count;
}
STBRP_ASSERT(count == context->num_nodes+2);
}
#endif
return res;
}
// [DEAR IMGUI] Added STBRP__CDECL
static int STBRP__CDECL rect_height_compare(const void *a, const void *b)
{
const stbrp_rect *p = (const stbrp_rect *) a;
const stbrp_rect *q = (const stbrp_rect *) b;
if (p->h > q->h)
return -1;
if (p->h < q->h)
return 1;
return (p->w > q->w) ? -1 : (p->w < q->w);
}
// [DEAR IMGUI] Added STBRP__CDECL
static int STBRP__CDECL rect_original_order(const void *a, const void *b)
{
const stbrp_rect *p = (const stbrp_rect *) a;
const stbrp_rect *q = (const stbrp_rect *) b;
return (p->was_packed < q->was_packed) ? -1 : (p->was_packed > q->was_packed);
}
#ifdef STBRP_LARGE_RECTS
#define STBRP__MAXVAL 0xffffffff
#else
#define STBRP__MAXVAL 0xffff
#endif
STBRP_DEF int stbrp_pack_rects(stbrp_context *context, stbrp_rect *rects, int num_rects)
{
int i, all_rects_packed = 1;
// we use the 'was_packed' field internally to allow sorting/unsorting
for (i=0; i < num_rects; ++i) {
rects[i].was_packed = i;
}
// sort according to heuristic
STBRP_SORT(rects, num_rects, sizeof(rects[0]), rect_height_compare);
for (i=0; i < num_rects; ++i) {
if (rects[i].w == 0 || rects[i].h == 0) {
rects[i].x = rects[i].y = 0; // empty rect needs no space
} else {
stbrp__findresult fr = stbrp__skyline_pack_rectangle(context, rects[i].w, rects[i].h);
if (fr.prev_link) {
rects[i].x = (stbrp_coord) fr.x;
rects[i].y = (stbrp_coord) fr.y;
} else {
rects[i].x = rects[i].y = STBRP__MAXVAL;
}
}
}
// unsort
STBRP_SORT(rects, num_rects, sizeof(rects[0]), rect_original_order);
// set was_packed flags and all_rects_packed status
for (i=0; i < num_rects; ++i) {
rects[i].was_packed = !(rects[i].x == STBRP__MAXVAL && rects[i].y == STBRP__MAXVAL);
if (!rects[i].was_packed)
all_rects_packed = 0;
}
// return the all_rects_packed status
return all_rects_packed;
}
#endif
/*
------------------------------------------------------------------------------
This software is available under 2 licenses -- choose whichever you prefer.
------------------------------------------------------------------------------
ALTERNATIVE A - MIT License
Copyright (c) 2017 Sean Barrett
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
------------------------------------------------------------------------------
ALTERNATIVE B - Public Domain (www.unlicense.org)
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
software, either in source code form or as a compiled binary, for any purpose,
commercial or non-commercial, and by any means.
In jurisdictions that recognize copyright laws, the author or authors of this
software dedicate any and all copyright interest in the software to the public
domain. We make this dedication for the benefit of the public at large and to
the detriment of our heirs and successors. We intend this dedication to be an
overt act of relinquishment in perpetuity of all present and future rights to
this software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
------------------------------------------------------------------------------
*/
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+23 -2
View File
@@ -1,8 +1,29 @@
## Copyright 2009-2019 Intel Corporation
## Copyright 2009 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
cmake_minimum_required(VERSION 3.14)
include(FetchContent)
set(FETCHCONTENT_QUIET ON)
set(FETCHCONTENT_TRY_FIND_PACKAGE_MODE NEVER)
FetchContent_Declare(
stb
GIT_REPOSITORY https://github.com/nothings/stb
GIT_TAG ${OSPRAY_STB_GIT_TAG}
)
FetchContent_MakeAvailable(stb)
mark_as_advanced(FETCHCONTENT_BASE_DIR)
mark_as_advanced(FETCHCONTENT_FULLY_DISCONNECTED)
mark_as_advanced(FETCHCONTENT_QUIET)
mark_as_advanced(FETCHCONTENT_SOURCE_DIR_STB)
mark_as_advanced(FETCHCONTENT_UPDATES_DISCONNECTED)
mark_as_advanced(FETCHCONTENT_UPDATES_DISCONNECTED_STB)
add_library(stb_image INTERFACE)
target_include_directories(stb_image
INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}>
$<BUILD_INTERFACE:${stb_SOURCE_DIR}>
)
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+20 -8
View File
@@ -1,4 +1,4 @@
## Copyright 2009-2020 Intel Corporation
## Copyright 2009 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
include(GenerateExportHeader)
@@ -7,32 +7,44 @@ add_library(ospray_testing SHARED
${OSPRAY_RESOURCE}
ospray_testing.cpp
builders/Builder.cpp
builders/Boxes.cpp
builders/Builder.cpp
builders/ClippingGeometries.cpp
builders/CornellBox.cpp
builders/Curves.cpp
builders/Empty.cpp
builders/GravitySpheresVolume.cpp
builders/Instancing.cpp
builders/Interpolation.cpp
builders/MipMapTextures.cpp
builders/Noise.cpp
builders/ParticleVolume.cpp
builders/PerlinNoiseVolumes.cpp
builders/Planes.cpp
builders/RandomSpheres.cpp
builders/Streamlines.cpp
builders/SubdivisionCube.cpp
builders/UnstructuredVolumeSimple.cpp
builders/UnstructuredVolumeGen.cpp
builders/Planes.cpp
builders/ClippingGeometries.cpp
builders/ParticleVolume.cpp
builders/VdbVolume.cpp
builders/Transparency.cpp
builders/UnstructuredVolumeGen.cpp
builders/UnstructuredVolumeSimple.cpp
builders/VdbVolume.cpp
# regression test scenes
builders/test_pt_alloy_roughness.cpp
builders/test_pt_carpaint.cpp
builders/test_pt_glass.cpp
builders/test_pt_luminous.cpp
builders/test_pt_material_tex.cpp
builders/test_pt_metal_roughness.cpp
builders/test_pt_metallic_flakes.cpp
builders/test_pt_mix_tex.cpp
builders/test_pt_obj.cpp
builders/test_pt_plastic.cpp
builders/test_pt_principled.cpp
builders/test_pt_principled_tex.cpp
builders/test_pt_thinglass.cpp
builders/test_pt_velvet.cpp
)
generate_export_header(ospray_testing)
+6 -11
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "Builder.h"
@@ -66,16 +66,11 @@ cpp::Group Boxes::buildGroup() const
model.setParam("color", cpp::CopiedData(color));
if (rendererType == "pathtracer" || rendererType == "scivis"
|| rendererType == "ao") {
cpp::Material material(rendererType, "obj");
if (rendererType == "pathtracer" || rendererType == "scivis") {
material.setParam("ks", vec3f(0.3f));
material.setParam("ns", 10.f);
}
material.commit();
model.setParam("material", material);
}
cpp::Material material("obj");
material.setParam("ks", vec3f(0.3f));
material.setParam("ns", 10.f);
material.commit();
model.setParam("material", material);
model.commit();
+20 -21
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "Builder.h"
@@ -50,7 +50,7 @@ cpp::World Builder::buildWorld(
}
cpp::TransferFunction Builder::makeTransferFunction(
const vec2f &valueRange) const
const range1f &valueRange) const
{
cpp::TransferFunction transferFunction("piecewiseLinear");
@@ -86,13 +86,15 @@ cpp::TransferFunction Builder::makeTransferFunction(
transferFunction.setParam("color", cpp::CopiedData(colors));
transferFunction.setParam("opacity", cpp::CopiedData(opacities));
transferFunction.setParam("valueRange", valueRange);
transferFunction.setParam("value", valueRange);
transferFunction.commit();
return transferFunction;
}
cpp::Instance Builder::makeGroundPlane(const box3f &bounds) const
cpp::Instance Builder::makeGroundPlane(const box3f &bounds,
const vec4f &planeColor,
const vec4f &stripeColor) const
{
auto planeExtent = 0.8f * length(bounds.center() - bounds.lower);
@@ -106,7 +108,6 @@ cpp::Instance Builder::makeGroundPlane(const box3f &bounds) const
unsigned int startingIndex = 0;
const vec3f up = vec3f{0.f, 1.f, 0.f};
const vec4f gray = vec4f{0.9f, 0.9f, 0.9f, 0.75f};
v_position.emplace_back(-planeExtent, -1.f, -planeExtent);
v_position.emplace_back(planeExtent, -1.f, -planeExtent);
@@ -118,10 +119,10 @@ cpp::Instance Builder::makeGroundPlane(const box3f &bounds) const
v_normal.push_back(up);
v_normal.push_back(up);
v_color.push_back(gray);
v_color.push_back(gray);
v_color.push_back(gray);
v_color.push_back(gray);
v_color.push_back(planeColor);
v_color.push_back(planeColor);
v_color.push_back(planeColor);
v_color.push_back(planeColor);
indices.emplace_back(
startingIndex, startingIndex + 1, startingIndex + 2, startingIndex + 3);
@@ -131,8 +132,6 @@ cpp::Instance Builder::makeGroundPlane(const box3f &bounds) const
const float paddedExtent = planeExtent + stripeWidth;
const size_t numStripes = 10;
const vec4f stripeColor = vec4f{1.0f, 0.1f, 0.1f, 1.f};
for (size_t i = 0; i < numStripes; i++) {
// the center coordinate of the stripe, either in the x or z
// direction
@@ -166,10 +165,13 @@ cpp::Instance Builder::makeGroundPlane(const box3f &bounds) const
// z-direction stripes
startingIndex = v_position.size();
v_position.emplace_back(coord - stripeWidth, yLevel, -paddedExtent);
v_position.emplace_back(coord + stripeWidth, yLevel, -paddedExtent);
v_position.emplace_back(coord + stripeWidth, yLevel, paddedExtent);
v_position.emplace_back(coord - stripeWidth, yLevel, paddedExtent);
// offset another epsilon to avoid z-figthing for primID AOV
const float yLevel2 = yLevel + 1e-4f;
v_position.emplace_back(coord - stripeWidth, yLevel2, -paddedExtent);
v_position.emplace_back(coord + stripeWidth, yLevel2, -paddedExtent);
v_position.emplace_back(coord + stripeWidth, yLevel2, paddedExtent);
v_position.emplace_back(coord - stripeWidth, yLevel2, paddedExtent);
v_normal.push_back(up);
v_normal.push_back(up);
@@ -194,12 +196,9 @@ cpp::Instance Builder::makeGroundPlane(const box3f &bounds) const
cpp::GeometricModel plane(planeGeometry);
if (rendererType == "pathtracer" || rendererType == "scivis"
|| rendererType == "ao") {
cpp::Material material(rendererType, "obj");
material.commit();
plane.setParam("material", material);
}
cpp::Material material("obj");
material.commit();
plane.setParam("material", material);
plane.commit();
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
@@ -40,9 +40,11 @@ struct Builder : public memory::RefCountedObject,
static Builder *createBuilder(const std::string &name);
protected:
cpp::TransferFunction makeTransferFunction(const vec2f &valueRange) const;
cpp::TransferFunction makeTransferFunction(const range1f &valueRange) const;
cpp::Instance makeGroundPlane(const box3f &bounds) const;
cpp::Instance makeGroundPlane(const box3f &bounds,
const vec4f &planeColor = vec4f{0.9f, 0.9f, 0.9f, 0.75f},
const vec4f &stripeColor = vec4f{1.0f, 0.1f, 0.1f, 1.f}) const;
// Data //
@@ -1,4 +1,4 @@
// Copyright 2020-2021 Intel Corporation
// Copyright 2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "Builder.h"
@@ -63,13 +63,10 @@ cpp::Group ClippingGeometries::buildGroup() const
spheresGeometry.commit();
cpp::GeometricModel model(spheresGeometry);
if (rendererType == "pathtracer" || rendererType == "scivis"
|| rendererType == "ao") {
cpp::Material material(rendererType, "obj");
material.setParam("kd", vec3f(.1f, .4f, .8f));
material.commit();
model.setParam("material", material);
}
cpp::Material material("obj");
material.setParam("kd", vec3f(.1f, .4f, .8f));
material.commit();
model.setParam("material", material);
model.commit();
cpp::Group group;
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "Builder.h"
@@ -110,26 +110,6 @@ static std::vector<vec3f> vertices = {
{0.14f, -1.00f, 0.67f},
{0.71f, -1.00f, 0.49f}};
static std::vector<vec4ui> indices = {
{0, 1, 2, 3}, // Floor
{4, 5, 6, 7}, // Ceiling
{8, 9, 10, 11}, // Backwall
{12, 13, 14, 15}, // RightWall
{16, 17, 18, 19}, // LeftWall
{20, 21, 22, 23}, // ShortBox Top Face
{24, 25, 26, 27}, // ShortBox Left Face
{28, 29, 30, 31}, // ShortBox Front Face
{32, 33, 34, 35}, // ShortBox Right Face
{36, 37, 38, 39}, // ShortBox Back Face
{40, 41, 42, 43}, // ShortBox Bottom Face
{44, 45, 46, 47}, // TallBox Top Face
{48, 49, 50, 51}, // TallBox Left Face
{52, 53, 54, 55}, // TallBox Front Face
{56, 57, 58, 59}, // TallBox Right Face
{60, 61, 62, 63}, // TallBox Back Face
{64, 65, 66, 67} // TallBox Bottom Face
};
static std::vector<vec4f> colors = {
// Floor
{0.725f, 0.710f, 0.68f, 1.0f},
@@ -231,18 +211,14 @@ cpp::Group CornellBox::buildGroup() const
quadMesh.setParam("vertex.position", cpp::CopiedData(vertices));
quadMesh.setParam("vertex.color", cpp::CopiedData(colors));
quadMesh.setParam("index", cpp::CopiedData(indices));
quadMesh.setParam("quadSoup", true);
quadMesh.commit();
cpp::GeometricModel model(quadMesh);
// create and setup a material
if (rendererType == "pathtracer" || rendererType == "scivis"
|| rendererType == "ao") {
cpp::Material quadMeshMaterial(rendererType, "obj");
quadMeshMaterial.commit();
model.setParam("material", quadMeshMaterial);
}
cpp::Material quadMeshMaterial("obj");
quadMeshMaterial.commit();
model.setParam("material", quadMeshMaterial);
// Put the mesh and material into a model
model.commit();
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include <iostream>
@@ -75,6 +75,8 @@ cpp::Group Curves::buildGroup() const
cpp::CopiedData((vec3f *)points.data(), points.size(), sizeof(vec4f)));
} else if (curveVariant == "bspline") {
geom.setParam("basis", OSP_BSPLINE);
} else if (curveVariant == "bezier") {
geom.setParam("basis", OSP_BEZIER);
}
for (auto &c : s_colors) {
@@ -93,12 +95,12 @@ cpp::Group Curves::buildGroup() const
if (rendererType == "pathtracer") {
// create glass material and assign to geometry
cpp::Material glassMaterial(rendererType.c_str(), "thinGlass");
cpp::Material glassMaterial("thinGlass");
glassMaterial.setParam("attenuationDistance", 1.f);
glassMaterial.commit();
model.setParam("material", glassMaterial);
} else if (rendererType == "scivis" || rendererType == "ao") {
cpp::Material glassMaterial(rendererType.c_str(), "obj");
} else {
cpp::Material glassMaterial("obj");
glassMaterial.commit();
model.setParam("material", glassMaterial);
}
+21 -3
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "Builder.h"
@@ -11,12 +11,17 @@ namespace testing {
struct Empty : public detail::Builder
{
Empty() = default;
Empty(bool plane = false)
{
addPlane = plane;
}
~Empty() override = default;
void commit() override;
cpp::Group buildGroup() const override;
cpp::World buildWorld() const override;
};
// Inlined definitions ////////////////////////////////////////////////////
@@ -24,7 +29,6 @@ struct Empty : public detail::Builder
void Empty::commit()
{
Builder::commit();
addPlane = false;
}
cpp::Group Empty::buildGroup() const
@@ -34,7 +38,21 @@ cpp::Group Empty::buildGroup() const
return group;
}
cpp::World Empty::buildWorld() const
{
cpp::World world;
if (addPlane) {
std::vector<cpp::Instance> inst;
inst.push_back(makeGroundPlane(box3f(zero, one)));
world.setParam("instance", cpp::CopiedData(inst));
}
return world;
}
OSP_REGISTER_TESTING_BUILDER(Empty, empty);
OSP_REGISTER_TESTING_BUILDER(Empty(true), nolight);
} // namespace testing
} // namespace ospray
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "Builder.h"
@@ -83,7 +83,7 @@ void GravitySpheres::commit()
cpp::Group GravitySpheres::buildGroup() const
{
auto voxels = generateVoxels();
auto voxelRange = vec2f(0.f, 10.f);
auto voxelRange = range1f(0.f, 10.f);
cpp::Volume volume =
createAsAMR ? createAMRVolume(voxels) : createStructuredVolume(voxels);
@@ -110,22 +110,18 @@ cpp::Group GravitySpheres::buildGroup() const
cpp::GeometricModel isoModel(isoGeom);
if (rendererType == "pathtracer" || rendererType == "scivis"
|| rendererType == "ao") {
cpp::Material mat(rendererType, "obj");
mat.setParam("kd", vec3f(1.f));
mat.setParam("d", 0.5f);
if (rendererType == "pathtracer" || rendererType == "scivis")
mat.setParam("ks", vec3f(0.2f));
mat.commit();
cpp::Material mat("obj");
mat.setParam("kd", vec3f(1.f));
mat.setParam("d", 0.5f);
mat.setParam("ks", vec3f(0.2f));
mat.commit();
if (multipleIsosurfaces) {
std::vector<vec4f> colors = {
vec4f(0.2f, 0.2f, 0.8f, 1.f), vec4f(0.8f, 0.2f, 0.2f, 1.f)};
isoModel.setParam("color", cpp::CopiedData(colors));
}
isoModel.setParam("material", mat);
if (multipleIsosurfaces) {
std::vector<vec4f> colors = {
vec4f(0.2f, 0.2f, 0.8f, 1.f), vec4f(0.8f, 0.2f, 0.2f, 1.f)};
isoModel.setParam("color", cpp::CopiedData(colors));
}
isoModel.setParam("material", mat);
isoModel.commit();
@@ -0,0 +1,235 @@
// Copyright 2009 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "Builder.h"
#include "ospray_testing.h"
#include "rkcommon/utility/multidim_index_sequence.h"
#include "rkcommon/utility/random.h"
// stl
#include <random>
using namespace rkcommon::math;
namespace ospray {
namespace testing {
struct Instancing : public detail::Builder
{
Instancing() = default;
~Instancing() override = default;
void commit() override;
cpp::Group buildGroup() const override
{
return cpp::Group();
}
cpp::Group buildGroupA() const;
cpp::Group buildGroupB() const;
cpp::Group buildGroupC() const;
cpp::World buildWorld() const override;
private:
vec2ui numInstances{10, 10};
bool useIDs{false};
};
// Inlined definitions ////////////////////////////////////////////////////
// Helper functions //
namespace {
cpp::Geometry makeBoxGeometry(const box3f &box)
{
cpp::Geometry ospGeometry("box");
ospGeometry.setParam("box", cpp::CopiedData(box));
ospGeometry.commit();
return ospGeometry;
}
cpp::GeometricModel makeGeometricModel(
cpp::Geometry geo, const vec3f &kd, bool useIDs)
{
cpp::GeometricModel geometricModel(geo);
cpp::Material objMaterial("obj");
objMaterial.setParam("kd", kd);
objMaterial.commit();
geometricModel.setParam("material", objMaterial);
if (useIDs)
geometricModel.setParam("id", 44u);
geometricModel.commit();
return geometricModel;
}
cpp::Volume makeVolume(const vec3f &center)
{
cpp::Volume volume("structuredRegular");
{
const vec3i volumeCells{10, 10, 10};
const vec3f spacing{.25f};
volume.setParam("gridOrigin", center - volumeCells * spacing / 2.f);
volume.setParam("gridSpacing", spacing);
std::vector<float> voxels(volumeCells.long_product());
index_sequence_3D numCell(volumeCells);
for (const vec3i i : numCell)
voxels[numCell.flatten(i)] = length(volumeCells - i / 2.f);
volume.setParam("data", cpp::CopiedData(voxels.data(), volumeCells));
volume.commit();
}
return volume;
}
cpp::VolumetricModel makeVolumetricModel(cpp::Volume volume, bool useIDs)
{
cpp::VolumetricModel vModel(volume);
{
// Create transfer function
cpp::TransferFunction transferFunction("piecewiseLinear");
{
std::vector<vec3f> colors = {{.1f, .4f, .8f}};
std::vector<float> opacities = {1.f};
transferFunction.setParam("color", cpp::CopiedData(colors));
transferFunction.setParam("opacity", cpp::CopiedData(opacities));
transferFunction.setParam("value", range1f(0.f, 10.f));
transferFunction.commit();
}
vModel.setParam("transferFunction", transferFunction);
vModel.setParam("densityScale", .5f);
vModel.setParam("gradientShadingScale", 1.f);
if (useIDs)
vModel.setParam("id", 3u);
vModel.commit();
}
return vModel;
}
} // namespace
// Instancing definitions //
void Instancing::commit()
{
Builder::commit();
numInstances = getParam<vec2ui>("numInstances", numInstances);
useIDs = getParam<bool>("useIDs", useIDs);
}
cpp::Group Instancing::buildGroupA() const
{
cpp::Group group;
cpp::Geometry box = makeBoxGeometry(box3f(vec3f(-1.f), vec3f(1.f)));
cpp::GeometricModel geometricModel =
makeGeometricModel(box, vec3f(.1f, .4f, .8f), useIDs);
group.setParam("geometry", cpp::CopiedData(geometricModel));
cpp::Light light("quad");
light.setParam("position", vec3f(0.f, 6.f, 0.f));
light.setParam("edge1", vec3f(0.f, 0.f, -1.f));
light.setParam("edge2", vec3f(1.f, 0.f, 0.f));
light.setParam("intensity", 2.0f);
light.setParam("color", vec3f(2.6f, 2.5f, 2.3f));
light.commit();
group.setParam("light", cpp::CopiedData(light));
group.commit();
return group;
}
cpp::Group Instancing::buildGroupB() const
{
cpp::Group group;
std::vector<cpp::GeometricModel> models;
cpp::Geometry box = makeBoxGeometry(box3f(vec3f(-1.f), vec3f(0.f, 1.f, 1.f)));
models.emplace_back(makeGeometricModel(box, vec3f(.1f, .4f, .8f), useIDs));
box = makeBoxGeometry(box3f(vec3f(0.f, -1.f, -1.f), vec3f(1.f)));
models.emplace_back(makeGeometricModel(box, vec3f(.1f, .4f, .8f), useIDs));
group.setParam("geometry", cpp::CopiedData(models));
cpp::Light light("spot");
light.setParam("position", vec3f(0.f, 6.f, 0.f));
light.setParam("direction", vec3f(0.f, -1.f, 0.f));
light.setParam("openingAngle", 180.f);
light.setParam("penumbraAngle", 0.f);
light.setParam("radius", 0.3f);
light.setParam("intensity", 2.0f);
float lid1d[] = {0.f, 2.4f, 0.2f, 0.1f, 0.03f, 0.01f, 0.01f};
light.setParam("intensityDistribution", cpp::CopiedData(lid1d, 7));
light.setParam("color", vec3f(2.6f, 2.5f, 2.3f));
light.commit();
group.setParam("light", cpp::CopiedData(light));
group.commit();
return group;
}
cpp::Group Instancing::buildGroupC() const
{
cpp::Group group;
// Create volumetric model
group.setParam("volume",
cpp::CopiedData(makeVolumetricModel(makeVolume(vec3f(0.f)), useIDs)));
cpp::Light light("sphere");
light.setParam("position", vec3f(0.f, 2.f, 0.f));
light.setParam("radius", .25f);
light.setParam("intensity", 2.0f);
light.setParam("color", vec3f(2.6f, 2.5f, 2.3f));
light.commit();
group.setParam("light", cpp::CopiedData(light));
group.commit();
return group;
}
cpp::World Instancing::buildWorld() const
{
// Create all groups
std::vector<cpp::Group> groups;
groups.push_back(buildGroupA());
groups.push_back(buildGroupB());
groups.push_back(buildGroupC());
// Create instances
std::vector<cpp::Instance> instances;
{
const float spacing = 2.5f;
const vec2f totalSize = spacing * (numInstances - 1);
box3f sceneBounds;
index_sequence_2D indexInstances(numInstances);
for (const vec2ui i : indexInstances) {
const float h = .3f * (sin(.7f * i.x) + sin(.7f * i.y));
const vec3f position = spacing * vec3f(i.x, h, i.y)
- 0.5f * vec3f(totalSize.x, 0.0f, totalSize.y);
const float d = length(vec2f(position.x, position.z));
const int gId = int(.18f * d) % groups.size();
cpp::Instance instance(groups[gId]);
if (useIDs)
instance.setParam("id", i.y + 1);
const affine3f xfm = affine3f::translate(position)
* affine3f::rotate(vec3f(0.f, 1.f, 0.f), .03f * (15.f - d));
instance.setParam("transform",
affine3f::rotate(vec3f(-1.f, 0.f, 0.f), .3f * float(pi)) * xfm);
instance.commit();
instances.push_back(instance);
}
}
// Create world
cpp::World world;
world.setParam("instance", cpp::CopiedData(instances));
// Done
return world;
}
OSP_REGISTER_TESTING_BUILDER(Instancing, instancing);
} // namespace testing
} // namespace ospray
@@ -0,0 +1,188 @@
// Copyright 2022 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "Builder.h"
#include "ospray_testing.h"
// stl
#include <random>
using namespace rkcommon::math;
namespace ospray {
namespace testing {
struct Interpolation : public detail::Builder
{
Interpolation(
bool subd = false, unsigned int attrib = 0, unsigned int interp = 0)
: useSubd(subd), attribute(attrib), interpolation(interp)
{}
~Interpolation() override = default;
void commit() override;
cpp::Group buildGroup() const override;
cpp::World buildWorld() const override;
// TODO: support triangles
bool useSubd{false}; // otherwise Mesh
unsigned int attribute; // color, texcoord, normal
unsigned int interpolation; // face varying, vertex varying, uniform, constant
};
// quad mesh data
static std::vector<vec3f> vertices = {
// Left
{0.f, 0.f, 0.f},
{1.f, 0.f, 0.f},
{1.f, 1.f, 0.f},
{0.f, 1.f, 0.f},
// Right
{2.f, 0.f, 0.f},
{2.f, 1.f, 0.f}};
static std::vector<vec4ui> quad_indices = {
{0, 1, 2, 3}, // Left
{1, 4, 5, 2} // Right
};
static std::vector<unsigned int> subd_indices = {0, 1, 2, 3, 1, 4, 5, 2};
static std::vector<vec2f> texcoords = {{0.0f, 0.0f},
{0.1f, 0.0f},
{0.2f, 0.0f},
{0.3f, 0.0f},
{0.4f, 0.0f},
{0.5f, 0.0f},
{0.6f, 0.0f},
{0.7f, 0.0f}};
static std::vector<vec4f> colors = {{1.f, 0.f, 0.f, 1.f},
{0.f, 1.f, 0.f, 1.f},
{0.f, 0.f, 1.f, 1.f},
{1.f, 1.f, 0.f, 1.f},
{1.f, 0.f, 1.f, 1.f},
{1.f, 0.f, 1.f, 1.f}};
static std::vector<vec4f> colors_fv = {{1.f, 0.f, 0.f, 1.f},
{0.f, 1.f, 0.f, 1.f},
{0.f, 0.f, 1.f, 1.f},
{1.f, 1.f, 0.f, 1.f},
{1.f, 0.f, 1.f, 1.f},
{1.f, 0.f, 1.f, 1.f},
{1.f, 0.f, 1.f, 1.f},
{1.f, 0.f, 1.f, 1.f}};
static std::vector<vec3f> normals = {{1.f, 0.f, 0.f},
{0.f, 1.f, 0.f},
{0.f, 0.f, 1.f},
{1.f, 1.f, 0.f},
{1.f, 0.f, 1.f},
{1.f, 0.f, 1.f},
{1.f, 0.f, 1.f},
{1.f, 0.f, 1.f}};
// number of vertex indices per face
static std::vector<unsigned int> faces = {4, 4};
// Inlined definitions ////////////////////////////////////////////////////
void Interpolation::commit()
{
Builder::commit();
useSubd = getParam<bool>("useSubd", useSubd);
attribute = getParam<unsigned int>("attribute", attribute);
interpolation = getParam<unsigned int>("interpolation", interpolation);
addPlane = false;
}
cpp::Group Interpolation::buildGroup() const
{
cpp::Geometry mesh;
std::vector<vec4f> colors_mod = colors;
if (interpolation == 0)
colors_mod = colors_fv;
else if (interpolation == 2)
colors_mod.resize(2);
else if (interpolation == 3)
colors_mod.resize(1);
cpp::Texture tex("texture2d");
tex.setParam("format", OSP_TEXTURE_RGBA32F);
tex.setParam(
"data", cpp::CopiedData(colors_mod.data(), vec2ul(colors_mod.size(), 1)));
tex.commit();
cpp::Material mat("obj");
if (attribute == 1) // texture
mat.setParam("map_kd", tex);
mat.commit();
if (useSubd) {
mesh = cpp::Geometry("subdivision");
mesh.setParam("vertex.position", cpp::CopiedData(vertices));
mesh.setParam("face", cpp::CopiedData(faces));
mesh.setParam("level", 1.0f); // global level
mesh.setParam("index", cpp::CopiedData(subd_indices));
mesh.setParam("mode", OSP_SUBDIVISION_PIN_CORNERS);
} else {
mesh = cpp::Geometry("mesh");
mesh.setParam("vertex.position", cpp::CopiedData(vertices));
mesh.setParam("index", cpp::CopiedData(quad_indices));
}
if (interpolation == 0) {
if (attribute == 1)
mesh.setParam("texcoord", cpp::CopiedData(texcoords));
else if (attribute == 2)
mesh.setParam("normal", cpp::CopiedData(normals));
else
mesh.setParam("color", cpp::CopiedData(colors_mod));
} else if (interpolation == 1) {
if (attribute == 1)
mesh.setParam("vertex.texcoord", cpp::CopiedData(texcoords));
else if (attribute == 2)
mesh.setParam("vertex.normal", cpp::CopiedData(normals));
else
mesh.setParam("vertex.color", cpp::CopiedData(colors_mod));
}
mesh.commit();
cpp::GeometricModel model(mesh);
model.setParam("material", mat);
if ((attribute == 0) && interpolation == 2)
model.setParam("color", cpp::CopiedData(colors_mod));
else if ((attribute == 0) && interpolation == 3)
model.setParam("color", colors_mod[0]);
model.commit();
cpp::Group group;
group.setParam("geometry", cpp::CopiedData(model));
group.commit();
return group;
}
cpp::World Interpolation::buildWorld() const
{
auto world = Builder::buildWorld();
cpp::Light light("distant");
light.setParam("color", vec3f(0.78f, 0.551f, 0.183f));
light.setParam("intensity", 3.14f);
light.setParam("direction", vec3f(-0.8f, -0.6f, 0.3f));
light.commit();
cpp::Light ambient("ambient");
ambient.setParam("intensity", 0.35f);
ambient.setParam("visible", false);
ambient.commit();
std::vector<cpp::Light> lights{light, ambient};
world.setParam("light", cpp::CopiedData(lights));
return world;
}
OSP_REGISTER_TESTING_BUILDER(Interpolation, interpolation);
} // namespace testing
} // namespace ospray
@@ -0,0 +1,104 @@
// Copyright 2023 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "Builder.h"
#include "ospray_testing.h"
#include "rkcommon/utility/multidim_index_sequence.h"
using namespace rkcommon::math;
namespace ospray {
namespace testing {
struct MipMapTextures : public detail::Builder
{
MipMapTextures() = default;
~MipMapTextures() override = default;
void commit() override;
cpp::Group buildGroup() const override;
private:
float scale{1.0f};
OSPTextureFilter filter{OSP_TEXTURE_FILTER_LINEAR};
};
// Inlined definitions ////////////////////////////////////////////////////
void MipMapTextures::commit()
{
Builder::commit();
scale = getParam<float>("tcScale", 1.0f);
filter = static_cast<OSPTextureFilter>(
getParam<uint32_t>("filter", OSP_TEXTURE_FILTER_LINEAR));
addPlane = false;
}
cpp::Group MipMapTextures::buildGroup() const
{
std::vector<vec3f> v_position = {{-2.5f, -1.5f, -4.f},
{2.5f, -1.5f, -4.f},
{2.5f, 1.5f, 0.f},
{-2.5f, 1.5f, 0.f},
{-1.25f, 1.5f, -2.f},
{1.25f, 1.5f, -2.f},
{1.25f, 3.5f, -0.5f},
{-1.25f, 3.5f, -0.5f}};
std::vector<vec2f> v_texcoord = {{0.f, 0.f},
{scale, 0.f},
{scale, scale},
{0.f, scale},
{0.f, 0.f},
{scale, 0.f},
{scale, scale},
{0.f, scale}};
cpp::Geometry planeGeometry("mesh");
planeGeometry.setParam("vertex.position", cpp::CopiedData(v_position));
planeGeometry.setParam("vertex.texcoord", cpp::CopiedData(v_texcoord));
planeGeometry.setParam("quadSoup", true);
planeGeometry.commit();
vec2ul texSize(500, 500);
std::vector<uint8_t> texData(texSize.product());
uint8_t grayTexel{50};
uint8_t lightTexel{200};
for (size_t i = 0; i < texSize.x; i++) {
const int sz = 1 + i * 4 / texSize.x;
for (size_t j = 0; j < texSize.y; j++) {
texData[j * texSize.x + i] =
(i / sz + j / sz) % 2 ? lightTexel : grayTexel;
}
}
cpp::Texture procTex("texture2d");
procTex.setParam("format", OSP_TEXTURE_L8);
procTex.setParam("filter", filter);
procTex.setParam("data", cpp::CopiedData(texData.data(), texSize));
procTex.commit();
cpp::GeometricModel plane(planeGeometry);
cpp::Material material("obj");
material.setParam("map_kd", procTex);
material.setParam("map_kd.scale", vec2f(scale));
material.setParam("map_kd.translation", vec2f(0.5f - 0.5f / scale));
material.commit();
plane.setParam("material", material);
plane.commit();
cpp::Group planeGroup;
planeGroup.setParam("geometry", cpp::CopiedData(plane));
planeGroup.commit();
return planeGroup;
}
OSP_REGISTER_TESTING_BUILDER(MipMapTextures, mip_map_textures);
} // namespace testing
} // namespace ospray
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "Noise.h"
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "ospray_testing.h"
@@ -87,7 +87,7 @@ void ParticleVolume::commit()
{
Builder::commit();
numParticles = getParam<int>("numParticles", 1000);
numParticles = getParam<int>("numParticles", numParticles);
withVolume = getParam<bool>("withVolume", withVolume);
withIsosurface = getParam<bool>("withIsosurface", withIsosurface);
isovalue = getParam<float>("isovalue", 0.5f);
@@ -153,8 +153,8 @@ cpp::Group ParticleVolume::buildGroup() const
// AMK: VKL will set the correct valueRange, but we don't have a good way to
// get that to OSPRay yet. Use the weightRange instead.
model.setParam(
"transferFunction", makeTransferFunction(vec2f(0.f, weightRange.upper)));
model.setParam("transferFunction",
makeTransferFunction(range1f(0.f, weightRange.upper)));
model.commit();
cpp::Group group;
@@ -175,22 +175,18 @@ cpp::Group ParticleVolume::buildGroup() const
cpp::GeometricModel isoModel(isoGeom);
if (rendererType == "pathtracer" || rendererType == "scivis"
|| rendererType == "ao") {
cpp::Material mat(rendererType, "obj");
mat.setParam("kd", vec3f(1.f));
mat.setParam("d", 0.5f);
if (rendererType == "pathtracer" || rendererType == "scivis")
mat.setParam("ks", vec3f(0.2f));
mat.commit();
cpp::Material mat("obj");
mat.setParam("kd", vec3f(1.f));
mat.setParam("d", 0.5f);
mat.setParam("ks", vec3f(0.2f));
mat.commit();
if (multipleIsosurfaces) {
std::vector<vec4f> colors = {
vec4f(0.2f, 0.2f, 0.8f, 1.f), vec4f(0.8f, 0.2f, 0.2f, 1.f)};
isoModel.setParam("color", cpp::CopiedData(colors));
}
isoModel.setParam("material", mat);
if (multipleIsosurfaces) {
std::vector<vec4f> colors = {
vec4f(0.2f, 0.2f, 0.8f, 1.f), vec4f(0.8f, 0.2f, 0.2f, 1.f)};
isoModel.setParam("color", cpp::CopiedData(colors));
}
isoModel.setParam("material", mat);
isoModel.commit();
@@ -1,4 +1,4 @@
// Copyright 2009-2021 Intel Corporation
// Copyright 2009 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "Builder.h"
@@ -98,7 +98,7 @@ cpp::VolumetricModel createProceduralVolumetricModel(
volume.commit();
cpp::TransferFunction tfn("piecewiseLinear");
tfn.setParam("valueRange", voxelRange.toVec2());
tfn.setParam("value", voxelRange);
tfn.setParam("color", cpp::CopiedData(colors));
tfn.setParam("opacity", cpp::CopiedData(opacities));
tfn.commit();
@@ -113,18 +113,14 @@ cpp::VolumetricModel createProceduralVolumetricModel(
return volumeModel;
}
cpp::GeometricModel createGeometricModel(
cpp::Geometry geo, const std::string &rendererType, const vec3f &kd)
cpp::GeometricModel createGeometricModel(cpp::Geometry geo, const vec3f &kd)
{
cpp::GeometricModel geometricModel(geo);
if (rendererType == "pathtracer" || rendererType == "scivis"
|| rendererType == "ao") {
cpp::Material objMaterial(rendererType, "obj");
objMaterial.setParam("kd", kd);
objMaterial.commit();
geometricModel.setParam("material", objMaterial);
}
cpp::Material objMaterial("obj");
objMaterial.setParam("kd", kd);
objMaterial.commit();
geometricModel.setParam("material", objMaterial);
return geometricModel;
}
@@ -199,7 +195,7 @@ cpp::Group PerlinNoiseVolumes::buildGroup() const
gradientShadingScale));
}
for (auto volumetricModel : volumetricModels)
for (auto &volumetricModel : volumetricModels)
volumetricModel.commit();
std::vector<cpp::GeometricModel> geometricModels;
@@ -211,12 +207,12 @@ cpp::Group PerlinNoiseVolumes::buildGroup() const
makeBoxGeometry(box3f(vec3f(0.0f, -1.5f, 0.f), vec3f(2.f, 1.5f, 2.f)));
geometricModels.emplace_back(
createGeometricModel(box1, rendererType, vec3f(0.2f, 0.2f, 0.2f)));
createGeometricModel(box1, vec3f(0.2f, 0.2f, 0.2f)));
geometricModels.emplace_back(
createGeometricModel(box2, rendererType, vec3f(0.2f, 0.2f, 0.2f)));
createGeometricModel(box2, vec3f(0.2f, 0.2f, 0.2f)));
}
for (auto geometricModel : geometricModels)
for (auto &geometricModel : geometricModels)
geometricModel.commit();
if (!volumetricModels.empty())
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "Builder.h"
@@ -49,13 +49,10 @@ cpp::Group Planes::buildGroup() const
// Create geometric model
cpp::GeometricModel model(planeGeometry);
if (rendererType == "pathtracer" || rendererType == "scivis"
|| rendererType == "ao") {
cpp::Material material(rendererType, "obj");
material.setParam("kd", vec3f(.1f, .4f, .8f));
material.commit();
model.setParam("material", material);
}
cpp::Material material("obj");
material.setParam("kd", vec3f(.1f, .4f, .8f));
material.commit();
model.setParam("material", material);
model.commit();
// Create group
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "Builder.h"
@@ -14,7 +14,7 @@ namespace testing {
struct Spheres : public detail::Builder
{
Spheres() = default;
Spheres(OSPSphereType type);
~Spheres() override = default;
void commit() override;
@@ -24,11 +24,14 @@ struct Spheres : public detail::Builder
private:
// Data //
OSPSphereType sphereType;
int numSpheres{100};
};
// Inlined definitions ////////////////////////////////////////////////////
Spheres::Spheres(OSPSphereType type) : sphereType(type) {}
void Spheres::commit()
{
Builder::commit();
@@ -70,7 +73,12 @@ cpp::Group Spheres::buildGroup() const
// create the sphere geometry, and assign attributes
cpp::Geometry spheresGeometry("sphere");
spheresGeometry.setParam("type", sphereType);
spheresGeometry.setParam("sphere.position", cpp::CopiedData(s_center));
if (sphereType == OSP_ORIENTED_DISC) {
spheresGeometry.setParam("sphere.normal", cpp::CopiedData(s_center));
}
spheresGeometry.setParam("sphere.radius", cpp::CopiedData(s_radius));
spheresGeometry.commit();
@@ -80,12 +88,12 @@ cpp::Group Spheres::buildGroup() const
if (rendererType == "pathtracer") {
// create glass material and assign to geometry
cpp::Material glassMaterial(rendererType.c_str(), "thinGlass");
cpp::Material glassMaterial("thinGlass");
glassMaterial.setParam("attenuationDistance", 0.2f);
glassMaterial.commit();
model.setParam("material", glassMaterial);
} else if (rendererType == "scivis" || rendererType == "ao") {
cpp::Material glassMaterial(rendererType.c_str(), "obj");
} else {
cpp::Material glassMaterial("obj");
glassMaterial.commit();
model.setParam("material", glassMaterial);
}
@@ -100,7 +108,9 @@ cpp::Group Spheres::buildGroup() const
return group;
}
OSP_REGISTER_TESTING_BUILDER(Spheres, random_spheres);
OSP_REGISTER_TESTING_BUILDER(Spheres(OSP_SPHERE), random_spheres);
OSP_REGISTER_TESTING_BUILDER(Spheres(OSP_DISC), random_discs);
OSP_REGISTER_TESTING_BUILDER(Spheres(OSP_ORIENTED_DISC), random_oriented_discs);
} // namespace testing
} // namespace ospray
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "Builder.h"
@@ -114,12 +114,9 @@ cpp::Group Streamlines::buildGroup() const
cpp::GeometricModel model(slGeom);
if (rendererType == "pathtracer" || rendererType == "scivis"
|| rendererType == "ao") {
cpp::Material slMat(rendererType, "obj");
slMat.commit();
model.setParam("material", slMat);
}
cpp::Material slMat("obj");
slMat.commit();
model.setParam("material", slMat);
model.commit();
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "Builder.h"
@@ -29,7 +29,8 @@ cpp::Group SubdivisionCube::buildGroup() const
{-1.0f, 1.0f, -1.0f},
{1.0f, 1.0f, -1.0f},
{1.0f, 1.0f, 1.0f},
{-1.0f, 1.0f, 1.0f}};
{-1.0f, 1.0f, 1.0f},
/*WA: pad for Embree*/ {0.0f}};
// color per vertex
std::vector<vec4f> colors = {{0.0f, 0.0f, 0.0f, 1.f},
@@ -114,12 +115,9 @@ cpp::Group SubdivisionCube::buildGroup() const
cpp::GeometricModel model(geometry);
if (rendererType == "pathtracer" || rendererType == "scivis"
|| rendererType == "ao") {
cpp::Material material(rendererType, "obj");
material.commit();
model.setParam("material", material);
}
cpp::Material material("obj");
material.commit();
model.setParam("material", material);
model.commit();
@@ -57,33 +57,29 @@ cpp::Group Transparency::buildGroup() const
// Create geometric model
cpp::GeometricModel gModel(planeGeometry);
{
if (rendererType == "pathtracer" || rendererType == "scivis"
|| rendererType == "ao") {
std::vector<vec3f> colors = {{.8f, 0.f, 0.f},
{0.f, .8f, 0.f},
{0.f, 0.f, .8f},
{.8f, .8f, .8f},
{.5f, 0.f, 0.f},
{0.f, .5f, 0.f},
{0.f, 0.f, .5f}};
std::vector<vec3f> transmissions = {{0.f, 0.f, 0.f},
{0.f, 0.f, 0.f},
{0.f, 0.f, 0.f},
{0.f, 0.f, 0.f},
{.8f, 0.f, 0.f},
{0.f, .8f, 0.f},
{0.f, 0.f, .8f}};
std::vector<cpp::Material> materials;
for (uint32_t i = 0; i < std::min(colors.size(), transmissions.size());
i++) {
materials.emplace_back(cpp::Material(rendererType, "obj"));
materials[i].setParam("kd", colors[i]);
if (rendererType == "pathtracer" || rendererType == "scivis")
materials[i].setParam("tf", transmissions[i]);
materials[i].commit();
}
gModel.setParam("material", cpp::CopiedData(materials));
std::vector<vec3f> colors = {{.8f, 0.f, 0.f},
{0.f, .8f, 0.f},
{0.f, 0.f, .8f},
{.8f, .8f, .8f},
{.5f, 0.f, 0.f},
{0.f, .5f, 0.f},
{0.f, 0.f, .5f}};
std::vector<vec3f> transmissions = {{0.f, 0.f, 0.f},
{0.f, 0.f, 0.f},
{0.f, 0.f, 0.f},
{0.f, 0.f, 0.f},
{.8f, 0.f, 0.f},
{0.f, .8f, 0.f},
{0.f, 0.f, .8f}};
std::vector<cpp::Material> materials;
for (uint32_t i = 0; i < std::min(colors.size(), transmissions.size());
i++) {
materials.emplace_back(cpp::Material("obj"));
materials[i].setParam("kd", colors[i]);
materials[i].setParam("tf", transmissions[i]);
materials[i].commit();
}
gModel.setParam("material", cpp::CopiedData(materials));
gModel.commit();
}
@@ -116,7 +112,7 @@ cpp::Group Transparency::buildGroup() const
std::vector<float> opacities = {1.f};
transferFunction.setParam("color", cpp::CopiedData(colors));
transferFunction.setParam("opacity", cpp::CopiedData(opacities));
transferFunction.setParam("valueRange", vec2f(0.f, 10.f));
transferFunction.setParam("value", range1f(0.f, 10.f));
transferFunction.commit();
}
@@ -1,4 +1,4 @@
// Copyright 2009-2021 Intel Corporation
// Copyright 2009 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "Builder.h"
@@ -85,7 +85,7 @@ std::array<bool, 256> primsNotAllowed;
void initializeFromArray(const std::vector<std::vector<uint32_t>> &array)
{
for (auto order : array) {
for (auto &order : array) {
uint32_t mask = 0;
for (uint32_t i : order)
mask |= (1 << i);
@@ -98,7 +98,7 @@ void initializeFromArray(const std::vector<std::vector<uint32_t>> &array)
void initializePrims()
{
// Initialize degenerate tetrahedrons
for (auto order : tetraNotAllowed) {
for (auto &order : tetraNotAllowed) {
uint32_t mask = 0;
for (uint32_t i : order)
mask |= (1 << i);
@@ -313,16 +313,12 @@ cpp::Group UnstructuredVolumeGen::buildGroup() const
cpp::GeometricModel isoModel(isoGeom);
if (rendererType == "pathtracer" || rendererType == "scivis"
|| rendererType == "ao") {
cpp::Material mat(rendererType, "obj");
mat.setParam("kd", vec3f(0.8f));
if (rendererType == "pathtracer" || rendererType == "scivis")
mat.setParam("ks", vec3f(0.2f));
mat.commit();
cpp::Material mat("obj");
mat.setParam("kd", vec3f(0.8f));
mat.setParam("ks", vec3f(0.2f));
mat.commit();
isoModel.setParam("material", mat);
}
isoModel.setParam("material", mat);
isoModel.commit();
@@ -330,7 +326,8 @@ cpp::Group UnstructuredVolumeGen::buildGroup() const
} else {
cpp::VolumetricModel model(volume);
model.setParam("transferFunction",
makeTransferFunction(showCells ? vec2f{0.f, 1.f} : vec2f{-.4f, -.05f}));
makeTransferFunction(
showCells ? range1f{0.f, 1.f} : range1f{-.4f, -.05f}));
model.setParam("densityScale", densityScale);
model.commit();
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "Builder.h"
@@ -1,4 +1,4 @@
// Copyright 2020-2021 Intel Corporation
// Copyright 2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "Builder.h"
@@ -14,7 +14,7 @@ namespace testing {
struct VdbVolume : public detail::Builder
{
VdbVolume() = default;
VdbVolume(bool packed = false) : packed(packed) {}
~VdbVolume() override = default;
void commit() override;
@@ -25,6 +25,7 @@ struct VdbVolume : public detail::Builder
private:
float densityScale{1.f};
float anisotropy{0.f};
bool packed{false};
static constexpr uint32_t domainRes = 128;
};
@@ -42,17 +43,17 @@ cpp::Group VdbVolume::buildGroup() const
{
cpp::Volume volume("vdb");
std::vector<uint32_t> level;
std::vector<vec3i> origin;
std::vector<cpp::CopiedData> data;
std::vector<float> dataPacked;
constexpr uint32_t leafRes = 8;
constexpr uint32_t N = domainRes / leafRes;
constexpr size_t numLeaves = N * static_cast<size_t>(N) * N;
level.reserve(numLeaves);
origin.reserve(numLeaves);
data.reserve(numLeaves);
if (!packed)
data.reserve(numLeaves);
std::vector<float> leaf(leafRes * (size_t)leafRes * leafRes, 0.f);
for (uint32_t z = 0; z < N; ++z)
@@ -80,21 +81,30 @@ cpp::Group VdbVolume::buildGroup() const
leafValueRange[0].extend(vr);
if (leafValueRange[0].lower != 0.f || leafValueRange[0].upper != 0.f) {
level.push_back(3);
origin.push_back(vec3i(x * leafRes, y * leafRes, z * leafRes));
data.emplace_back(
cpp::CopiedData(leaf.data(), vec3ul(leafRes, leafRes, leafRes)));
if (packed)
std::copy(leaf.begin(), leaf.end(), std::back_inserter(dataPacked));
else
data.emplace_back(cpp::CopiedData(
leaf.data(), vec3ul(leafRes, leafRes, leafRes)));
}
}
if (level.empty())
if (origin.empty())
throw std::runtime_error("vdb volume is empty.");
volume.setParam("filter", (int)OSP_VOLUME_FILTER_TRILINEAR);
volume.setParam("gradientFilter", (int)OSP_VOLUME_FILTER_TRILINEAR);
volume.setParam("node.level", cpp::CopiedData(level));
volume.setParam("filter", OSP_VOLUME_FILTER_LINEAR);
volume.setParam("gradientFilter", OSP_VOLUME_FILTER_LINEAR);
volume.setParam(
"node.level", cpp::CopiedData(std::vector<uint32_t>(origin.size(), 3)));
volume.setParam("node.origin", cpp::CopiedData(origin));
volume.setParam("node.data", cpp::CopiedData(data));
if (packed) {
volume.setParam("nodesPackedDense", cpp::CopiedData(dataPacked));
volume.setParam("node.format",
cpp::CopiedData(std::vector<OSPVolumeFormat>(
origin.size(), OSP_VOLUME_FORMAT_DENSE_ZYX)));
} else
volume.setParam("node.data", cpp::CopiedData(data));
volume.commit();
cpp::VolumetricModel model(volume);
@@ -145,6 +155,7 @@ cpp::World VdbVolume::buildWorld() const
}
OSP_REGISTER_TESTING_BUILDER(VdbVolume, vdb_volume);
OSP_REGISTER_TESTING_BUILDER(VdbVolume(true), vdb_volume_packed);
} // namespace testing
} // namespace ospray
@@ -0,0 +1,78 @@
// Copyright 2009 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "test_pt_material.h"
namespace ospray {
namespace testing {
struct PtAlloyRoughness : public PtMaterial
{
PtAlloyRoughness() = default;
~PtAlloyRoughness() override = default;
std::vector<cpp::Material> buildMaterials() const override;
};
static cpp::Material makeAlloyMaterial(
vec3f color, vec3f edgeColor, float roughness)
{
cpp::Material mat("alloy");
mat.setParam("color", color);
mat.setParam("edgeColor", edgeColor);
mat.setParam("roughness", roughness);
mat.commit();
return mat;
}
// Inlined definitions ////////////////////////////////////////////////////
std::vector<cpp::Material> PtAlloyRoughness::buildMaterials() const
{
std::vector<cpp::Material> materials;
constexpr int dimSize = 5;
index_sequence_2D numSpheres(dimSize);
// Silver
for (int i = 0; i < dimSize; ++i) {
materials.push_back(makeAlloyMaterial(vec3f(.66f, .66f, .67f),
vec3f(1.f, 1.f, 1.f),
float(i) / (dimSize - 1)));
}
// Aluminium
for (int i = 0; i < dimSize; ++i) {
materials.push_back(makeAlloyMaterial(vec3f(.52f, .52f, .5f),
vec3f(1.f, 1.f, 1.f),
float(i) / (dimSize - 1)));
}
// Gold
for (int i = 0; i < dimSize; ++i) {
materials.push_back(makeAlloyMaterial(vec3f(.83f, .68f, .21f),
vec3f(1.f, 1.f, 1.f),
float(i) / (dimSize - 1)));
}
// Chromium
for (int i = 0; i < dimSize; ++i) {
materials.push_back(makeAlloyMaterial(vec3f(.65f, .66f, .67f),
vec3f(1.f, 1.f, 1.f),
float(i) / (dimSize - 1)));
}
// Copper
for (int i = 0; i < dimSize; ++i) {
materials.push_back(makeAlloyMaterial(vec3f(.72f, .45f, .2f),
vec3f(1.f, 1.f, 1.f),
float(i) / (dimSize - 1)));
}
return materials;
}
OSP_REGISTER_TESTING_BUILDER(PtAlloyRoughness, test_pt_alloy_roughness);
} // namespace testing
} // namespace ospray
@@ -0,0 +1,74 @@
// Copyright 2009 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "test_pt_material.h"
namespace ospray {
namespace testing {
struct PtCarPaint : public PtMaterial
{
PtCarPaint() = default;
~PtCarPaint() override = default;
std::vector<cpp::Material> buildMaterials() const override;
};
static cpp::Material makeCarPaintMaterial(
std::initializer_list<std::pair<std::string, float>> params)
{
cpp::Material mat("carPaint");
mat.setParam("baseColor", vec3f(0.0177f, 0.189f, 0.590f));
mat.setParam("flakeColor", vec3f(0.277f, 0.717f, 0.990f));
mat.setParam("flipflopColor", vec3f(0.252f, 0.0385f, 0.550f));
for (auto &param : params)
mat.setParam(param.first, param.second);
mat.commit();
return mat;
}
// Inlined definitions ////////////////////////////////////////////////////
std::vector<cpp::Material> PtCarPaint::buildMaterials() const
{
std::vector<cpp::Material> materials;
constexpr int dimSize = 5;
index_sequence_2D numSpheres(dimSize);
// flakeDensity
for (int i = 0; i < dimSize; i++)
materials.push_back(makeCarPaintMaterial(
{{"flakeDensity", float(i) / (dimSize - 1)}, {"flakeScale", 1000.f}}));
// flipflopFalloff
for (int i = 0; i < dimSize; i++)
materials.push_back(makeCarPaintMaterial({{"flakeDensity", 1.f},
{"flakeScale", 1000.f},
{"flipflopFalloff", 1.f - float(i) / (dimSize - 1)}}));
// flakeScale
for (int i = 0; i < dimSize; i++)
materials.push_back(makeCarPaintMaterial({{"flakeDensity", 1.f},
{"flakeScale", lerp(float(i) / (dimSize - 1), 1000.f, 100.f)}}));
// flakeRoughness
for (int i = 0; i < dimSize; i++)
materials.push_back(makeCarPaintMaterial({{"flakeDensity", 1.f},
{"flakeScale", 1000.f},
{"flakeRoughness", float(i) / (dimSize - 1)}}));
// coat
for (int i = 0; i < dimSize; i++)
materials.push_back(
makeCarPaintMaterial({{"coat", float(i) / (dimSize - 1)}}));
return materials;
}
OSP_REGISTER_TESTING_BUILDER(PtCarPaint, test_pt_carpaint);
} // namespace testing
} // namespace ospray
@@ -1,31 +1,23 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "Builder.h"
#include "ospray_testing.h"
#include "rkcommon/utility/multidim_index_sequence.h"
using namespace rkcommon::math;
#include "test_pt_material.h"
namespace ospray {
namespace testing {
struct PtGlass : public detail::Builder
struct PtGlass : public PtMaterial
{
PtGlass() = default;
~PtGlass() override = default;
void commit() override;
cpp::Group buildGroup() const override;
std::vector<cpp::Material> buildMaterials() const override;
};
static cpp::Material makeGlassMaterial(const std::string &rendererType,
float eta,
vec3f color,
float attenuationDistance)
static cpp::Material makeGlassMaterial(
float eta, vec3f color, float attenuationDistance)
{
cpp::Material mat(rendererType, "glass");
cpp::Material mat("glass");
mat.setParam("eta", eta);
mat.setParam("attenuationColor", color);
mat.setParam("attenuationDistance", attenuationDistance);
@@ -36,50 +28,20 @@ static cpp::Material makeGlassMaterial(const std::string &rendererType,
// Inlined definitions ////////////////////////////////////////////////////
void PtGlass::commit()
std::vector<cpp::Material> PtGlass::buildMaterials() const
{
Builder::commit();
addPlane = false;
}
cpp::Group PtGlass::buildGroup() const
{
cpp::Geometry sphereGeometry("sphere");
constexpr int dimSize = 5;
index_sequence_2D numSpheres(dimSize);
std::vector<vec3f> spheres;
std::vector<uint8_t> index;
std::vector<cpp::Material> materials;
constexpr int dimSize = 5;
index_sequence_2D numSpheres(dimSize);
for (auto i : numSpheres) {
auto i_f = static_cast<vec2f>(i);
spheres.emplace_back(i_f.x, i_f.y, 0.f);
materials.push_back(makeGlassMaterial(rendererType,
lerp(i_f.x / (dimSize - 1), 1.f, 5.f),
vec3f(1.f, 0.25f, 0.f),
lerp(i_f.y / (dimSize - 1), 0.5f, 5.f)));
index.push_back(numSpheres.flatten(i));
materials.push_back(makeGlassMaterial(lerp(i_f.x / (dimSize - 1), 1.f, 2.f),
vec3f(.1f, .5f, 1.f),
lerp(1.f - i_f.y / (dimSize - 1), 0.5f, 5.f)));
}
sphereGeometry.setParam("sphere.position", cpp::CopiedData(spheres));
sphereGeometry.setParam("radius", 0.4f);
sphereGeometry.commit();
cpp::GeometricModel model(sphereGeometry);
model.setParam("material", cpp::CopiedData(materials));
model.setParam("index", cpp::CopiedData(index));
model.commit();
cpp::Group group;
group.setParam("geometry", cpp::CopiedData(model));
group.commit();
return group;
return materials;
}
OSP_REGISTER_TESTING_BUILDER(PtGlass, test_pt_glass);
@@ -1,55 +1,39 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "Builder.h"
#include "ospray_testing.h"
#include "test_pt_material.h"
using namespace rkcommon::math;
namespace ospray {
namespace testing {
struct PtLuminous : public detail::Builder
struct PtLuminous : public PtMaterial
{
PtLuminous() = default;
~PtLuminous() override = default;
cpp::Group buildGroup() const override;
cpp::World buildWorld() const override;
std::vector<cpp::Material> buildMaterials() const override;
};
// Inlined definitions ////////////////////////////////////////////////////
cpp::Group PtLuminous::buildGroup() const
std::vector<cpp::Material> PtLuminous::buildMaterials() const
{
cpp::Geometry sphereGeometry("sphere");
std::vector<cpp::Material> materials;
constexpr int dimSize = 5;
index_sequence_2D numSpheres(dimSize);
sphereGeometry.setParam("sphere.position", cpp::CopiedData(vec3f(0.f)));
sphereGeometry.setParam("radius", 1.f);
sphereGeometry.commit();
for (auto i : numSpheres) {
auto i_f = static_cast<vec2f>(i);
materials.push_back(cpp::Material("luminous"));
materials.back().setParam("color", vec3f(0.7f, 0.7f, 1.f));
materials.back().setParam("intensity", i_f.x / (dimSize - 1));
materials.back().setParam("transparency", 1.f - i_f.y / (dimSize - 1));
materials.back().commit();
}
cpp::GeometricModel model(sphereGeometry);
cpp::Material material(rendererType, "luminous");
material.setParam("color", vec3f(0.7f, 0.7f, 1.f));
material.commit();
model.setParam("material", material);
model.commit();
cpp::Group group;
group.setParam("geometry", cpp::CopiedData(model));
group.commit();
return group;
}
cpp::World PtLuminous::buildWorld() const
{
auto world = Builder::buildWorld();
world.removeParam("light");
return world;
return materials;
}
OSP_REGISTER_TESTING_BUILDER(PtLuminous, test_pt_luminous);
@@ -0,0 +1,111 @@
// Copyright 2009 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "Builder.h"
#include "ospray_testing.h"
#include "rkcommon/utility/multidim_index_sequence.h"
using namespace rkcommon::math;
namespace ospray {
namespace testing {
struct PtMaterial : public detail::Builder
{
PtMaterial() = default;
~PtMaterial() override = default;
cpp::Group buildGroup() const override;
cpp::World buildWorld() const override;
virtual std::vector<cpp::Material> buildMaterials() const = 0;
};
// Inlined definitions ////////////////////////////////////////////////////
inline cpp::Group PtMaterial::buildGroup() const
{
cpp::Geometry sphereGeometry("sphere");
std::vector<cpp::Material> materials = buildMaterials();
const int dimCount = sqrtf(materials.size());
const int dimSize = dimCount - 1;
index_sequence_2D numSpheres(dimCount);
std::vector<vec3f> spheres;
std::vector<uint8_t> index;
for (auto i : numSpheres) {
auto i_f = static_cast<vec2f>(i);
spheres.emplace_back(dimSize / 2.f - i_f.x, dimSize / 2.f - i_f.y, .6f);
index.push_back(numSpheres.flatten(i));
}
sphereGeometry.setParam("sphere.position", cpp::CopiedData(spheres));
sphereGeometry.setParam("radius", 0.4f);
sphereGeometry.commit();
cpp::GeometricModel model(sphereGeometry);
model.setParam("material", cpp::CopiedData(materials));
model.setParam("index", cpp::CopiedData(index));
model.commit();
cpp::Group group;
group.setParam("geometry", cpp::CopiedData(model));
group.commit();
return group;
}
inline cpp::World PtMaterial::buildWorld() const
{
cpp::World world;
cpp::Group group = buildGroup();
cpp::Instance groupInstance(group);
groupInstance.commit();
box3f bbox = group.getBounds<box3f>();
bbox.lower -= .4f;
bbox.upper += .4f;
cpp::Instance planeInstance = makeGroundPlane(
bbox, vec4f(.9f, .9f, .9f, 1.f), vec4f(.2f, .2f, .2f, 1.f));
planeInstance.setParam(
"xfm", affine3f::rotate(vec3f(-1.f, 0.f, 0.f), half_pi));
planeInstance.commit();
std::vector<cpp::Instance> instances;
instances.push_back(groupInstance);
instances.push_back(planeInstance);
world.setParam("instance", cpp::CopiedData(instances));
// Lights
{
std::vector<cpp::Light> lightHandles;
cpp::Light sphereLight("sphere");
sphereLight.setParam("intensity", 500.f);
sphereLight.setParam("position", vec3f(-15.f, 15.f, -20.f));
sphereLight.setParam("radius", 5.f);
sphereLight.commit();
cpp::Light ambientLight("ambient");
ambientLight.setParam("intensity", 0.4f);
ambientLight.setParam("color", vec3f(1.f));
ambientLight.commit();
lightHandles.push_back(sphereLight);
lightHandles.push_back(ambientLight);
world.setParam("light", cpp::CopiedData(lightHandles));
}
return world;
}
} // namespace testing
} // namespace ospray
@@ -0,0 +1,128 @@
// Copyright 2023 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "test_pt_tex.h"
namespace ospray {
namespace testing {
struct PtMaterialTex : public PtTex
{
PtMaterialTex() = default;
~PtMaterialTex() override = default;
std::vector<cpp::Material> buildMaterials(
const cpp::Texture &texR, const cpp::Texture &texRGBA) const override;
};
// Inlined definitions ////////////////////////////////////////////////////
std::vector<cpp::Material> PtMaterialTex::buildMaterials(
const cpp::Texture &texR, const cpp::Texture &texRGBA) const
{
std::vector<cpp::Material> materials;
// carPaint
{
// roughness
materials.push_back(cpp::Material("carPaint"));
materials.back().setParam("baseColor", vec3f(0.0177f, 0.189f, 0.590f));
setTexture<float>(materials.back(), "roughness", texR);
// flakeColor
materials.push_back(cpp::Material("carPaint"));
materials.back().setParam("baseColor", vec3f(0.0177f, 0.189f, 0.590f));
materials.back().setParam("flakeScale", 2000.f);
materials.back().setParam("flakeDensity", 1.f);
setTexture<vec3f>(materials.back(), "flakeColor", texRGBA);
// flakeDensity
materials.push_back(cpp::Material("carPaint"));
materials.back().setParam("baseColor", vec3f(0.0177f, 0.189f, 0.590f));
materials.back().setParam("flakeColor", vec3f(0.277f, 0.717f, 0.990f));
materials.back().setParam("flakeScale", 2000.f);
setTexture<float>(materials.back(), "flakeDensity", texR);
// flakeRoughness
materials.push_back(cpp::Material("carPaint"));
materials.back().setParam("baseColor", vec3f(0.0177f, 0.189f, 0.590f));
materials.back().setParam("flakeDensity", 1.f);
materials.back().setParam("flakeColor", vec3f(0.277f, 0.717f, 0.990f));
materials.back().setParam("flakeScale", 2000.f);
setTexture<float>(materials.back(), "flakeRoughness", texR);
// flipflopFalloff
materials.push_back(cpp::Material("carPaint"));
materials.back().setParam("baseColor", vec3f(0.0177f, 0.189f, 0.590f));
materials.back().setParam("flakeDensity", 1.f);
materials.back().setParam("flakeColor", vec3f(0.277f, 0.717f, 0.990f));
materials.back().setParam("flakeScale", 1000.f);
materials.back().setParam("flipflopColor", vec3f(0.252f, 0.0385f, 0.550f));
setTexture<float>(materials.back(), "flipflopFalloff", texR);
// coat
materials.push_back(cpp::Material("carPaint"));
materials.back().setParam("baseColor", vec3f(0.0177f, 0.189f, 0.590f));
setTexture<float>(materials.back(), "coat", texR);
// coatColor
materials.push_back(cpp::Material("carPaint"));
materials.back().setParam("baseColor", vec3f(0.0177f, 0.189f, 0.590f));
setTexture<vec3f>(materials.back(), "coatColor", texRGBA);
// coatRoughness
materials.push_back(cpp::Material("carPaint"));
materials.back().setParam("baseColor", vec3f(0.0177f, 0.189f, 0.590f));
setTexture<float>(materials.back(), "coatRoughness", texR);
}
// obj
{
// d
materials.push_back(cpp::Material("obj"));
setTexture<float>(materials.back(), "d", texR);
// Kd
materials.push_back(cpp::Material("obj"));
setTexture<vec3f>(materials.back(), "kd", texRGBA);
// Ks
materials.push_back(cpp::Material("obj"));
setTexture<vec3f>(materials.back(), "ks", texRGBA);
// Ns
materials.push_back(cpp::Material("obj"));
materials.back().setParam("ks", vec3f(1.f));
setTexture<float>(materials.back(), "ns", texR);
}
// other
{
// metal roughness
materials.push_back(cpp::Material("metal"));
materials.back().setParam("eta", vec3f(0.051, 0.043, 0.041));
materials.back().setParam("k", vec3f(5.3f, 3.6f, 2.3f));
setTexture<float>(materials.back(), "roughness", texR);
// luminous emissive
materials.push_back(cpp::Material("luminous"));
setTexture(materials.back(), "color", texRGBA, vec3f(1.f, 0.8f, 0.7f));
// alloy roughness
materials.push_back(cpp::Material("alloy"));
materials.back().setParam("color", vec3f(.72f, .45f, .2f));
materials.back().setParam("edgeColor", vec3f(1.f, 1.f, 1.f));
setTexture<float>(materials.back(), "roughness", texR);
// thinglass attenuationColor
materials.push_back(cpp::Material("thinGlass"));
setTexture<vec3f>(materials.back(), "attenuationColor", texRGBA);
}
return materials;
}
OSP_REGISTER_TESTING_BUILDER(PtMaterialTex, test_pt_material_tex);
} // namespace testing
} // namespace ospray
@@ -1,29 +1,22 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "Builder.h"
#include "ospray_testing.h"
#include "rkcommon/utility/multidim_index_sequence.h"
using namespace rkcommon::math;
#include "test_pt_material.h"
namespace ospray {
namespace testing {
struct PtMetalRoughness : public detail::Builder
struct PtMetalRoughness : public PtMaterial
{
PtMetalRoughness() = default;
~PtMetalRoughness() override = default;
void commit() override;
cpp::Group buildGroup() const override;
std::vector<cpp::Material> buildMaterials() const override;
};
static cpp::Material makeMetalMaterial(
const std::string &rendererType, vec3f eta, vec3f k, float roughness)
static cpp::Material makeMetalMaterial(vec3f eta, vec3f k, float roughness)
{
cpp::Material mat(rendererType, "metal");
cpp::Material mat("metal");
mat.setParam("eta", eta);
mat.setParam("k", k);
mat.setParam("roughness", roughness);
@@ -34,87 +27,48 @@ static cpp::Material makeMetalMaterial(
// Inlined definitions ////////////////////////////////////////////////////
void PtMetalRoughness::commit()
std::vector<cpp::Material> PtMetalRoughness::buildMaterials() const
{
Builder::commit();
addPlane = false;
}
cpp::Group PtMetalRoughness::buildGroup() const
{
cpp::Geometry sphereGeometry("sphere");
constexpr int dimSize = 5;
index_sequence_2D numSpheres(dimSize);
std::vector<vec3f> spheres;
std::vector<uint8_t> index;
for (auto i : numSpheres) {
auto i_f = static_cast<vec2f>(i);
spheres.emplace_back(i_f.x, i_f.y, 0.f);
index.push_back(numSpheres.flatten(i));
}
sphereGeometry.setParam("sphere.position", cpp::CopiedData(spheres));
sphereGeometry.setParam("radius", 0.4f);
sphereGeometry.commit();
cpp::GeometricModel model(sphereGeometry);
std::vector<cpp::Material> materials;
constexpr int dimSize = 5;
index_sequence_2D numSpheres(dimSize);
// Silver
for (int i = 0; i < dimSize; ++i) {
materials.push_back(makeMetalMaterial(rendererType,
vec3f(0.051, 0.043, 0.041),
vec3f(5.3, 3.6, 2.3),
float(i) / 4));
materials.push_back(makeMetalMaterial(vec3f(0.051f, 0.043f, 0.041f),
vec3f(5.3f, 3.6f, 2.3f),
float(i) / (dimSize - 1)));
}
// Aluminium
for (int i = 0; i < dimSize; ++i) {
materials.push_back(makeMetalMaterial(rendererType,
vec3f(1.5, 0.98, 0.6),
vec3f(7.6, 6.6, 5.4),
float(i) / 4));
materials.push_back(makeMetalMaterial(vec3f(1.5f, 0.98f, 0.6f),
vec3f(7.6f, 6.6f, 5.4f),
float(i) / (dimSize - 1)));
}
// Gold
for (int i = 0; i < dimSize; ++i) {
materials.push_back(makeMetalMaterial(rendererType,
vec3f(0.07, 0.37, 1.5),
vec3f(3.7, 2.3, 1.7),
float(i) / 4));
materials.push_back(makeMetalMaterial(vec3f(0.07f, 0.37f, 1.5f),
vec3f(3.7f, 2.3f, 1.7f),
float(i) / (dimSize - 1)));
}
// Chromium
for (int i = 0; i < dimSize; ++i) {
materials.push_back(makeMetalMaterial(rendererType,
vec3f(3.2, 3.1, 2.3),
vec3f(3.3, 3.3, 3.1),
float(i) / 4));
materials.push_back(makeMetalMaterial(vec3f(3.2f, 3.1f, 2.3f),
vec3f(3.3f, 3.3f, 3.1f),
float(i) / (dimSize - 1)));
}
// Copper
for (int i = 0; i < dimSize; ++i) {
materials.push_back(makeMetalMaterial(rendererType,
vec3f(0.1, 0.8, 1.1),
vec3f(3.5, 2.5, 2.4),
float(i) / 4));
materials.push_back(makeMetalMaterial(vec3f(0.1f, 0.8f, 1.1f),
vec3f(3.5f, 2.5f, 2.4f),
float(i) / (dimSize - 1)));
}
model.setParam("material", cpp::CopiedData(materials));
model.setParam("index", cpp::CopiedData(index));
model.commit();
cpp::Group group;
group.setParam("geometry", cpp::CopiedData(model));
group.commit();
return group;
return materials;
}
OSP_REGISTER_TESTING_BUILDER(PtMetalRoughness, test_pt_metal_roughness);
@@ -1,29 +1,23 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "Builder.h"
#include "ospray_testing.h"
#include "rkcommon/utility/multidim_index_sequence.h"
using namespace rkcommon::math;
#include "test_pt_material.h"
namespace ospray {
namespace testing {
struct PtMetallicFlakes : public detail::Builder
struct PtMetallicFlakes : public PtMaterial
{
PtMetallicFlakes() = default;
~PtMetallicFlakes() override = default;
void commit() override;
cpp::Group buildGroup() const override;
std::vector<cpp::Material> buildMaterials() const override;
};
static cpp::Material makeMetallicFlakesMaterial(
const std::string &rendererType, float flakeAmount, float flakeSpread)
float flakeAmount, float flakeSpread)
{
cpp::Material mat(rendererType, "metallicPaint");
cpp::Material mat("metallicPaint");
mat.setParam("baseColor", vec3f(1.f, 0.f, 0.f));
mat.setParam("flakeAmount", flakeAmount);
mat.setParam("flakeSpread", flakeSpread);
@@ -34,49 +28,20 @@ static cpp::Material makeMetallicFlakesMaterial(
// Inlined definitions ////////////////////////////////////////////////////
void PtMetallicFlakes::commit()
std::vector<cpp::Material> PtMetallicFlakes::buildMaterials() const
{
Builder::commit();
addPlane = false;
}
cpp::Group PtMetallicFlakes::buildGroup() const
{
cpp::Geometry sphereGeometry("sphere");
constexpr int dimSize = 5;
index_sequence_2D numSpheres(dimSize);
std::vector<vec3f> spheres;
std::vector<uint8_t> index;
std::vector<cpp::Material> materials;
constexpr int dimSize = 5;
index_sequence_2D numSpheres(dimSize);
for (auto i : numSpheres) {
auto i_f = static_cast<vec2f>(i);
spheres.emplace_back(i_f.x, i_f.y, 0.f);
materials.push_back(makeMetallicFlakesMaterial(rendererType,
lerp(i_f.x / (dimSize - 1), 1.f, 0.f),
lerp(i_f.y / (dimSize - 1), 1.f, 0.f)));
index.push_back(numSpheres.flatten(i));
materials.push_back(
makeMetallicFlakesMaterial(lerp(i_f.x / (dimSize - 1), 1.f, 0.f),
lerp(i_f.y / (dimSize - 1), 0.f, 1.f)));
}
sphereGeometry.setParam("sphere.position", cpp::CopiedData(spheres));
sphereGeometry.setParam("radius", 0.4f);
sphereGeometry.commit();
cpp::GeometricModel model(sphereGeometry);
model.setParam("material", cpp::CopiedData(materials));
model.setParam("index", cpp::CopiedData(index));
model.commit();
cpp::Group group;
group.setParam("geometry", cpp::CopiedData(model));
group.commit();
return group;
return materials;
}
OSP_REGISTER_TESTING_BUILDER(PtMetallicFlakes, test_pt_metallic_flakes);
@@ -0,0 +1,106 @@
// Copyright 2023 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "test_pt_tex.h"
namespace ospray {
namespace testing {
struct PtMixTex : public PtTex
{
PtMixTex() = default;
~PtMixTex() override = default;
std::vector<cpp::Material> buildMaterials(
const cpp::Texture &texR, const cpp::Texture &texRGBA) const override;
};
// Inlined definitions ////////////////////////////////////////////////////
std::vector<cpp::Material> PtMixTex::buildMaterials(
const cpp::Texture &texR, const cpp::Texture &texRGBA) const
{
std::vector<cpp::Material> materials;
// obj & thinGlass
{
cpp::Material obj("obj");
obj.commit();
cpp::Material thinGlass("thinGlass");
thinGlass.commit();
cpp::Material mix("mix");
mix.setParam("material1", obj);
mix.setParam("material2", thinGlass);
materials.push_back(mix);
setTexture<float>(materials.back(), "factor", texR);
}
// plastic & metal
{
cpp::Material plastic("plastic");
plastic.setParam("pigmentColor", vec3f(.8f, 0.f, 0.f));
plastic.commit();
cpp::Material metal("metal");
metal.commit();
cpp::Material mix("mix");
mix.setParam("material1", plastic);
mix.setParam("material2", metal);
materials.push_back(mix);
setTexture<float>(materials.back(), "factor", texR);
}
// velvet & metallicPaint
{
cpp::Material velvet("velvet");
cpp::Material metallicPaint("metallicPaint");
cpp::Material mix("mix");
velvet.commit();
metallicPaint.commit();
mix.setParam("material1", velvet);
mix.setParam("material2", metallicPaint);
materials.push_back(mix);
setTexture<float>(materials.back(), "factor", texR);
}
// carPaint & principled
{
cpp::Material carPaint("carPaint");
carPaint.setParam("baseColor", vec3f(.5f));
carPaint.setParam("flakeColor", vec3f(.8f));
carPaint.setParam("flakeDensity", 1.f);
carPaint.setParam("flakeScale", 1000.f);
carPaint.commit();
cpp::Material principled("principled");
principled.setParam("baseColor", vec3f(0.0177f, 0.189f, 0.590f));
principled.commit();
cpp::Material mix("mix");
mix.setParam("material1", carPaint);
mix.setParam("material2", principled);
materials.push_back(mix);
setTexture<float>(materials.back(), "factor", texR);
}
// emission: principled & luminous
{
cpp::Material principled("principled");
setTexture<vec3f>(principled, "emissiveColor", texRGBA, vec3f(4.6f, 0.1f, 0.1f));
principled.setParam("map_emissiveColor.scale", vec2f(0.7f, 0.3f));
principled.commit();
cpp::Material luminous("luminous");
luminous.setParam("color", vec3f(0.1f, 0.6f, 0.1f));
luminous.setParam("intensity", 5.0f);
luminous.commit();
cpp::Material mix("mix");
mix.setParam("material1", principled);
mix.setParam("material2", luminous);
materials.push_back(mix);
setTexture<float>(materials.back(), "factor", texR);
}
return materials;
}
OSP_REGISTER_TESTING_BUILDER(PtMixTex, test_pt_mix_tex);
} // namespace testing
} // namespace ospray
@@ -1,32 +1,28 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "Builder.h"
#include "ospray_testing.h"
#include "rkcommon/utility/multidim_index_sequence.h"
using namespace rkcommon::math;
#include "test_pt_material.h"
namespace ospray {
namespace testing {
struct PtObj : public detail::Builder
struct PtObj : public PtMaterial
{
PtObj() = default;
~PtObj() override = default;
void commit() override;
cpp::Group buildGroup() const override;
cpp::World buildWorld() const override;
std::vector<cpp::Material> buildMaterials() const override;
};
static cpp::Material makeObjMaterial(
const std::string &rendererType, vec3f Kd, vec3f Ks)
float d, vec3f Kd, vec3f Ks, float Ns, vec3f Tf)
{
cpp::Material mat(rendererType, "obj");
cpp::Material mat("obj");
mat.setParam("d", d);
mat.setParam("kd", Kd);
mat.setParam("ks", Ks);
mat.setParam("ns", Ns);
mat.setParam("tf", Tf);
mat.commit();
return mat;
@@ -34,75 +30,53 @@ static cpp::Material makeObjMaterial(
// Inlined definitions ////////////////////////////////////////////////////
void PtObj::commit()
std::vector<cpp::Material> PtObj::buildMaterials() const
{
Builder::commit();
addPlane = false;
}
cpp::Group PtObj::buildGroup() const
{
cpp::Geometry sphereGeometry("sphere");
std::vector<cpp::Material> materials;
constexpr int dimSize = 5;
index_sequence_2D numSpheres(dimSize);
std::vector<vec3f> spheres;
std::vector<uint8_t> index;
std::vector<cpp::Material> materials;
// d
for (int i = 0; i < dimSize; i++)
materials.push_back(makeObjMaterial(1.f - float(i) / (dimSize - 1),
vec3f(.8f, 0.f, 0.f),
vec3f(0.f),
10.f,
vec3f(0.f)));
for (auto i : numSpheres) {
auto i_f = static_cast<vec2f>(i);
spheres.emplace_back(i_f.x, i_f.y, 0.f);
// Kd
for (int i = 0; i < dimSize; i++)
materials.push_back(makeObjMaterial(1.f,
vec3f(1.f - float(i) / (dimSize - 1), 0.f, 0.f),
vec3f(0.f),
10.f,
vec3f(0.f)));
auto l = i_f / (dimSize - 1);
materials.push_back(makeObjMaterial(rendererType,
lerp(l.x, vec3f(0.1f), vec3f(1.f, 0.f, 0.f)),
lerp(l.y, vec3f(0.f), vec3f(1.f))));
// Ks
for (int i = 0; i < dimSize; i++)
materials.push_back(makeObjMaterial(1.f,
vec3f(.8f, 0.f, 0.f),
vec3f(float(i) / (dimSize - 1)),
1000.f,
vec3f(0.f)));
index.push_back(numSpheres.flatten(i));
}
// Ns
for (int i = 0; i < dimSize; i++)
materials.push_back(makeObjMaterial(1.f,
vec3f(.8f, 0.f, 0.f),
vec3f(1.f),
lerp(float(i) / (dimSize - 1), 10.f, 1000.f),
vec3f(0.f)));
sphereGeometry.setParam("sphere.position", cpp::CopiedData(spheres));
sphereGeometry.setParam("radius", 0.4f);
sphereGeometry.commit();
// Tf
for (int i = 0; i < dimSize; i++)
materials.push_back(makeObjMaterial(1.f,
vec3f(.2f, 0.f, 0.f),
vec3f(.2f, 0.f, 0.f),
1000.f,
(float(i) / (dimSize - 1)) * vec3f(1.f, .5f, .5f)));
cpp::GeometricModel model(sphereGeometry);
model.setParam("material", cpp::CopiedData(materials));
model.setParam("index", cpp::CopiedData(index));
model.commit();
cpp::Group group;
group.setParam("geometry", cpp::CopiedData(model));
group.commit();
return group;
}
cpp::World PtObj::buildWorld() const
{
auto world = Builder::buildWorld();
std::vector<cpp::Light> lightHandles;
cpp::Light dirLight("distant");
dirLight.setParam("direction", vec3f(1.f, -1.f, 1.f));
dirLight.commit();
cpp::Light ambientLight("ambient");
ambientLight.setParam("intensity", 0.4f);
ambientLight.setParam("color", vec3f(1.f));
ambientLight.commit();
lightHandles.push_back(dirLight);
lightHandles.push_back(ambientLight);
world.setParam("light", cpp::CopiedData(lightHandles));
return world;
return materials;
}
OSP_REGISTER_TESTING_BUILDER(PtObj, test_pt_obj);
@@ -0,0 +1,50 @@
// Copyright 2023 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "test_pt_material.h"
namespace ospray {
namespace testing {
struct PtPlastic : public PtMaterial
{
PtPlastic() = default;
~PtPlastic() override = default;
std::vector<cpp::Material> buildMaterials() const override;
};
static cpp::Material makePlasticMaterial(
vec3f color, float eta, float roughness)
{
cpp::Material mat("plastic");
mat.setParam("pigmentColor", color);
mat.setParam("eta", eta);
mat.setParam("roughness", roughness);
mat.commit();
return mat;
}
// Inlined definitions ////////////////////////////////////////////////////
std::vector<cpp::Material> PtPlastic::buildMaterials() const
{
std::vector<cpp::Material> materials;
constexpr int dimSize = 5;
index_sequence_2D numSpheres(dimSize);
for (auto i : numSpheres) {
auto i_f = static_cast<vec2f>(i);
materials.push_back(makePlasticMaterial(vec3f(.8f, 0.f, 0.f),
lerp(i_f.y / (dimSize - 1), 1.f, 2.f),
i_f.x / (dimSize - 1)));
}
return materials;
}
OSP_REGISTER_TESTING_BUILDER(PtPlastic, test_pt_plastic);
} // namespace testing
} // namespace ospray
@@ -0,0 +1,310 @@
// Copyright 2009 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "test_pt_material.h"
namespace ospray {
namespace testing {
struct PtPrincipledMetal : public PtMaterial
{
PtPrincipledMetal() = default;
~PtPrincipledMetal() override = default;
std::vector<cpp::Material> buildMaterials() const override;
};
struct PtPrincipledPlastic : public PtMaterial
{
PtPrincipledPlastic() = default;
~PtPrincipledPlastic() override = default;
std::vector<cpp::Material> buildMaterials() const override;
};
struct PtPrincipledGlass : public PtMaterial
{
PtPrincipledGlass() = default;
~PtPrincipledGlass() override = default;
std::vector<cpp::Material> buildMaterials() const override;
};
static cpp::Material makePrincipledMetalMaterial(vec3f baseColor,
float metallic,
float roughness,
float anisotropy,
float coat,
float coatRoughness)
{
cpp::Material mat("principled");
mat.setParam("baseColor", baseColor);
mat.setParam("metallic", metallic);
mat.setParam("roughness", roughness);
mat.setParam("anisotropy", anisotropy);
mat.setParam("coat", coat);
mat.setParam("coatRoughness", coatRoughness);
mat.commit();
return mat;
}
static cpp::Material makePrincipledPlasticMaterial(vec3f baseColor,
float ior,
float specular,
float sheen,
float sheenTint,
float sheenRoughness,
float opacity)
{
cpp::Material mat("principled");
mat.setParam("baseColor", baseColor);
mat.setParam("ior", ior);
mat.setParam("specular", specular);
mat.setParam("sheen", sheen);
mat.setParam("sheenTint", sheenTint);
mat.setParam("sheenRoughness", sheenRoughness);
mat.setParam("opacity", opacity);
mat.commit();
return mat;
}
static cpp::Material makePrincipledGlassMaterial(vec3f baseColor,
float transmission,
float roughness,
float ior,
float transmissionDepth,
bool thin,
float thickness,
float backlight)
{
cpp::Material mat("principled");
mat.setParam("baseColor", baseColor);
mat.setParam("transmissionColor", baseColor);
mat.setParam("transmission", transmission);
mat.setParam("roughness", roughness);
mat.setParam("ior", ior);
mat.setParam("transmissionDepth", transmissionDepth);
mat.setParam("thin", thin);
mat.setParam("thickness", thickness);
mat.setParam("backlight", backlight);
mat.commit();
return mat;
}
// Inlined definitions ////////////////////////////////////////////////////
std::vector<cpp::Material> PtPrincipledMetal::buildMaterials() const
{
std::vector<cpp::Material> materials;
constexpr int dimSize = 5;
index_sequence_2D numSpheres(dimSize);
// metallic
for (int i = 0; i < dimSize; i++) {
materials.push_back(
makePrincipledMetalMaterial(vec3f(0.0261f, 0.195f, 0.870f),
float(i) / (dimSize - 1),
0.f,
0.f,
0.f,
0.f));
}
// roughness
for (int i = 0; i < dimSize; i++) {
materials.push_back(
makePrincipledMetalMaterial(vec3f(0.0261f, 0.195f, 0.870f),
1.f,
float(i) / (dimSize - 1),
0.f,
0.f,
0.f));
}
// anisotropy
for (int i = 0; i < dimSize; i++) {
materials.push_back(
makePrincipledMetalMaterial(vec3f(0.0261f, 0.195f, 0.870f),
1.f,
.5f,
float(i) / (dimSize - 1),
0.f,
0.f));
}
// coat
for (int i = 0; i < dimSize; i++) {
materials.push_back(
makePrincipledMetalMaterial(vec3f(0.860f, 0.0258f, 0.0536f),
1.f,
.5f,
0.f,
float(i) / (dimSize - 1),
0.f));
}
// coatRoughness
for (int i = 0; i < dimSize; i++) {
materials.push_back(
makePrincipledMetalMaterial(vec3f(0.860f, 0.0258f, 0.0536f),
1.f,
.5f,
0.f,
1.f,
float(i) / (dimSize - 1)));
}
return materials;
}
std::vector<cpp::Material> PtPrincipledPlastic::buildMaterials() const
{
std::vector<cpp::Material> materials;
constexpr int dimSize = 5;
index_sequence_2D numSpheres(dimSize);
// specular
for (int i = 0; i < dimSize; i++) {
materials.push_back(makePrincipledPlasticMaterial(vec3f(0.770, 0.00, 0.00),
1.45f,
float(i) / (dimSize - 1),
0.f,
0.f,
0.f,
1.f));
}
// sheen
for (int i = 0; i < dimSize; i++) {
materials.push_back(
makePrincipledPlasticMaterial(vec3f(0.950f, 0.494f, 0.0380f),
1.f,
0.f,
float(i) / (dimSize - 1),
0.f,
.5f,
1.f));
}
// sheenTint
for (int i = 0; i < dimSize; i++) {
materials.push_back(
makePrincipledPlasticMaterial(vec3f(0.950f, 0.494f, 0.0380f),
1.f,
0.f,
1.f,
float(i) / (dimSize - 1),
.5f,
1.f));
}
// sheenRoughness
for (int i = 0; i < dimSize; i++) {
materials.push_back(
makePrincipledPlasticMaterial(vec3f(0.950f, 0.494f, 0.0380f),
1.f,
0.f,
1.f,
0.f,
float(i) / (dimSize - 1),
1.f));
}
// opacity
for (int i = 0; i < dimSize; i++) {
materials.push_back(
makePrincipledPlasticMaterial(vec3f(0.930f, 0.884f, 0.0186f),
1.45f,
1.f,
0.f,
0.f,
0.f,
1.f - float(i) / (dimSize - 1)));
}
return materials;
}
std::vector<cpp::Material> PtPrincipledGlass::buildMaterials() const
{
std::vector<cpp::Material> materials;
constexpr int dimSize = 5;
index_sequence_2D numSpheres(dimSize);
// transmission
for (int i = 0; i < dimSize; i++) {
materials.push_back(
makePrincipledGlassMaterial(vec3f(0.0400f, 0.680f, 1.00f),
float(i) / (dimSize - 1),
0.f,
1.1f,
1.f,
false,
1.f,
0.f));
}
// roughness
for (int i = 0; i < dimSize; i++) {
materials.push_back(
makePrincipledGlassMaterial(vec3f(0.0400f, 0.680f, 1.00f),
1.f,
float(i) / (dimSize - 1),
1.5f,
1.f,
false,
1.f,
0.f));
}
// ior
for (int i = 0; i < dimSize; i++) {
materials.push_back(
makePrincipledGlassMaterial(vec3f(0.0400f, 0.680f, 1.00f),
1.f,
0.f,
lerp(float(i) / (dimSize - 1), 1.f, 2.f),
1.f,
false,
1.f,
0.f));
}
// transmissionDepth
for (int i = 0; i < dimSize; i++) {
materials.push_back(
makePrincipledGlassMaterial(vec3f(0.0400f, 0.680f, 1.00f),
1.f,
0.f,
1.5f,
lerp(float(i) / (dimSize - 1), 2.f, 0.f),
false,
1.f,
0.f));
}
// backlight
for (int i = 0; i < dimSize; i++) {
materials.push_back(
makePrincipledGlassMaterial(vec3f(0.0400f, 0.200f, 1.00f),
.3f,
0.f,
1.5f,
1.f,
true,
1.f,
lerp(float(i) / (dimSize - 1), 0.f, 2.f)));
}
return materials;
}
OSP_REGISTER_TESTING_BUILDER(PtPrincipledMetal, test_pt_principled_metal);
OSP_REGISTER_TESTING_BUILDER(PtPrincipledPlastic, test_pt_principled_plastic);
OSP_REGISTER_TESTING_BUILDER(PtPrincipledGlass, test_pt_principled_glass);
} // namespace testing
} // namespace ospray
@@ -0,0 +1,167 @@
// Copyright 2023 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "test_pt_tex.h"
namespace ospray {
namespace testing {
struct PtPrincipledTex : public PtTex
{
PtPrincipledTex() = default;
~PtPrincipledTex() override = default;
std::vector<cpp::Material> buildMaterials(
const cpp::Texture &texR, const cpp::Texture &texRGBA) const override;
};
// Inlined definitions ////////////////////////////////////////////////////
std::vector<cpp::Material> PtPrincipledTex::buildMaterials(
const cpp::Texture &texR, const cpp::Texture &texRGBA) const
{
std::vector<cpp::Material> materials;
// principled metal
{
// metallic
materials.push_back(cpp::Material("principled"));
materials.back().setParam("baseColor", vec3f(0.0261f, 0.195f, 0.870f));
setTexture<float>(materials.back(), "metallic", texR);
// roughness
materials.push_back(cpp::Material("principled"));
materials.back().setParam("baseColor", vec3f(0.0261f, 0.195f, 0.870f));
materials.back().setParam("metallic", 1.f);
setTexture<float>(materials.back(), "roughness", texR);
// anisotropy
materials.push_back(cpp::Material("principled"));
materials.back().setParam("baseColor", vec3f(0.0261f, 0.195f, 0.870f));
materials.back().setParam("metallic", 1.f);
materials.back().setParam("roughness", .5f);
setTexture<float>(materials.back(), "anisotropy", texR);
// coat
materials.push_back(cpp::Material("principled"));
materials.back().setParam("baseColor", vec3f(0.860f, 0.0258f, 0.0536f));
materials.back().setParam("metallic", 1.f);
materials.back().setParam("roughness", .5f);
setTexture<float>(materials.back(), "coat", texR);
// coatRoughness
materials.push_back(cpp::Material("principled"));
materials.back().setParam("baseColor", vec3f(0.860f, 0.0258f, 0.0536f));
materials.back().setParam("metallic", 1.f);
materials.back().setParam("roughness", .5f);
materials.back().setParam("coat", 1.f);
setTexture<float>(materials.back(), "coatRoughness", texR);
}
// principled plastic
{
// roughness
materials.push_back(cpp::Material("principled"));
materials.back().setParam("baseColor", vec3f(0.770f, 0.00f, 0.00f));
setTexture<float>(materials.back(), "roughness", texR);
// specular
materials.push_back(cpp::Material("principled"));
materials.back().setParam("baseColor", vec3f(0.770f, 0.00f, 0.00f));
materials.back().setParam("ior", 1.45f);
setTexture<float>(materials.back(), "specular", texR);
// sheen
materials.push_back(cpp::Material("principled"));
materials.back().setParam("baseColor", vec3f(0.950f, 0.494f, 0.0380f));
materials.back().setParam("sheenRoughness", .5f);
setTexture<float>(materials.back(), "sheen", texR);
// sheenTint
materials.push_back(cpp::Material("principled"));
materials.back().setParam("baseColor", vec3f(0.950f, 0.494f, 0.0380f));
materials.back().setParam("sheen", 1.f);
materials.back().setParam("sheenRoughness", .5f);
setTexture<float>(materials.back(), "sheenTint", texR);
// sheenRoughness
materials.push_back(cpp::Material("principled"));
materials.back().setParam("baseColor", vec3f(0.950f, 0.494f, 0.0380f));
materials.back().setParam("sheen", 1.f);
setTexture<float>(materials.back(), "sheenRoughness", texR);
}
// principled glass
{
// transmission
materials.push_back(cpp::Material("principled"));
materials.back().setParam("baseColor", vec3f(0.0400f, 0.680f, 1.00f));
materials.back().setParam(
"transmissionColor", vec3f(0.0400f, 0.680f, 1.00f));
materials.back().setParam("ior", 1.1f);
setTexture<float>(materials.back(), "transmission", texR);
// roughness
materials.push_back(cpp::Material("principled"));
materials.back().setParam("baseColor", vec3f(0.0400f, 0.680f, 1.00f));
materials.back().setParam(
"transmissionColor", vec3f(0.0400f, 0.680f, 1.00f));
materials.back().setParam("transmission", 1.f);
materials.back().setParam("ior", 1.5f);
setTexture<float>(materials.back(), "roughness", texR);
// thickness
materials.push_back(cpp::Material("principled"));
materials.back().setParam("baseColor", vec3f(0.0400f, 0.680f, 1.00f));
materials.back().setParam(
"transmissionColor", vec3f(0.0400f, 0.680f, 1.00f));
materials.back().setParam("transmission", 1.f);
materials.back().setParam("ior", 1.5f);
materials.back().setParam("thin", true);
setTexture<float>(materials.back(), "thickness", texR);
// thin roughness
materials.push_back(cpp::Material("principled"));
materials.back().setParam("baseColor", vec3f(0.0400f, 0.680f, 1.00f));
materials.back().setParam(
"transmissionColor", vec3f(0.0400f, 0.680f, 1.00f));
materials.back().setParam("transmission", 1.f);
materials.back().setParam("ior", 1.5f);
materials.back().setParam("thin", true);
setTexture<float>(materials.back(), "roughness", texR);
// thin backlight
materials.push_back(cpp::Material("principled"));
materials.back().setParam("baseColor", vec3f(0.0400f, 0.680f, 1.00f));
materials.back().setParam(
"transmissionColor", vec3f(0.0400f, 0.680f, 1.00f));
materials.back().setParam("transmission", .3f);
materials.back().setParam("ior", 1.5f);
materials.back().setParam("thin", true);
setTexture<float>(materials.back(), "backlight", texR, 2.f);
}
{
// emissive
materials.push_back(cpp::Material("principled"));
materials.back().setParam("baseColor", vec3f(1.f, 0.8f, 0.7f));
setTexture<vec3f>(materials.back(), "emissiveColor", texRGBA);
// transparency
materials.push_back(cpp::Material("principled"));
materials.back().setParam("baseColor", vec3f(0.860f, 0.0258f, 0.0536f));
setTexture<vec3f>(materials.back(), "baseColor", texRGBA);
// opacity
materials.push_back(cpp::Material("principled"));
materials.back().setParam("baseColor", vec3f(0.860f, 0.0258f, 0.0536f));
setTexture<float>(materials.back(), "opacity", texR);
}
return materials;
}
OSP_REGISTER_TESTING_BUILDER(PtPrincipledTex, test_pt_principled_tex);
} // namespace testing
} // namespace ospray
@@ -0,0 +1,278 @@
// Copyright 2023 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "Builder.h"
#include "ospray_testing.h"
#include "rkcommon/utility/multidim_index_sequence.h"
using namespace rkcommon::math;
namespace ospray {
namespace testing {
struct PtTex : public detail::Builder
{
PtTex() = default;
~PtTex() override = default;
cpp::Group buildGroup() const override;
cpp::World buildWorld() const override;
virtual std::vector<cpp::Material> buildMaterials(
const cpp::Texture &texR, const cpp::Texture &texRGBA) const = 0;
};
// Inlined definitions ////////////////////////////////////////////////////
static cpp::Texture makeCheckerboardTextureR8()
{
// Prepare pixel data
constexpr uint32_t width = 16;
constexpr uint32_t height = 16;
std::array<uint8_t, width * height> dbyte;
index_sequence_2D idx(vec2i(width, height));
for (auto i : idx)
dbyte[idx.flatten(i)] = ((i.x & 2) ^ (i.y & 2)) * 255;
// Create texture object
cpp::Texture tex("texture2d");
tex.setParam("format", OSP_TEXTURE_R8);
tex.setParam("filter", OSP_TEXTURE_FILTER_NEAREST);
tex.setParam("data", cpp::CopiedData(dbyte.data(), vec2ul(width, height)));
tex.commit();
// Ready
return tex;
}
static cpp::Texture makeCheckerboardTextureRGBA8()
{
// Prepare pixel data
constexpr uint32_t width = 16;
constexpr uint32_t height = 16;
std::array<vec4uc, width * height> dbyte;
index_sequence_2D idx(vec2i(width, height));
for (auto i : idx) {
uint8_t v = ((i.x & 2) ^ (i.y & 2)) * 255;
dbyte[idx.flatten(i)] = vec4uc(v, v, v, 128 + v / 2);
}
// Create texture object
cpp::Texture tex("texture2d");
tex.setParam("format", OSP_TEXTURE_RGBA8);
tex.setParam("filter", OSP_TEXTURE_FILTER_NEAREST);
tex.setParam("data", cpp::CopiedData(dbyte.data(), vec2ul(width, height)));
tex.commit();
// Ready
return tex;
}
static std::vector<vec3f> makeSphereVertices(
uint32_t latitudeCount, uint32_t longitudeCount, float radius)
{
// Calculate latitude and longitude angular steps (in radians)
std::vector<vec3f> vPos;
const float latAngleStep = float(pi) / float(latitudeCount);
const float longAngleStep = (2.0f * float(pi)) / float(longitudeCount);
// Iterate through latitude segments
for (uint32_t latitudeId = 0; latitudeId <= latitudeCount; latitudeId++) {
// Calculate longitude radius at current latitude
float longRadius = radius * sin(latAngleStep * latitudeId);
// Determine segment level
float y = radius * cos(latAngleStep * latitudeId);
// Iterate through longitude segments
for (uint32_t longitudeId = 0; longitudeId <= longitudeCount;
longitudeId++) {
// Calculate vertex position
float x = longRadius * cos(longAngleStep * longitudeId);
float z = longRadius * sin(longAngleStep * longitudeId);
vPos.push_back(vec3f(x, y, z));
}
}
// Ready
return vPos;
}
static std::vector<vec2f> makeSphereTexCoords(uint32_t latitudeCount,
uint32_t longitudeCount,
float tileLat,
float tileLong)
{
// Iterate through latitude segments
std::vector<vec2f> vTexCoord;
for (uint32_t latitudeId = 0; latitudeId <= latitudeCount; latitudeId++) {
// Iterate through longitude segments
for (uint32_t longitudeId = 0; longitudeId <= longitudeCount;
longitudeId++) {
// Calculate texture coordinates
vTexCoord.push_back(vec2f(tileLong * longitudeId / float(longitudeCount),
tileLat * (latitudeId - 1) / float(latitudeCount)));
}
}
// Ready
return vTexCoord;
}
static std::vector<vec3ui> makeSphereIndices(
uint32_t latitudeCount, uint32_t longitudeCount, bool outside)
{
// Iterate through latitude segments
std::vector<vec3ui> indices;
for (uint32_t latitudeId = 0; latitudeId < latitudeCount; latitudeId++) {
// Calculate indices of segment left-most vertices
uint32_t firstVertex1 = latitudeId * (longitudeCount + 1);
uint32_t firstVertex2 = (latitudeId + 1) * (longitudeCount + 1);
// Iterate through longitude segments
for (uint32_t longitudeId = 0; longitudeId < longitudeCount;
longitudeId++) {
// Setup first triangle indices
uint32_t i2 = firstVertex2 + longitudeId + 1;
uint32_t i3 = firstVertex2 + longitudeId;
indices.push_back(vec3ui(firstVertex1 + longitudeId,
(outside) ? i2 : i3,
(outside) ? i3 : i2));
// Setup second triangle indices
i2 = firstVertex1 + longitudeId + 1;
i3 = firstVertex2 + longitudeId + 1;
indices.push_back(vec3ui(firstVertex1 + longitudeId,
(outside) ? i2 : i3,
(outside) ? i3 : i2));
}
}
// Ready
return indices;
}
static cpp::Geometry makeSphereMesh(
uint32_t latitudeCount, uint32_t longitudeCount)
{
cpp::Geometry sphereMesh("mesh");
// Prepare mesh buffers
std::vector<vec3f> vertices =
makeSphereVertices(latitudeCount, longitudeCount, 1.f);
std::vector<vec2f> texCoords =
makeSphereTexCoords(latitudeCount, longitudeCount, 1.f, 2.f);
std::vector<vec3ui> indices =
makeSphereIndices(latitudeCount, longitudeCount, false);
// Set mesh parameters
sphereMesh.setParam("vertex.position", cpp::CopiedData(vertices));
sphereMesh.setParam("vertex.normal", cpp::CopiedData(vertices));
sphereMesh.setParam("vertex.texcoord", cpp::CopiedData(texCoords));
sphereMesh.setParam("index", cpp::CopiedData(indices));
sphereMesh.commit();
// Ready
return sphereMesh;
}
template <typename T>
void setTexture(cpp::Material &mat,
const std::string &name,
const cpp::Texture &tex,
const T mul = T(1.f))
{
mat.setParam(name, mul);
mat.setParam("map_" + name, tex);
mat.commit();
}
inline cpp::Group PtTex::buildGroup() const
{
// Do nothing, needs per-instance materials feature to have single group
return cpp::Group();
}
inline cpp::World PtTex::buildWorld() const
{
cpp::World world;
std::vector<cpp::Instance> instances;
cpp::Texture texR = makeCheckerboardTextureR8();
cpp::Texture texRGBA = makeCheckerboardTextureRGBA8();
std::vector<cpp::Material> materials = buildMaterials(texR, texRGBA);
size_t dimCount = sqrtf(materials.size());
if (dimCount * dimCount < materials.size())
dimCount++;
const size_t dimSize = dimCount - 1;
cpp::Geometry sphereGeometry = makeSphereMesh(25, 50);
// Note: this is a temporary implementation, per-instance materials feature
// should be used here
box3f bbox(empty);
index_sequence_2D numSpheres(dimCount);
for (auto i : numSpheres) {
const auto idx = numSpheres.flatten(i);
if (idx >= materials.size())
break;
// Construct GeometricModel for each instance
cpp::GeometricModel model(sphereGeometry);
model.setParam("material", cpp::CopiedData(materials[idx]));
model.commit();
// Construct Group for each instance
cpp::Group group;
group.setParam("geometry", cpp::CopiedData(model));
group.commit();
// Construct instance
cpp::Instance instance(group);
auto i_f = static_cast<vec2f>(i);
instance.setParam("xfm",
affine3f::translate(
vec3f(dimSize / 2.f - i_f.x, dimSize / 2.f - i_f.y, .6f))
* affine3f::scale(.4f));
instance.commit();
instances.push_back(instance);
bbox.extend(instance.getBounds<box3f>());
}
bbox.lower -= .4f;
bbox.upper += .4f;
cpp::Instance planeInstance = makeGroundPlane(
bbox, vec4f(.9f, .9f, .9f, 1.f), vec4f(.2f, .2f, .2f, 1.f));
planeInstance.setParam(
"xfm", affine3f::rotate(vec3f(-1.f, 0.f, 0.f), half_pi));
planeInstance.commit();
instances.push_back(planeInstance);
world.setParam("instance", cpp::CopiedData(instances));
// Lights
{
std::vector<cpp::Light> lightHandles;
cpp::Light sphereLight("sphere");
sphereLight.setParam("intensity", 500.f);
sphereLight.setParam("position", vec3f(-15.f, 15.f, -20.f));
sphereLight.setParam("radius", 5.f);
sphereLight.commit();
cpp::Light ambientLight("ambient");
ambientLight.setParam("intensity", 0.4f);
ambientLight.setParam("color", vec3f(1.f));
ambientLight.commit();
lightHandles.push_back(sphereLight);
lightHandles.push_back(ambientLight);
world.setParam("light", cpp::CopiedData(lightHandles));
}
return world;
}
} // namespace testing
} // namespace ospray
@@ -0,0 +1,51 @@
// Copyright 2023 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "test_pt_material.h"
namespace ospray {
namespace testing {
struct PtThinGlass : public PtMaterial
{
PtThinGlass() = default;
~PtThinGlass() override = default;
std::vector<cpp::Material> buildMaterials() const override;
};
static cpp::Material makeThinGlassMaterial(
float eta, vec3f color, float attenuationDistance)
{
cpp::Material mat("thinGlass");
mat.setParam("eta", eta);
mat.setParam("attenuationColor", color);
mat.setParam("attenuationDistance", attenuationDistance);
mat.commit();
return mat;
}
// Inlined definitions ////////////////////////////////////////////////////
std::vector<cpp::Material> PtThinGlass::buildMaterials() const
{
std::vector<cpp::Material> materials;
constexpr int dimSize = 5;
index_sequence_2D numSpheres(dimSize);
for (auto i : numSpheres) {
auto i_f = static_cast<vec2f>(i);
materials.push_back(
makeThinGlassMaterial(lerp(i_f.x / (dimSize - 1), 1.f, 2.f),
vec3f(.1f, .5f, 1.f),
lerp(1.f - i_f.y / (dimSize - 1), 0.5f, 5.f)));
}
return materials;
}
OSP_REGISTER_TESTING_BUILDER(PtThinGlass, test_pt_thinglass);
} // namespace testing
} // namespace ospray
@@ -0,0 +1,48 @@
// Copyright 2023 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "test_pt_material.h"
namespace ospray {
namespace testing {
struct PtVelvet : public PtMaterial
{
PtVelvet() = default;
~PtVelvet() override = default;
std::vector<cpp::Material> buildMaterials() const override;
};
static cpp::Material makeVelvetMaterial(
float backScattering, float horizonScatteringFallOff)
{
cpp::Material mat("velvet");
mat.setParam("backScattering", backScattering);
mat.setParam("horizonScatteringFallOff", horizonScatteringFallOff);
mat.commit();
return mat;
}
// Inlined definitions ////////////////////////////////////////////////////
std::vector<cpp::Material> PtVelvet::buildMaterials() const
{
std::vector<cpp::Material> materials;
constexpr int dimSize = 5;
index_sequence_2D numSpheres(dimSize);
for (auto i : numSpheres) {
auto i_f = static_cast<vec2f>(i);
materials.push_back(makeVelvetMaterial(
i_f.x / (dimSize - 1), lerp(i_f.y / (dimSize - 1), 0.f, 20.f)));
}
return materials;
}
OSP_REGISTER_TESTING_BUILDER(PtVelvet, test_pt_velvet);
} // namespace testing
} // namespace ospray
@@ -1,4 +1,4 @@
// Copyright 2009-2019 Intel Corporation
// Copyright 2009 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "../builders/Builder.h"
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
// ospray_testing
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
+1 -1
View File
@@ -1,4 +1,4 @@
## Copyright 2009-2020 Intel Corporation
## Copyright 2009 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
add_library(raw_to_amr STATIC rawToAMR.cpp)
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma clang diagnostic push
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2009-2020 Intel Corporation
// Copyright 2009 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "rkcommon/math/box.h"
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2018-2020 Intel Corporation
// Copyright 2018 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "BaseFixture.h"
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2018-2020 Intel Corporation
// Copyright 2018 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
+2 -2
View File
@@ -1,7 +1,7 @@
## Copyright 2018-2021 Intel Corporation
## Copyright 2018 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
if (NOT OSPRAY_APPS_BENCHMARK)
if (NOT OSPRAY_ENABLE_APPS_BENCHMARK)
return()
endif()
@@ -1,4 +1,4 @@
// Copyright 2018-2020 Intel Corporation
// Copyright 2018 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "../BaseFixture.h"
@@ -1,4 +1,4 @@
// Copyright 2018-2020 Intel Corporation
// Copyright 2018 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "../BaseFixture.h"
@@ -35,4 +35,4 @@ OSPRAY_DEFINE_BENCHMARK(
OSPRAY_DEFINE_BENCHMARK(
GravitySpheres, "gravity_spheres_volume", 512, "pathtracer");
OSPRAY_DEFINE_SETUP_BENCHMARK(
GravitySpheres, "gravity_spheres_volume", 128, "pathtracer");
GravitySpheres, "gravity_spheres_volume", 128, "pathtracer");
@@ -1,4 +1,4 @@
// Copyright 2018-2020 Intel Corporation
// Copyright 2018 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "../BaseFixture.h"
+2 -3
View File
@@ -1,4 +1,4 @@
// Copyright 2018-2021 Intel Corporation
// Copyright 2018 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "BaseFixture.h"
@@ -103,6 +103,7 @@ int main(int argc, char **argv)
cmdArg.push_back(argv[i]);
ospInit(&argc, (const char **)argv);
std::atexit(ospShutdown);
auto DIR = utility::getEnvVar<std::string>("OSPRAY_BENCHMARK_IMG_DIR");
BaseFixture::dumpFinalImageDir = DIR.value_or("");
@@ -112,8 +113,6 @@ int main(int argc, char **argv)
return 1;
::benchmark::RunSpecifiedBenchmarks();
ospShutdown();
#ifdef _WIN32
if (waitForKey) {
printf("\n\tpress any key to exit");
+2 -9
View File
@@ -1,19 +1,13 @@
## Copyright 2018-2020 Intel Corporation
## Copyright 2018 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
if (NOT OSPRAY_APPS_EXAMPLES)
if (NOT OSPRAY_ENABLE_APPS_EXAMPLES)
return()
endif()
# prefer libGL over libOpenGl for better compatibility with SWR
set(OpenGL_GL_PREFERENCE "LEGACY")
find_package(OpenGL 2 REQUIRED)
find_package(glfw3 REQUIRED)
add_executable(ospExamples
${OSPRAY_RESOURCE}
GLFWOSPRayWindow.cpp
imgui_impl_glfw_gl3.cpp
ospExample.cpp
)
@@ -22,7 +16,6 @@ PRIVATE
arcball_camera
ospray_testing
ospray_imgui
glfw
${OPENGL_LIBRARIES}
)
+425 -163
View File
@@ -1,14 +1,17 @@
// Copyright 2018-2021 Intel Corporation
// Copyright 2018 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "GLFWOSPRayWindow.h"
#include "imgui_impl_glfw_gl3.h"
// ospray_testing
#include "ospray_testing.h"
#include "rkcommon/utility/random.h"
// imgui
#include "imgui.h"
#include "imgui_impl_glfw.h"
#include "imgui_impl_opengl3.h"
// std
#include <algorithm>
#include <chrono>
#include <iostream>
#include <stdexcept>
#include <vector>
@@ -38,6 +41,8 @@ static const std::vector<std::string> g_scenes = {"boxes_lit",
"gravity_spheres_isosurface",
"perlin_noise_volumes",
"random_spheres",
"random_discs",
"random_oriented_discs",
"streamlines",
"subdivision_cube",
"unstructured_volume",
@@ -50,10 +55,28 @@ static const std::vector<std::string> g_scenes = {"boxes_lit",
"clip_particle_volume",
"particle_volume",
"particle_volume_isosurface",
"vdb_volume"};
"vdb_volume",
"vdb_volume_packed",
"instancing",
"test_pt_alloy_roughness",
"test_pt_carpaint",
"test_pt_glass",
"test_pt_thinglass",
"test_pt_luminous",
"test_pt_material_tex",
"test_pt_metal_roughness",
"test_pt_metallic_flakes",
"test_pt_mix_tex",
"test_pt_obj",
"test_pt_plastic",
"test_pt_principled_metal",
"test_pt_principled_plastic",
"test_pt_principled_glass",
"test_pt_principled_tex",
"test_pt_velvet"};
static const std::vector<std::string> g_curveVariant = {
"bspline", "hermite", "catmull-rom", "linear", "cones"};
"bspline", "bezier", "hermite", "catmull-rom", "linear", "cones"};
static const std::vector<std::string> g_renderers = {
"scivis", "pathtracer", "ao", "debug"};
@@ -66,6 +89,7 @@ static const std::vector<std::string> g_debugRendererTypes = {"eyeLight",
"Ns",
"backfacing_Ng",
"backfacing_Ns",
"texCoord",
"dPds",
"dPdt",
"volume"};
@@ -73,85 +97,75 @@ static const std::vector<std::string> g_debugRendererTypes = {"eyeLight",
static const std::vector<std::string> g_pixelFilterTypes = {
"point", "box", "gaussian", "mitchell", "blackmanHarris"};
bool sceneUI_callback(void *, int index, const char **out_text)
{
*out_text = g_scenes[index].c_str();
return true;
}
static const std::vector<std::string> g_AOVs = {
"color", "depth", "albedo", "normal", "primID", "objID", "instID"};
bool curveVariantUI_callback(void *, int index, const char **out_text)
{
*out_text = g_curveVariant[index].c_str();
return true;
}
static const std::vector<std::string> g_denoiserQuality = {
"low", "medium", "high"};
bool rendererUI_callback(void *, int index, const char **out_text)
const char *vec_string_getter(void *vec_, int index)
{
*out_text = g_renderers[index].c_str();
return true;
}
bool debugTypeUI_callback(void *, int index, const char **out_text)
{
*out_text = g_debugRendererTypes[index].c_str();
return true;
}
bool pixelFilterTypeUI_callback(void *, int index, const char **out_text)
{
*out_text = g_pixelFilterTypes[index].c_str();
return true;
auto v = (std::vector<std::string> *)vec_;
return v->at(index).c_str();
}
// GLFWOSPRayWindow definitions ///////////////////////////////////////////////
void error_callback(int error, const char *desc)
{
std::cerr << "error " << error << ": " << desc << std::endl;
std::cerr << "GLFW error " << error << ": " << desc << std::endl;
}
GLFWOSPRayWindow *GLFWOSPRayWindow::activeWindow = nullptr;
GLFWOSPRayWindow::GLFWOSPRayWindow(const vec2i &windowSize, bool denoiser)
: denoiserAvailable(denoiser)
GLFWOSPRayWindow::GLFWOSPRayWindow(
const vec2i &windowSize, bool denoiserAvail, bool denoiserGPUAvail)
: denoiserAvailable(denoiserAvail)
{
if (activeWindow != nullptr) {
throw std::runtime_error("Cannot create more than one GLFWOSPRayWindow!");
}
if (denoiserAvailable) {
denoiser = cpp::ImageOperation("denoiser");
denoiserEnabled = denoiserGPUAvail;
updateFrameOpsNextFrame = denoiserEnabled;
}
activeWindow = this;
glfwSetErrorCallback(error_callback);
// initialize GLFW
if (!glfwInit()) {
throw std::runtime_error("Failed to initialize GLFW!");
}
glfwWindowHint(GLFW_SRGB_CAPABLE, GLFW_TRUE);
// create GLFW window
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
#ifdef __APPLE_
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
const char *glslVersion = "#version 150";
#else
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
const char *glslVersion = "#version 130";
#endif
glfwWindow = glfwCreateWindow(
windowSize.x, windowSize.y, "OSPRay Tutorial", nullptr, nullptr);
windowSize.x, windowSize.y, "OSPRay Examples", nullptr, nullptr);
if (!glfwWindow) {
glfwTerminate();
throw std::runtime_error("Failed to create GLFW window!");
}
// make the window's context current
glfwMakeContextCurrent(glfwWindow);
ImGui_ImplGlfwGL3_Init(glfwWindow, true);
// Setup Dear ImGui context
IMGUI_CHECKVERSION();
ImGui::CreateContext();
ImGuiIO &io = ImGui::GetIO();
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard;
// set initial OpenGL state
glEnable(GL_TEXTURE_2D);
glDisable(GL_LIGHTING);
// create OpenGL frame buffer texture
glGenTextures(1, &framebufferTexture);
glBindTexture(GL_TEXTURE_2D, framebufferTexture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
ImGui_ImplGlfw_InitForOpenGL(glfwWindow, false);
// set GLFW callbacks
glfwSetFramebufferSizeCallback(
@@ -200,19 +214,33 @@ GLFWOSPRayWindow::GLFWOSPRayWindow(const vec2i &windowSize, bool denoiser)
}
});
// will chain our callbacks above
ImGui_ImplGlfw_InstallCallbacks(glfwWindow);
ImGui_ImplOpenGL3_Init(glslVersion);
// set initial OpenGL state
glEnable(GL_TEXTURE_2D);
glDisable(GL_LIGHTING);
// create OpenGL frame buffer texture
glGenTextures(1, &framebufferTexture);
glBindTexture(GL_TEXTURE_2D, framebufferTexture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
// OSPRay setup //
// set up backplate texture
std::vector<vec4f> backplate;
backplate.push_back(vec4f(0.8f, 0.2f, 0.2f, 1.0f));
backplate.push_back(vec4f(0.2f, 0.8f, 0.2f, 1.0f));
backplate.push_back(vec4f(0.2f, 0.2f, 0.8f, 1.0f));
backplate.push_back(vec4f(0.4f, 0.2f, 0.4f, 1.0f));
backplate.push_back(vec4f(0.05f, 0.05f, 0.05f, 1.0f));
backplate.push_back(vec4f(0.05f, 0.05f, 0.05f, 1.0f));
backplate.push_back(vec4f(0.01f, 0.01f, 0.01f, 1.0f));
backplate.push_back(vec4f(0.01f, 0.01f, 0.01f, 1.0f));
OSPTextureFormat texFmt = OSP_TEXTURE_RGBA32F;
backplateTex.setParam(
"data", cpp::CopiedData(backplate.data(), vec2ul(2, 2)));
backplateTex.setParam("format", OSP_INT, &texFmt);
backplateTex.setParam("format", OSP_TEXTURE_RGBA32F);
addObjectToCommit(backplateTex.handle());
refreshScene(true);
@@ -226,8 +254,10 @@ GLFWOSPRayWindow::GLFWOSPRayWindow(const vec2i &windowSize, bool denoiser)
GLFWOSPRayWindow::~GLFWOSPRayWindow()
{
ImGui_ImplGlfwGL3_Shutdown();
// cleanly terminate GLFW
ImGui_ImplOpenGL3_Shutdown();
ImGui_ImplGlfw_Shutdown();
ImGui::DestroyContext();
glfwDestroyWindow(glfwWindow);
glfwTerminate();
}
@@ -242,12 +272,25 @@ void GLFWOSPRayWindow::mainLoop()
startNewOSPRayFrame();
while (!glfwWindowShouldClose(glfwWindow) && !g_quitNextFrame) {
ImGui_ImplGlfwGL3_NewFrame();
glfwPollEvents();
ImGui_ImplOpenGL3_NewFrame();
ImGui_ImplGlfw_NewFrame();
ImGui::NewFrame();
if (displayCallback)
displayCallback(this);
display();
// poll and process events
glfwPollEvents();
if (showUi)
buildUI();
glDisable(GL_FRAMEBUFFER_SRGB); // Disable SRGB conversion for UI
ImGui::Render();
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
glfwSwapBuffers(glfwWindow);
}
waitOnOSPRayFrame();
@@ -258,11 +301,13 @@ void GLFWOSPRayWindow::reshape(const vec2i &newWindowSize)
windowSize = newWindowSize;
// create new frame buffer
auto buffers = OSP_FB_COLOR | OSP_FB_DEPTH | OSP_FB_ACCUM | OSP_FB_ALBEDO
| OSP_FB_NORMAL;
auto buffers = OSP_FB_COLOR | OSP_FB_DEPTH | OSP_FB_ACCUM | OSP_FB_VARIANCE
| OSP_FB_ALBEDO | OSP_FB_NORMAL | OSP_FB_ID_PRIMITIVE | OSP_FB_ID_OBJECT
| OSP_FB_ID_INSTANCE;
framebuffer =
cpp::FrameBuffer(windowSize.x, windowSize.y, OSP_FB_RGBA32F, buffers);
updateTargetFrames(false);
refreshFrameOperations();
// reset OpenGL viewport and orthographic projection
@@ -276,12 +321,13 @@ void GLFWOSPRayWindow::reshape(const vec2i &newWindowSize)
arcballCamera->updateWindowSize(windowSize);
camera.setParam("aspect", windowSize.x / float(windowSize.y));
camera.commit();
addObjectToCommit(camera.handle());
}
void GLFWOSPRayWindow::updateCamera()
{
camera.setParam("aspect", windowSize.x / float(windowSize.y));
camera.setParam("stereoMode", cameraStereoMode);
const auto xfm = arcballCamera->transform();
if (rendererType == OSPRayRendererType::PATHTRACER && cameraMotionBlur) {
camera.removeParam("transform");
@@ -290,12 +336,15 @@ void GLFWOSPRayWindow::updateCamera()
xfms.push_back(xfm);
camera.setParam("motion.transform", cpp::CopiedData(xfms));
camera.setParam("shutter", range1f(1.0f - cameraMotionBlur, 1.0f));
camera.setParam("shutterType", cameraShutterType);
camera.setParam("rollingShutterDuration", cameraRollingShutter);
renderCameraMotionBlur = true;
} else {
camera.removeParam("motion.transform");
camera.setParam("transform", xfm);
camera.setParam("shutter", range1f(0.5f));
}
addObjectToCommit(camera.handle());
}
void GLFWOSPRayWindow::motion(const vec2f &position)
@@ -330,7 +379,6 @@ void GLFWOSPRayWindow::motion(const vec2f &position)
waitOnOSPRayFrame();
}
updateCamera();
addObjectToCommit(camera.handle());
}
}
@@ -339,24 +387,49 @@ void GLFWOSPRayWindow::motion(const vec2f &position)
void GLFWOSPRayWindow::display()
{
if (showUi)
buildUI();
if (displayCallback)
displayCallback(this);
updateTitleBar();
glEnable(GL_FRAMEBUFFER_SRGB); // Turn on sRGB conversion for OSPRay frame
static float totalRenderTime = 0.f;
static auto displayStart = std::chrono::steady_clock::now();
static bool firstFrame = true;
if (firstFrame || currentFrame.isReady()) {
// display frame rate in window title
const auto displayEnd = std::chrono::steady_clock::now();
const auto displayMilliseconds =
std::chrono::duration_cast<std::chrono::milliseconds>(
displayEnd - displayStart);
const auto renderTime = currentFrame.duration();
totalRenderTime += renderTime;
// update fps every 10 frames or every second
framesCounter++;
if (framesCounter > 9 || totalRenderTime > 1.f
|| displayMilliseconds > std::chrono::seconds(1)) {
displayFPS = 1000.f * float(framesCounter) / displayMilliseconds.count();
latestFPS = float(framesCounter) / totalRenderTime;
displayStart = displayEnd;
totalRenderTime = 0.f;
framesCounter = 0;
updateTitleBar();
}
waitOnOSPRayFrame();
latestFPS = 1.f / currentFrame.duration();
auto *fb = framebuffer.map(
showDepth ? OSP_FB_DEPTH : (showAlbedo ? OSP_FB_ALBEDO : OSP_FB_COLOR));
auto fbChannel = OSP_FB_COLOR;
if (showDepth)
fbChannel = OSP_FB_DEPTH;
if (showAlbedo)
fbChannel = OSP_FB_ALBEDO;
if (showNormal)
fbChannel = OSP_FB_NORMAL;
if (showPrimID)
fbChannel = OSP_FB_ID_PRIMITIVE;
if (showGeomID)
fbChannel = OSP_FB_ID_OBJECT;
if (showInstID)
fbChannel = OSP_FB_ID_INSTANCE;
auto *fb = framebuffer.map(fbChannel);
// Copy and normalize depth layer if showDepth is on
float *depthFb = static_cast<float *>(fb);
@@ -380,17 +453,44 @@ void GLFWOSPRayWindow::display()
depthFb[i] = (depthFb[i] - minDepth) * rcpDepthRange;
}
}
unsigned int *ids = static_cast<unsigned int *>(fb);
std::vector<vec3f> idFbArray(windowSize.x * windowSize.y);
float *idFb = reinterpret_cast<float *>(idFbArray.data());
if (showPrimID || showGeomID || showInstID) {
for (int i = 0; i < windowSize.x * windowSize.y; i++) {
const unsigned int id = ids[i];
idFbArray[i] =
id == -1u ? vec3f(0.f) : rkcommon::utility::makeRandomColor(id);
}
}
if (showNormal) {
float *nFb = static_cast<float *>(fb);
float *iFb = reinterpret_cast<float *>(idFbArray.data());
for (int i = 0; i < windowSize.x * windowSize.y * 3; i++)
iFb[i] = std::abs(nFb[i]);
}
glBindTexture(GL_TEXTURE_2D, framebufferTexture);
glTexImage2D(GL_TEXTURE_2D,
0,
showDepth ? GL_DEPTH_COMPONENT : (showAlbedo ? GL_RGB32F : GL_RGBA32F),
showDepth ? GL_DEPTH_COMPONENT
: ((showAlbedo || showNormal || showPrimID || showGeomID
|| showInstID)
? GL_RGB32F
: GL_RGBA32F),
windowSize.x,
windowSize.y,
0,
showDepth ? GL_DEPTH_COMPONENT : (showAlbedo ? GL_RGB : GL_RGBA),
showDepth ? GL_DEPTH_COMPONENT
: ((showAlbedo || showNormal || showPrimID || showGeomID
|| showInstID)
? GL_RGB
: GL_RGBA),
GL_FLOAT,
showDepth ? depthFb : fb);
showDepth
? depthFb
: ((showNormal || showPrimID || showGeomID || showInstID) ? idFb
: fb));
framebuffer.unmap(fb);
@@ -400,7 +500,7 @@ void GLFWOSPRayWindow::display()
firstFrame = false;
}
// clear current OpenGL color buffer
glEnable(GL_FRAMEBUFFER_SRGB); // Turn on sRGB conversion for OSPRay frame
glClear(GL_COLOR_BUFFER_BIT);
// render textured quad with OSPRay frame buffer contents
@@ -419,26 +519,24 @@ void GLFWOSPRayWindow::display()
glVertex2f(windowSize.x, 0.f);
glEnd();
if (showUi) {
glDisable(GL_FRAMEBUFFER_SRGB); // Disable SRGB conversion for UI
ImGui::Render();
ImGui_ImplGlfwGL3_Render();
}
// swap buffers
glfwSwapBuffers(glfwWindow);
}
void GLFWOSPRayWindow::startNewOSPRayFrame()
{
if (updateFrameOpsNextFrame) {
if (updateFrameOpsNextFrame)
refreshFrameOperations();
updateFrameOpsNextFrame = false;
}
lastXfm = arcballCamera->transform();
currentFrame = framebuffer.renderFrame(*renderer, camera, world);
if (updateFrameOpsNextFrame || accumLimit == 0 || frame < accumLimit) {
currentFrame = framebuffer.renderFrame(*renderer, camera, world);
// correctly count rendered frames: to run the PP (e.g. toggling the
// denoiser) we need to start a renderFrame and cannot skip rendering via
// targetFrames in case PT should *not* use blue noise
if (accumLimit == 0 || frame < accumLimit
|| (rendererType == OSPRayRendererType::PATHTRACER && !blueNoise))
frame++;
}
updateFrameOpsNextFrame = false;
if (renderCameraMotionBlur) {
camera.removeParam("motion.transform");
camera.setParam("transform", lastXfm);
@@ -460,8 +558,13 @@ void GLFWOSPRayWindow::addObjectToCommit(OSPObject obj)
void GLFWOSPRayWindow::updateTitleBar()
{
std::stringstream windowTitle;
windowTitle << "OSPRay: " << std::setprecision(3) << latestFPS << " fps";
if (latestFPS < 2.f) {
windowTitle << "OSPRay frame: " << frame
<< (accumLimit && frame >= accumLimit ? " (limit reached), last"
: ", ")
<< " render:" << std::fixed << std::setprecision(2)
<< std::setw(7) << latestFPS << " fps, app:" << std::setw(7)
<< displayFPS << " fps";
if (latestFPS > 0.f && latestFPS < 2.f) {
float progress = currentFrame.progress();
windowTitle << " | ";
int barWidth = 20;
@@ -485,11 +588,11 @@ void GLFWOSPRayWindow::buildUI()
ImGuiWindowFlags flags = ImGuiWindowFlags_AlwaysAutoResize;
ImGui::Begin("press 'g' to hide/show UI", nullptr, flags);
static int whichScene = 0;
static int whichScene = 2;
if (ImGui::Combo("scene##whichScene",
&whichScene,
sceneUI_callback,
nullptr,
vec_string_getter,
(void *)&g_scenes,
g_scenes.size())) {
scene = g_scenes[whichScene];
refreshScene(true);
@@ -499,8 +602,8 @@ void GLFWOSPRayWindow::buildUI()
static int whichCurveVariant = 0;
if (ImGui::Combo("curveVariant##whichCurveVariant",
&whichCurveVariant,
curveVariantUI_callback,
nullptr,
vec_string_getter,
(void *)&g_curveVariant,
g_curveVariant.size())) {
curveVariant = g_curveVariant[whichCurveVariant];
refreshScene(true);
@@ -512,12 +615,12 @@ void GLFWOSPRayWindow::buildUI()
refreshScene(true);
}
static int whichRenderer = 0;
static int whichRenderer = 1;
static int whichDebuggerType = 0;
if (ImGui::Combo("renderer##whichRenderer",
&whichRenderer,
rendererUI_callback,
nullptr,
vec_string_getter,
(void *)&g_renderers,
g_renderers.size())) {
rendererTypeStr = g_renderers[whichRenderer];
@@ -536,54 +639,89 @@ void GLFWOSPRayWindow::buildUI()
rendererType = OSPRayRendererType::OTHER;
refreshScene();
updateTargetFrames();
}
if (rendererType == OSPRayRendererType::DEBUGGER) {
if (ImGui::Combo("debug type##whichDebugType",
&whichDebuggerType,
debugTypeUI_callback,
nullptr,
vec_string_getter,
(void *)&g_debugRendererTypes,
g_debugRendererTypes.size())) {
renderer->setParam("method", g_debugRendererTypes[whichDebuggerType]);
addObjectToCommit(renderer->handle());
}
}
if (ImGui::SliderInt("accumulation limit", &accumLimit, 0, 64))
updateTargetFrames();
ImGui::Checkbox("cancel frame on interaction", &cancelFrameOnInteraction);
ImGui::Checkbox("show depth", &showDepth);
if (showDepth)
showAlbedo = false;
else
ImGui::Checkbox("show albedo", &showAlbedo);
static int whichAOV = 0;
if (ImGui::Combo("AOV Display##whichAOV",
&whichAOV,
vec_string_getter,
(void *)&g_AOVs,
g_AOVs.size())) {
const auto &aovStr = g_AOVs[whichAOV];
showDepth = showAlbedo = showNormal = showPrimID = showGeomID = showInstID =
false;
if (aovStr == "depth")
showDepth = true;
if (aovStr == "albedo")
showAlbedo = true;
if (aovStr == "normal")
showNormal = true;
if (aovStr == "primID")
showPrimID = true;
if (aovStr == "objID")
showGeomID = true;
if (aovStr == "instID")
showInstID = true;
}
ImGui::Separator();
if (denoiserAvailable) {
if (ImGui::Checkbox("denoiser", &denoiserEnabled))
updateFrameOpsNextFrame = true;
static int whichQuality = 1; // medium
if (denoiserEnabled
&& ImGui::Combo("quality##whichQuality",
&whichQuality,
vec_string_getter,
(void *)&g_denoiserQuality,
g_denoiserQuality.size())) {
denoiser.setParam("quality",
OSPDenoiserQuality::OSP_DENOISER_QUALITY_LOW + whichQuality);
addObjectToCommit(denoiser.handle());
}
}
ImGui::Separator();
// the gaussian pixel fiter is the default,
// the gaussian pixel filter is the default,
// which is at position 2 in the list
static int whichPixelFilter = 2;
if (ImGui::Combo("pixelfilter##whichPixelFilter",
&whichPixelFilter,
pixelFilterTypeUI_callback,
nullptr,
vec_string_getter,
(void *)&g_pixelFilterTypes,
g_pixelFilterTypes.size())) {
pixelFilterTypeStr = g_pixelFilterTypes[whichPixelFilter];
OSPPixelFilterTypes pixelFilterType =
OSPPixelFilterTypes::OSP_PIXELFILTER_GAUSS;
OSPPixelFilterType pixelFilterType =
OSPPixelFilterType::OSP_PIXELFILTER_GAUSS;
if (pixelFilterTypeStr == "point")
pixelFilterType = OSPPixelFilterTypes::OSP_PIXELFILTER_POINT;
pixelFilterType = OSPPixelFilterType::OSP_PIXELFILTER_POINT;
else if (pixelFilterTypeStr == "box")
pixelFilterType = OSPPixelFilterTypes::OSP_PIXELFILTER_BOX;
pixelFilterType = OSPPixelFilterType::OSP_PIXELFILTER_BOX;
else if (pixelFilterTypeStr == "gaussian")
pixelFilterType = OSPPixelFilterTypes::OSP_PIXELFILTER_GAUSS;
pixelFilterType = OSPPixelFilterType::OSP_PIXELFILTER_GAUSS;
else if (pixelFilterTypeStr == "mitchell")
pixelFilterType = OSPPixelFilterTypes::OSP_PIXELFILTER_MITCHELL;
pixelFilterType = OSPPixelFilterType::OSP_PIXELFILTER_MITCHELL;
else if (pixelFilterTypeStr == "blackmanHarris")
pixelFilterType = OSPPixelFilterTypes::OSP_PIXELFILTER_BLACKMAN_HARRIS;
pixelFilterType = OSPPixelFilterType::OSP_PIXELFILTER_BLACKMAN_HARRIS;
rendererPT.setParam("pixelFilter", pixelFilterType);
rendererSV.setParam("pixelFilter", pixelFilterType);
@@ -603,7 +741,24 @@ void GLFWOSPRayWindow::buildUI()
addObjectToCommit(renderer->handle());
}
static vec3f bgColorSRGB{0.0f}; // imGUI's widget implicitely uses sRGB
if (scene == "mip_map_textures") {
static float mipBias = 0.0f;
if (ImGui::SliderFloat("mipMapBias", &mipBias, -5.0f, 10.0f)) {
rendererPT.setParam("mipMapBias", mipBias);
rendererSV.setParam("mipMapBias", mipBias);
rendererAO.setParam("mipMapBias", mipBias);
rendererDBG.setParam("mipMapBias", mipBias);
addObjectToCommit(renderer->handle());
}
}
static float varianceThreshold = 0.0f;
if (ImGui::SliderFloat("varianceThreshold", &varianceThreshold, 0.f, 5.f)) {
renderer->setParam("varianceThreshold", varianceThreshold);
addObjectToCommit(renderer->handle());
}
static vec3f bgColorSRGB{0.0f}; // imGUI's widget implicitly uses sRGB
if (ImGui::ColorEdit3("backgroundColor", bgColorSRGB)) {
bgColor = vec3f(std::pow(bgColorSRGB.x, 2.2f),
std::pow(bgColorSRGB.y, 2.2f),
@@ -615,8 +770,10 @@ void GLFWOSPRayWindow::buildUI()
addObjectToCommit(renderer->handle());
}
static bool useTestTex = false;
if (ImGui::Checkbox("backplate texture", &useTestTex)) {
static bool useTestTex = true;
static bool init = true;
if (init || ImGui::Checkbox("backplate texture", &useTestTex)) {
init = false;
if (useTestTex) {
rendererPT.setParam("map_backplate", backplateTex);
rendererSV.setParam("map_backplate", backplateTex);
@@ -631,7 +788,75 @@ void GLFWOSPRayWindow::buildUI()
addObjectToCommit(renderer->handle());
}
if (rendererType == OSPRayRendererType::SCIVIS
|| rendererType == OSPRayRendererType::PATHTRACER) {
if (ImGui::Checkbox("sun-sky illumination", &renderSunSky)) {
if (renderSunSky) {
sunSky.setParam("direction", sunDirection);
sunSky.setParam("horizonExtension", horizonExtension);
sunSky.setParam("turbidity", turbidity);
world.setParam("light", cpp::CopiedData(sunSky));
addObjectToCommit(sunSky.handle());
// turn-off background
bgColorSRGB = bgColor = vec3f(0.f);
renderer->setParam("backgroundColor", bgColor);
useTestTex = false;
rendererPT.removeParam("map_backplate");
rendererSV.removeParam("map_backplate");
rendererAO.removeParam("map_backplate");
rendererDBG.removeParam("map_backplate");
addObjectToCommit(renderer->handle());
} else {
cpp::Light light("ambient");
light.setParam("visible", false);
light.commit();
world.setParam("light", cpp::CopiedData(light));
}
addObjectToCommit(world.handle());
}
if (renderSunSky) {
if (ImGui::DragFloat3("sunDirection", sunDirection, 0.01f, -1.f, 1.f)) {
sunSky.setParam("direction", sunDirection);
addObjectToCommit(sunSky.handle());
addObjectToCommit(world.handle());
}
if (ImGui::DragFloat("turbidity", &turbidity, 0.1f, 1.f, 10.f)) {
sunSky.setParam("turbidity", turbidity);
addObjectToCommit(sunSky.handle());
addObjectToCommit(world.handle());
}
if (ImGui::DragFloat(
"horizonExtension", &horizonExtension, 0.01f, 0.f, 1.f)) {
sunSky.setParam("horizonExtension", horizonExtension);
addObjectToCommit(sunSky.handle());
addObjectToCommit(world.handle());
}
}
}
if (rendererType == OSPRayRendererType::PATHTRACER) {
static int lightSamples = -1;
if (ImGui::SliderInt("lightSamples", &lightSamples, -1, 32)) {
renderer->setParam("lightSamples", lightSamples);
addObjectToCommit(renderer->handle());
}
static bool limitIndirectLightSamples = true;
if (ImGui::Checkbox("limitIndirectLightSamples", &limitIndirectLightSamples)) {
renderer->setParam("limitIndirectLightSamples", limitIndirectLightSamples);
addObjectToCommit(renderer->handle());
}
if (accumLimit) {
if (ImGui::Checkbox("blue noise", &blueNoise))
updateTargetFrames();
} else {
ImGui::BeginDisabled();
bool f = false;
ImGui::Checkbox("blue noise (needs accumulation limit)", &f);
ImGui::EndDisabled();
}
static int maxDepth = 20;
if (ImGui::SliderInt("maxPathLength", &maxDepth, 1, 64)) {
renderer->setParam("maxPathLength", maxDepth);
@@ -650,48 +875,57 @@ void GLFWOSPRayWindow::buildUI()
addObjectToCommit(renderer->handle());
}
if (ImGui::SliderFloat("camera motion blur", &cameraMotionBlur, 0.f, 1.f)) {
updateCamera();
addObjectToCommit(camera.handle());
static float maxContribution = 10000.f;
if (ImGui::SliderFloat("maxContribution", &maxContribution, 0.f, 10000.f)) {
renderer->setParam("maxContribution", maxContribution);
addObjectToCommit(renderer->handle());
}
if (ImGui::Checkbox("renderSunSky", &renderSunSky)) {
if (renderSunSky) {
sunSky.setParam("direction", sunDirection);
world.setParam("light", cpp::CopiedData(sunSky));
addObjectToCommit(sunSky.handle());
} else {
cpp::Light light("ambient");
light.setParam("visible", false);
light.commit();
world.setParam("light", cpp::CopiedData(light));
}
addObjectToCommit(world.handle());
if (ImGui::SliderFloat("camera motion blur", &cameraMotionBlur, 0.f, 1.f)) {
updateCamera();
}
if (renderSunSky) {
if (ImGui::DragFloat3("sunDirection", sunDirection, 0.01f, -1.f, 1.f)) {
sunSky.setParam("direction", sunDirection);
addObjectToCommit(sunSky.handle());
}
if (ImGui::DragFloat("turbidity", &turbidity, 0.1f, 1.f, 10.f)) {
sunSky.setParam("turbidity", turbidity);
addObjectToCommit(sunSky.handle());
}
if (ImGui::DragFloat(
"horizonExtension", &horizonExtension, 0.01f, 0.f, 1.f)) {
sunSky.setParam("horizonExtension", horizonExtension);
addObjectToCommit(sunSky.handle());
if (cameraMotionBlur > 0.0f) {
static const char *cameraShutterTypes[] = {"global",
"rolling right",
"rolling left",
"rolling down",
"rolling up"};
if (ImGui::BeginCombo("shutterType##cameraShutterType",
cameraShutterTypes[cameraShutterType])) {
for (uint32_t n = 0; n < 5; n++) {
bool is_selected = (cameraShutterType == n);
if (ImGui::Selectable(cameraShutterTypes[n], is_selected))
cameraShutterType = (OSPShutterType)n;
if (is_selected)
ImGui::SetItemDefaultFocus();
}
ImGui::EndCombo();
updateCamera();
}
}
if (cameraShutterType != OSP_SHUTTER_GLOBAL
&& ImGui::SliderFloat(
"rollingShutterDuration", &cameraRollingShutter, 0.f, 1.0f)) {
updateCamera();
}
} else if (rendererType == OSPRayRendererType::SCIVIS) {
static bool shadowsEnabled = false;
if (ImGui::Checkbox("shadows", &shadowsEnabled)) {
static bool init = true;
static bool shadowsEnabled = true;
if (init || ImGui::Checkbox("shadows", &shadowsEnabled)) {
renderer->setParam("shadows", shadowsEnabled);
addObjectToCommit(renderer->handle());
}
static int aoSamples = 0;
if (ImGui::SliderInt("aoSamples", &aoSamples, 0, 64)) {
static bool visibleLights = true;
if (init || ImGui::Checkbox("visibleLights", &visibleLights)) {
renderer->setParam("visibleLights", visibleLights);
addObjectToCommit(renderer->handle());
}
static int aoSamples = 1;
if (init || ImGui::SliderInt("aoSamples", &aoSamples, 0, 64)) {
renderer->setParam("aoSamples", aoSamples);
addObjectToCommit(renderer->handle());
}
@@ -701,6 +935,7 @@ void GLFWOSPRayWindow::buildUI()
renderer->setParam("volumeSamplingRate", samplingRate);
addObjectToCommit(renderer->handle());
}
init = false;
} else if (rendererType == OSPRayRendererType::AO) {
static int aoSamples = 1;
if (ImGui::SliderInt("aoSamples", &aoSamples, 0, 64)) {
@@ -721,6 +956,22 @@ void GLFWOSPRayWindow::buildUI()
}
}
static const char *cameraStereoModes[] = {
"none", "left", "right", "side-by-side", "top/bottom"};
if (ImGui::BeginCombo("camera stereoMode##cameraStereoMode",
cameraStereoModes[cameraStereoMode])) {
for (uint32_t n = 0; n < 5; n++) {
bool is_selected = (cameraStereoMode == n);
if (ImGui::Selectable(cameraStereoModes[n], is_selected))
cameraStereoMode = (OSPStereoMode)n;
if (is_selected)
ImGui::SetItemDefaultFocus();
}
ImGui::EndCombo();
updateCamera();
}
if (uiCallback) {
ImGui::Separator();
uiCallback();
@@ -735,6 +986,7 @@ void GLFWOSPRayWindow::commitOutstandingHandles()
if (!handles.empty()) {
for (auto &h : handles)
ospCommit(h);
frame = 0;
framebuffer.resetAccumulation();
}
}
@@ -754,12 +1006,9 @@ void GLFWOSPRayWindow::refreshScene(bool resetCamera)
testing::release(builder);
switch (rendererType) {
case OSPRayRendererType::PATHTRACER: {
case OSPRayRendererType::PATHTRACER:
renderer = &rendererPT;
if (renderSunSky)
world.setParam("light", cpp::CopiedData(sunSky));
break;
}
case OSPRayRendererType::SCIVIS:
renderer = &rendererSV;
break;
@@ -772,6 +1021,12 @@ void GLFWOSPRayWindow::refreshScene(bool resetCamera)
default:
throw std::runtime_error("invalid renderer chosen!");
}
if (rendererType == OSPRayRendererType::SCIVIS
|| rendererType == OSPRayRendererType::PATHTRACER) {
if (renderSunSky)
world.setParam("light", cpp::CopiedData(sunSky));
} else
renderSunSky = false;
// retains a set background color on renderer change
renderer->setParam("backgroundColor", bgColor);
addObjectToCommit(renderer->handle());
@@ -787,18 +1042,25 @@ void GLFWOSPRayWindow::refreshScene(bool resetCamera)
// init camera
camera.setParam("position", vec3f(0.0f, 0.0f, 1.0f));
updateCamera();
camera.commit();
}
}
void GLFWOSPRayWindow::refreshFrameOperations()
{
if (denoiserEnabled) {
cpp::ImageOperation d("denoiser");
framebuffer.setParam("imageOperation", cpp::CopiedData(d));
framebuffer.setParam("imageOperation", cpp::CopiedData(denoiser));
} else {
framebuffer.removeParam("imageOperation");
}
framebuffer.commit();
}
void GLFWOSPRayWindow::updateTargetFrames(const bool commit)
{
framebuffer.setParam("targetFrames",
rendererType != OSPRayRendererType::PATHTRACER || blueNoise ? accumLimit
: 0);
if (commit)
addObjectToCommit(framebuffer.handle());
}
+24 -7
View File
@@ -1,4 +1,4 @@
// Copyright 2018-2021 Intel Corporation
// Copyright 2018 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
@@ -27,7 +27,9 @@ enum class OSPRayRendererType
class GLFWOSPRayWindow
{
public:
GLFWOSPRayWindow(const vec2i &windowSize, bool denoiser = false);
GLFWOSPRayWindow(const vec2i &windowSize,
bool denoiserAvail = false,
bool denoiserGPUAvail = false);
~GLFWOSPRayWindow();
@@ -50,6 +52,7 @@ class GLFWOSPRayWindow
void commitOutstandingHandles();
void refreshScene(bool resetCamera = false);
void refreshFrameOperations();
void updateTargetFrames(const bool commit = true);
static GLFWOSPRayWindow *activeWindow;
@@ -60,7 +63,11 @@ class GLFWOSPRayWindow
bool updateFrameOpsNextFrame{false};
bool denoiserEnabled{false};
bool showAlbedo{false};
bool showNormal{false};
bool showDepth{false};
bool showPrimID{false};
bool showGeomID{false};
bool showInstID{false};
bool renderSunSky{false};
bool cancelFrameOnInteraction{false};
bool showUnstructuredCells{false};
@@ -71,7 +78,10 @@ class GLFWOSPRayWindow
// Arcball camera instance
std::unique_ptr<ArcballCamera> arcballCamera;
affine3f lastXfm{one};
OSPStereoMode cameraStereoMode{OSP_STEREO_NONE};
float cameraMotionBlur{0.0f};
float cameraRollingShutter{0.0f};
OSPShutterType cameraShutterType{OSP_SHUTTER_GLOBAL};
// only one frame during movement is rendered with MB,
// during accumulation the camera is static and thus no MB
bool renderCameraMotionBlur{false};
@@ -88,18 +98,23 @@ class GLFWOSPRayWindow
cpp::FrameBuffer framebuffer;
cpp::Future currentFrame;
cpp::Texture backplateTex{"texture2d"};
cpp::ImageOperation denoiser;
int frame{0};
bool blueNoise{true};
int accumLimit{0};
vec3f bgColor{0.f};
vec3f sunDirection{-0.25f, -1.0f, 0.0f};
vec3f sunDirection{-0.25f, -1.0f, 1.0f};
float turbidity{3.f};
float horizonExtension{0.1f};
float horizonExtension{0.25f};
std::string scene{"boxes_lit"};
std::string scene{"cornell_box"};
std::string curveVariant{"bspline"};
OSPRayRendererType rendererType{OSPRayRendererType::SCIVIS};
std::string rendererTypeStr{"scivis"};
OSPRayRendererType rendererType{OSPRayRendererType::PATHTRACER};
std::string rendererTypeStr{"pathtracer"};
std::string pixelFilterTypeStr{"gaussian"};
@@ -119,5 +134,7 @@ class GLFWOSPRayWindow
std::function<void()> uiCallback;
// FPS measurement of last frame
uint32_t framesCounter{0};
float latestFPS{0.f};
float displayFPS{0.f};
};

Some files were not shown because too many files have changed in this diff Show More