Code Monkey home page Code Monkey logo

hdospray's Introduction

HdOSPRay

OSPRay interactive rendering plugin for USD Hydra

Pixar's Kitchen asset rendered with OSPRay's path tracer at interactive rates.

This is release v0.2.0 of HdOSPRay. Visit HdOSPRay on github for more information.

HdOSPRay

HdOSPRay is an open source plugin for Pixar's USD to extend USD's Hydra rendering framework with Intel® OSPRay. HdOSPRay enables interactive scene preview by utilizing OSPRay's high quality renderers and Intel® Open Image Denoise, and is released under the permissive Apache 2.0 license.

As part of the Intel® Rendering Framework, OSPRay is highly-optimized for Intel® CPU architectures ranging from laptops to large-scale distributed HPC systems. HdOSPRay leverages the Intel® Rendering Framework to deliver interactive rendering for large-scale models at high levels of fidelity, as demonstrated at SIGGRAPH 2018 using over 100GB of production assets.

Support and Contact

HdOSPRay is still in beta, with new features and existing issues being worked on regularly. USD is also under active development and is often fast changing. We tag the HdOSPRay releases to match specified USD releases, but cannot always anticipate all of the changes and resulting issues for users. Please report any issues you may run into to our issue tracker. We always welcome suggestions and especially pull requests!

HdOSPRay Gallery

Our gallery currently contains a limited set of renderings done with HdOSPRay inside of usdview using publicly available USD datasets. We hope to grow this gallery as more assets become available. Please let us know of any great scenes we may be missing, or if you would like to send us a scene for testing and displaying here!

Instructions are provided for loading the scenes below.

Kitchen Set

Pixar Kitchen Set path traced with HdOSPRay in usdview


Pixar Kitchen Set path traced with HdOSPRay in usdview

  • Download Kitchen Set asset from Pixar

  • Run usdview using HdOSPRay using

    HDOSPRAY_USE_PATH_TRACING=1 usdview --renderer OSPRay Kitchen_set.usd
    

Pixar Kitchen Set GL


Pixar Kitchen Set rendered with default GL in usdview

Pixar Kitchen Set shadows


Pixar Kitchen Set rendered with HdOSPRay and basic shadows in usdview

Pixar Kitchen Set AO


Pixar Kitchen Set rendered with HdOSPRay and basic ambient occlusion in usdview

Pixar Kitchen Set path traced


Pixar Kitchen Set rendered with HdOSPRay and path tracing in usdview

Teapot

Teapot


Apple teapot rendered with HdOSPRay in usdview

  • Download the Apple ARKit teapot from Apple

  • USDZ files are zip files, unzip using platform specific program of your choice

    unzip teapot.usdz
    
  • Run usdview using HdOSPRay using

    HDOSPRAY_USE_PATH_TRACING=1 usdview --renderer OSPRay Teapot.usdc
    

Gramophone

Gramophone


Apple Gramophone rendered with HdOSPRay in usdview

  • Download the Apple ARKit gramophone from Apple

  • USDZ files are zip files, unzip using platform specific program of your choice

    unzip teapot.usdz
    
  • Run usdview using HdOSPRay using

    HDOSPRAY_USE_PATH_TRACING=1 usdview --renderer OSPRay Gramophone.usdc
    

Building HdOSPRay

HdOSPRay source is available on GitHub at HdOSPRay. The master branch is typically the most stable branch and contains tagged releases.

Tags are of the form hdospray-vx.x.x-usdvx.x.x, with vx.x.x being the release of HdOSPRay and usdv being the version of USD it is built against. This is required due to the often changing internals of hydra calls in USD.

Currently HdOSPRay is regularly tested on Linux, which is the primary development target of USD itself. MacOS support in USD is experimental, but we often test against it. Windows support of USD is also experimental, but we have not tested HdOSPRay with it, so use at your own risk.

Prerequisites

  • USD v19.03
    • USD is primarily tested with Linux, but has experimental support for MacOS and Windows. For a full list of USD dependencies, see the USD page.
    • The plugin requires a minimum of PXR_BUILD_IMAGING and PXR_BUILD_OPENIMAGEIO_PLUGIN to be set to ON for USD.
  • OSPRay 1.8.x
  • Embree 3.2.x
  • CMake 3.1.1+

