Iray SDK API nvidia_logo_transpbg.gif Up
Getting Started

NeurayProductName is a rendering component that you can embed in your application to provide advanced rendering functionality for your application.

The Iray SDK API is a C++ API. The Iray library is provided as a dynamic library, which can be linked to your application or dynamically loaded at runtime.

Overview

The Iray library release contains the following parts:

  • A platform-dependent shared library (a.k.a. DLL) named libneuray.
  • A set of platform-independent C++ include files, see the Iray SDK API Include Files Section for all available module specific include files.
  • A collection of example programs; see the Tutorial and Example Programs Section.
  • A programmers manual (this document).
  • Installation instructions.

Recommendation

It is recommended that you read the brief Library Design Section and continue with the Tutorial and Example Programs Section. The Configuration Options Section describes how to configure aspects of the library to your particular integration demands.

How to Compile a Program

The Iray library release contains a set of example programs. It is recommended that you compile them and take them as a starting point for your own development.

The release contains a Makefile to build the examples on Linux and MacOS X platforms as well as solution files for Visual Studio 2012 to build the examples on a Microsoft Windows platform.

You can integrate the Iray library easily in other build environments. You can even compile the examples by hand following the steps below. Let the environment variable $NEURAY_ROOT refer to the installation root of the Iray library.

  1. Use the Iray include files in your source:
    #include <mi/neuraylib.h>
    Iray SDK API.
    Load the Iray library dynamically and access the API entry point:
    mi::neuraylib::INeuray* neuray = load_and_get_ineuray();
    This is an object representing the Iray library.
    Definition: ineuray.h:44
    See examples/example_shared.h for the definition of this convenience method. Alternatively, if you want to use the mi::base::Handle class:
    mi::base::Handle<mi::neuraylib::INeuray> neuray( load_and_get_ineuray());
    Handle class template for interfaces, automatizing the lifetime control via reference counting.
    Definition: handle.h:113
    For a start, you can copy the examples that come with the Iray release, make them writable, and change into that directory:
    cp -r $NEURAY_ROOT/examples .
    chmod -R u+w examples
    cd examples
  2. Compile the program with the appropriate include path switch that points the compiler to the location of the Iray include files. A g++ compiler call could look like this:
    g++ -I$NEURAY_ROOT/include -c example_start_shutdown.cpp -o example_start_shutdown.o -pthread
  3. Link the program with the library that provides dlopen(). A g++ linker call could look like this:
    g++ -o example_start_shutdown example_start_shutdown.o -ldl -pthread
  4. Make the shared library (a.k.a. DLL) known to your runtime system so that it is found when starting the example program. You can do this by placing the shared library in an appropriate location, and/or setting environment variables such as PATH (on Windows), LD_LIBRARY_PATH (on Linux), or DYLD_LIBRARY_PATH and DYLD_FRAMEWORK_PATH (on MacOS X). Note: This step is platform and installation dependent.