Optional Dependencies

  • OpenImageDenoise
    • Open Image Denoise also needs be be enabled in the OSPRay build
  • Ptex
    • Ptex will need to be enabled in the USD build
    • Can be downloaded and built by the USD build_usd.py script
    • Ptex module also needs to be enabled in the OSPRay build

Compiling HdOSPRay on Linux/MacOS

HdOSPRay plugin uses a CMake build system which links in USD and builds externally from the USD source directory, but configures CMake as if it were inside the USD repository in order to build the plugin using USD internals. It must therefore be built against a version of USD that matches HdOSPRay, which is specified in the versioning tag of HdOSPRay. To build USD, see the USD GitHub site. We recommend following the build scripts provided.

  • Download/clone the git repo for HdOSPRay

    $ git clone https://github.com/ospray/hdospray.git
    
  • Create a build directory and call CMake

    $ cd hdospray
    $ mkdir build
    $ cd build
    $ ccmake ..
    
  • Set pxr_DIR to the install directory of USD which contains pxrConfig.cmake

  • Set required USD options: usd-imaging and openimageio are required for both the USD and HdOSPRay builds

  • Set ospray_DIR to the directory containing your osprayConfig.cmake

    • This can be found in the root directory of the distributed binaries or if you are building and installing from source it can be found in <install>/lib/cmake/ospray-\*/
  • Set embree_DIR to install directory of Embree. These will be the same as ospray_DIR if you downloaded the OSPRay binaries

  • Compile and install HdOSPRay

    $ make -j install
    

The plugin should now be in <usd install directory>/plugin/usd/hdOSPRay

Compiling HdOSPRay on Windows

Windows support of USD is experimental. We have not tested HdOSPRay with it, so use at your own risk.

Documentation

Running

Once built, the plugin code should be located in your usd install directory under plugin/usd/HdOSPRay. Run usdview <scenefile> and select view->Hydra and then Renderer->OSPRay.

OSPRay can be set to the default renderer by either

  • Setting the HD_DEFAULT_RENDERER environment variable

    $ export HD_DEFAULT_RENDERER=OSPRay
    
  • Specifying --renderer OSPRay as a command line argument to usdview

Environment variables

  • HDOSPRAY_SAMPLES_PER_FRAME

    Number of samples per pixel

  • HDOSPRAY_SAMPLES_TO_CONVERGENCE

    Will progressively render frames until this many samples per pixel, then stop rendering

  • HDOSPRAY_AMBIENT_OCCLUSION_SAMPLES

    Number of ambient occlusion samples to compute per pixel. Does not affect path tracer.

  • HDOSPRAY_CAMERA_LIGHT_INTENSITY

    Globally modify the intensity of all lights

  • HDOSPRAY_USE_PATH_TRACING

    Use Monte Carlo path tracer instead of faster Whitted-style renderer

  • HDOSPRAY_INIT_ARGS

    Specify arguments sent on to OSPRay for initialization. e.g. enable MPI

  • HDOSPRAY_USE_DENOISER

    If built in, enable the denoiser

Features

  • Denoising using Open Image Denoise
  • Distributed multi-node rendering over MPI
  • UVTextures
  • Ptex
  • Triangle meshes
  • Quad meshes
  • Shadows
  • Ambient occlusion
  • Path tracing
  • Physically-based materials
  • Principled shader (similar to Disney BSDF shader)

TODOs

  • Picking does not work in HdOSPRay. You cannot select objects in the viewer yet
  • Custom lights. We are waiting to get actual USD files that specify these to test
  • Custom GUI widgets. We will add the env vars as python widgets
  • Simple lights. These are GL specific in USD and are the lights modified in the main menu
  • Subdivision surfaces. This was put into OSPRay and we will be working on putting this in a future HdOSPRay release
  • OSL shaders. They are a work in progress in OSPRay
  • Binary releases. We hope to provide these soon

hdospray's People

Contributors

carsonbrownlee avatar brucecherniak avatar ahota avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.