### Install MoonRay Build Source: https://github.com/dreamworksanimation/openmoonray/blob/main/building/general_build.md Install the compiled binaries to a specified directory. ```bash cmake --install . --prefix ``` -------------------------------- ### Build and install repository Source: https://github.com/dreamworksanimation/openmoonray/blob/main/building/general_build.md Compile the project using the build system and install the resulting binaries to the specified directory. ```bash cmake --build . -- -j $(nproc) cmake --install . --prefix ``` -------------------------------- ### Create MoonRay Directories Source: https://github.com/dreamworksanimation/openmoonray/blob/main/building/Rocky9/rocky9_build.md Sets up the necessary directory structure for MoonRay installations, builds, dependencies, and source code. Ensure these directories are clean before starting a new build. ```bash mkdir -p /opt/MoonRay/{installs,build,build-deps,source} mkdir -p /opt/MoonRay/installs/{bin,lib,include} ``` -------------------------------- ### Setup MoonRay Environment and Run GUI Source: https://github.com/dreamworksanimation/openmoonray/blob/main/building/macOS/macOS_build.md Sources the MoonRay setup script to add it to the PATH and then runs the MoonRay GUI with specified arguments. This is for testing the build. ```bash source /Applications/MoonRay/installs/openmoonray/scripts/setup.sh cd /Applications/MoonRay/openmoonray/testdata moonray_gui -exec_mode xpu -info -in curves.rdla ``` -------------------------------- ### Set Installation Prefix Source: https://github.com/dreamworksanimation/openmoonray/blob/main/arras/CMakeLists.txt Configures the installation directory for the project artifacts. ```cmake set(CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR}/../release) ``` -------------------------------- ### Setup MoonRay Environment Source: https://github.com/dreamworksanimation/openmoonray/blob/main/building/Rocky9/rocky9_build.md Sources the MoonRay setup script to add its binaries and libraries to the system's PATH. This is necessary before running MoonRay executables or tests. ```bash source /opt/MoonRay/installs/openmoonray/scripts/setup.sh ``` -------------------------------- ### Install Executable Programs with CMake Source: https://github.com/dreamworksanimation/openmoonray/blob/main/arras/distributed/scripts/CMakeLists.txt Configures the installation of specific binary files to the bin directory during the build process. ```cmake install(PROGRAMS run_minicoord run_node run_arras_render DESTINATION bin) ``` -------------------------------- ### Houdini Integration Setup Source: https://github.com/dreamworksanimation/openmoonray/blob/main/building/Rocky9/rocky9_build.md Sets up the environment for running MoonRay within Houdini. This involves sourcing Houdini's setup script and a specific MoonRay setup script for Houdini. ```bash cd /opt/hfs20.0 # location of houdini install source houdini_setup source /opt/MoonRay/source/openmoonray/scripts/Rocky9/setupHoudini.sh ``` -------------------------------- ### Setup Houdini Environment for MoonRay Source: https://github.com/dreamworksanimation/openmoonray/blob/main/building/macOS/macOS_build.md Sources the Houdini-specific setup script for MoonRay and then launches Houdini. This is for users integrating MoonRay with Houdini. ```bash source /Applications/MoonRay/openmoonray/scripts/macOS/setupHoudini.sh houdini ``` -------------------------------- ### Initialize MoonRay Environment Source: https://context7.com/dreamworksanimation/openmoonray/llms.txt Source the setup script to configure necessary environment variables for MoonRay tools. ```bash #!/bin/bash # Source the MoonRay setup script after installation source /opt/MoonRay/installs/openmoonray/scripts/setup.sh # Key environment variables set by setup.sh: ``` -------------------------------- ### Install Build Dependencies Source: https://github.com/dreamworksanimation/openmoonray/blob/main/building/Rocky9/rocky9_container_build.md Sources a script within the container to install necessary RPM packages and set up environment variables for building. Use '--nocuda' to omit Cuda/GPU support. ```bash source /source/building/Rocky9/install_packages.sh --nocuda ``` -------------------------------- ### Test MoonRay Installation Source: https://github.com/dreamworksanimation/openmoonray/blob/main/building/general_build.md Commands to verify the installation using command-line tools, GUI applications, and the Hydra plugin. ```bash > moonray -in /source/testdata/rectangle.rdla -out /tmp/rectangle.exr ``` ```bash > moonray_gui -in /source/testdata/rectangle.rdla -out /tmp/rectangle.exr ``` ```bash > hd_render -in /source/testdata/sphere.usd -out /tmp/sphere.exr ``` -------------------------------- ### Install System Packages Source: https://github.com/dreamworksanimation/openmoonray/blob/main/building/general_build.md Execute the package installation script within the current shell environment to ensure environment changes are applied. ```bash source building/Rocky9/install_packages.sh ``` -------------------------------- ### Install System Dependencies Source: https://github.com/dreamworksanimation/openmoonray/blob/main/building/Rocky9/rocky9_build.md Installs essential system packages and the CUDA toolkit using DNF. The script `install_packages.sh` handles MoonRay-specific dependencies. Use `--nocuda` or `--noqt` flags to skip GPU or GUI support. ```bash sudo source openmoonray/building/Rocky9/install_packages.sh sudo dnf install -y cuda-toolkit ``` -------------------------------- ### Setup and Run MoonRay Render Source: https://github.com/dreamworksanimation/openmoonray/blob/main/building/Rocky9/rocky9_container_build.md Sets up the MoonRay environment and then renders a scene file using the 'moonray' command-line tool. The output is saved to a temporary EXR file. ```bash > source /installs/openmoonray/scripts/setup.sh > moonray -in /source/testdata/rectangle.rdla -out /tmp/rectangle.exr ``` -------------------------------- ### Build MoonRay from Source Source: https://context7.com/dreamworksanimation/openmoonray/llms.txt Complete build process for Rocky Linux 9, including dependency installation and verification. ```bash # Create directory structure mkdir -p /opt/MoonRay/{installs,build,build-deps,source} mkdir -p /opt/MoonRay/installs/{bin,lib,include} # Clone source with submodules cd /opt/MoonRay/source git lfs install git clone --recurse-submodules https://github.com/dreamworksanimation/openmoonray.git # Install system packages (requires root) sudo source openmoonray/building/Rocky9/install_packages.sh # Add --nocuda for CPU-only, --noqt to skip GUI apps # Build third-party dependencies cd /opt/MoonRay/build-deps cmake ../source/openmoonray/building/Rocky9 cmake --build . -- -j $(nproc) # Build MoonRay cd /opt/MoonRay/source/openmoonray cmake --preset rocky9-release cmake --build --preset rocky9-release -- -j $(nproc) # Verify installation source /opt/MoonRay/installs/openmoonray/scripts/setup.sh moonray -in testdata/sphere.rdla -out /tmp/sphere.exr ``` -------------------------------- ### Install CMake GUI on macOS Source: https://github.com/dreamworksanimation/openmoonray/blob/main/building/macOS/macOS_build.md Installs the CMake GUI application to the Applications directory. Ensure CMake version 3.26.5 or greater is downloaded. ```bash sudo "/Applications/CMake.app/Contents/bin/cmake-gui" --install ``` -------------------------------- ### Start Rocky Linux 9 Docker Container Source: https://github.com/dreamworksanimation/openmoonray/blob/main/building/Rocky9/rocky9_container_build.md Starts a new Docker container using the rockylinux:9 image. It mounts the local openmoonray directory and /tmp into the container. Use '--security-opt seccomp=unconfined' for compatibility. ```bash > docker run -v :/source -v /tmp:/tmp --security-opt seccomp=unconfined --rm -it rockylinux:9 ``` -------------------------------- ### Configure User Settings Source: https://github.com/dreamworksanimation/openmoonray/blob/main/building/macOS/CMakeLists.txt Sets the base installation root and Python environment variables for the build process. ```cmake set(InstallRoot ${rootSrcDir}/../../../../installs CACHE FILEPATH "Install root for dependencies") set(PythonVer 3.9.6 CACHE STRING "Python version (n.m), e.g. 3.6") set(PythonRoot /usr CACHE FILEPATH "Location of Python install") ``` -------------------------------- ### CMake Minimum Version and Project Setup Source: https://github.com/dreamworksanimation/openmoonray/blob/main/arras/CMakeLists.txt Sets the minimum required CMake version and defines the project name, version, and languages. ```cmake cmake_minimum_required (VERSION 3.23.1) project(Arras VERSION 4.9.0 LANGUAGES CXX) ``` -------------------------------- ### Install Git LFS Source: https://github.com/dreamworksanimation/openmoonray/blob/main/CONTRIBUTING.md Ensure Git Large File Storage (LFS) is installed before cloning the MoonRay project, as it is used for tracking larger files. ```bash git lfs install ``` -------------------------------- ### Create MoonRay Directory Structure Source: https://github.com/dreamworksanimation/openmoonray/blob/main/building/macOS/macOS_build.md Sets up the necessary directory structure for MoonRay installations, builds, dependencies, and source code. This should be done in a clean root folder. ```bash mkdir -p /Applications/MoonRay/{installs,build,build-deps,source} mkdir -p /Applications/MoonRay/installs/{bin,lib,include} ``` -------------------------------- ### Build Dependencies with Custom Install Path Source: https://github.com/dreamworksanimation/openmoonray/blob/main/building/general_build.md Override the default installation directory for dependencies by setting the InstallRoot variable during the CMake configuration step. ```bash cmake /source/building/Rocky9 -DInstallRoot=~/moonray/dependencies cmake --build . -- -j $(nproc) ``` -------------------------------- ### Clone OpenMoonRay Source Source: https://github.com/dreamworksanimation/openmoonray/blob/main/building/Rocky9/rocky9_build.md Installs Git and Git LFS, then clones the OpenMoonRay repository. This step assumes you are in the /opt/MoonRay/source directory. ```bash sudo dnf install -y git git-lfs cd /opt/MoonRay/source git clone --recurse-submodules https://github.com/dreamworksanimation/openmoonray.git ``` -------------------------------- ### Run Distributed Rendering with Arras Source: https://context7.com/dreamworksanimation/openmoonray/llms.txt Commands to start the coordinator, render nodes, and initiate a distributed render job. ```bash # Terminal 1: Start the coordinator service cd /opt/MoonRay/installs/openmoonray ./run_minicoord # Python prompt appears when coordinator is ready # Terminal 2: Start a render node (same or different machine) ./run_node # Node registers with minicoord automatically # Terminal 3: Launch distributed render ./run_arras_render /path/to/scene.rdla # Rendering distributed across registered nodes # For multi-machine setup, replace 'localhost' with coordinator hostname # in run_node script before launching on remote machines ``` -------------------------------- ### Render USD Scene with hd_render Source: https://github.com/dreamworksanimation/openmoonray/blob/main/moonray/hydra/README.md Test your setup by rendering a USD scene using the hd_render command. Specify input USD file and output EXR file. ```bash ${rel_root}/bin/hd_render -in -out ``` -------------------------------- ### Run New OpenMoonRay Container Source: https://github.com/dreamworksanimation/openmoonray/blob/main/building/Rocky9/rocky9_container_build.md Starts a new Docker container from the committed 'openmoonray' image. It mounts the local openmoonray directory and /tmp for access to source files and temporary storage. ```bash > docker run -v :/source -v /tmp:/tmp --security-opt seccomp=unconfined --rm -it openmoonray ``` -------------------------------- ### Run MoonRay GUI Test Source: https://github.com/dreamworksanimation/openmoonray/blob/main/building/Rocky9/rocky9_build.md Executes a test scene using the MoonRay GUI in XPU mode. This verifies the installation and rendering capabilities. ```bash cd /opt/MoonRay/source/openmoonray/testdata moonray_gui -exec_mode xpu -info -in curves.rdla ``` -------------------------------- ### Post-build Cleanup Source: https://github.com/dreamworksanimation/openmoonray/blob/main/building/Rocky9/rocky9_build.md Removes the MoonRay build and build-deps directories after a successful build and installation to free up disk space. ```bash rm -rf /opt/MoonRay/{build,build-deps} ``` -------------------------------- ### Add scene_rdl2 bin to PATH Source: https://github.com/dreamworksanimation/openmoonray/blob/main/building/general_build.md Add the bin directory of the installed scene_rdl2 repository to the system PATH to provide access to the rdl2_json_exporter program. ```bash export PATH=/bin:${PATH} ``` -------------------------------- ### Build MoonRay Dependencies Source: https://github.com/dreamworksanimation/openmoonray/blob/main/building/macOS/macOS_build.md Configures and builds the project dependencies for MoonRay. Use '-DNO_USD=1' if building for Houdini to skip USD compilation. Ensure build-deps and installs directories are clean if previously built without this flag. ```bash cd /Applications/MoonRay/build-deps cmake ../building/macOS cmake --build . ``` -------------------------------- ### Configure GLFW External Project Source: https://github.com/dreamworksanimation/openmoonray/blob/main/building/Rocky9/CMakeLists.txt Integrates the GLFW library from GitHub with specific build flags to disable examples, tests, and documentation. ```cmake ExternalProject_Add(GLFW GIT_REPOSITORY https://github.com/glfw/glfw GIT_TAG 3.4 BUILD_COMMAND make ${JOBS_ARG} CMAKE_ARGS -DCMAKE_PREFIX_PATH:PATH=${InstallRoot} -DCMAKE_INSTALL_PREFIX:PATH=${InstallRoot} -DGLFW_BUILD_EXAMPLES=OFF -DGLFW_BUILD_TESTS=OFF -DGLFW_BUILD_DOCS=OFF -DGLFW_INSTALL=ON -DBUILD_SHARED_LIBS=ON DEPENDS ${CHAIN} ) set(CHAIN GLFW) ``` -------------------------------- ### Configure OptiX Headers External Project Source: https://github.com/dreamworksanimation/openmoonray/blob/main/building/Rocky9/CMakeLists.txt Copies OptiX header files from a remote repository into the project installation directory without performing a build. ```cmake ExternalProject_Add(OptiXHeaders GIT_REPOSITORY https://github.com/NVIDIA/optix-dev GIT_TAG v7.6.0 INSTALL_DIR ${InstallRoot} CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory /include /include DEPENDS ${CHAIN} ) set(CHAIN OptiXHeaders) ``` -------------------------------- ### Configure and Build Dependencies Source: https://github.com/dreamworksanimation/openmoonray/blob/main/building/Rocky9/rocky9_container_build.md Creates a build directory, navigates into it, and configures the build using CMake. It then builds the dependencies using all available processor cores. ```bash > mkdir /build > cd /build > cmake /source/building/Rocky9 > cmake --build . -- -j $(nproc) ``` -------------------------------- ### Interactive Rendering with moonray_gui Source: https://context7.com/dreamworksanimation/openmoonray/llms.txt Launch the Qt-based interactive viewer for real-time previewing. Use flags to specify execution modes and input files. ```bash # Launch GUI with a scene file moonray_gui -in scene.rdla -out output.exr # Launch GUI in XPU (GPU) mode with verbose output moonray_gui -exec_mode xpu -info -in curves.rdla # Interactive rendering session moonray_gui -in /path/to/source/testdata/sphere.rdla -out /tmp/sphere.exr ``` -------------------------------- ### Build MoonRay with CMake Source: https://github.com/dreamworksanimation/openmoonray/blob/main/building/general_build.md Standard commands to configure and build the project from an empty directory. ```bash cmake cmake --build . -- -j $(nproc) ``` -------------------------------- ### Configure Scene Lighting Source: https://context7.com/dreamworksanimation/openmoonray/llms.txt Set up environment, area, and distant lights. Use LightSet to group multiple light sources together. ```lua -- Environment light for image-based lighting EnvLight("env") { } -- Rectangular area light with color and dimensions RectLight("/scene/arealights/main") { ["node_xform"] = blur( Mat4(-0.42, 0, -0.91, 0, 0, -1, 0, 0, -0.91, 0, 0.42, 0, -0.28, 0.23, 0.16, 1), Mat4(-0.42, 0, -0.91, 0, 0, -1, 0, 0, -0.91, 0, 0.42, 0, -0.28, 0.23, 0.16, 1) ), ["visible_in_camera"] = "force on", ["color"] = Rgb(2, 2, 2), ["normalized"] = false, ["apply_scene_scale"] = false, ["width"] = 0.385, ["height"] = 0.449, } -- Light set grouping multiple lights LightSet("lightSet") { EnvLight("env"), RectLight("/scene/arealights/main"), } ``` -------------------------------- ### Build Dependencies from Source Source: https://github.com/dreamworksanimation/openmoonray/blob/main/building/general_build.md Commands to initialize a build directory and compile dependencies using the provided CMake project files. ```bash mkdir /build cd /build cmake /source/building/Rocky9 cmake --build . -- -j $(nproc) ``` -------------------------------- ### Clone OpenMoonRay Repository Source: https://github.com/dreamworksanimation/openmoonray/blob/main/building/Rocky9/rocky9_container_build.md Clones the OpenMoonRay source code from GitHub, including all submodules. Ensure you have Git LFS installed. ```bash > git clone --recurse-submodules https://github.com/dreamworksanimation/openmoonray.git ``` -------------------------------- ### Configure OpenMoonRay Third-Party Dependencies Source: https://github.com/dreamworksanimation/openmoonray/blob/main/building/macOS/CMakeLists.txt Initializes the CMake project and sets up parallel build jobs based on available processor count. ```cmake # Copyright 2023-2024 DreamWorks Animation LLC # SPDX-License-Identifier: Apache-2.0 # These ExternalProject targets can be used to download, build and # install many of the Moonray dependencies. # The targets are chained using dependencies so that they run # serially. cmake_minimum_required (VERSION 3.23.1) project(openmoonray_third_party) include(ExternalProject) cmake_policy(SET CMP0135 NEW) include(ProcessorCount) ProcessorCount(N) if(NOT N EQUAL 0) set(JOBS_ARG -j${N}) endif() file(REAL_PATH ${CMAKE_SOURCE_DIR} rootSrcDir) set(THIS_DIR ${CMAKE_CURRENT_SOURCE_DIR}) ``` -------------------------------- ### Cleanup MoonRay Build Directories Source: https://github.com/dreamworksanimation/openmoonray/blob/main/building/macOS/macOS_build.md Removes the MoonRay build and build-deps directories after a successful build and installation to save disk space. ```bash rm -rf /Applications/MoonRay/{build,build-deps} ``` -------------------------------- ### Execute moonray_gui in Docker Source: https://github.com/dreamworksanimation/openmoonray/blob/main/building/Rocky9/rocky9_container_build.md Commands to launch the container with appropriate X11 forwarding and execute the GUI application. ```bash > docker run -v :/source -v /tmp:/tmp -e DISPLAY=$DISPLAY -e XAUTHORITY=${XAUTHORITY} -v "${XAUTHORITY}:${XAUTHORITY}:z" --security-opt seccomp=unconfined --rm -it openmoonray > source /installs/openmoonray/scripts/setup.sh > moonray_gui -in /source/testdata/rectangle.rdla -out /tmp/rectangle.exr ``` -------------------------------- ### Render Scenes via Command Line Source: https://context7.com/dreamworksanimation/openmoonray/llms.txt Execute rendering tasks using the moonray CLI or hd_render for USD files. Supports various flags for verbose output, XPU mode, and file paths. ```bash # Basic rendering of an RDLA scene file moonray -in scene.rdla -out output.exr # Render with verbose info output moonray -in scene.rdla -out output.exr -info # Render a USD file via Hydra hd_render -in scene.usd -out output.exr # Test render with sample scene data moonray -in /path/to/source/testdata/rectangle.rdla -out /tmp/rectangle.exr # Render with XPU (GPU-accelerated) mode moonray -exec_mode xpu -in scene.rdla -out output.exr ``` -------------------------------- ### Configure CMAKE_PREFIX_PATH for MoonRay dependencies Source: https://github.com/dreamworksanimation/openmoonray/blob/main/building/general_build.md Set the CMAKE_PREFIX_PATH environment variable to include the installation roots of required repositories like scene_rdl2 and mcrt_denoise. ```bash export CMAKE_PREFIX_PATH=:${CMAKE_PREFIX_PATH} export CMAKE_PREFIX_PATH=:${CMAKE_PREFIX_PATH} ``` -------------------------------- ### Build Dependencies from Source Source: https://github.com/dreamworksanimation/openmoonray/blob/main/building/Rocky9/rocky9_build.md Compiles MoonRay's dependencies from source. If building for Houdini, use `-DNOUSD=1` to skip building USD and ensure a clean build-deps directory beforehand. ```bash cd /opt/MoonRay/build-deps cmake ../source/openmoonray/building/Rocky9 cmake --build . -- -j $(nproc) ``` -------------------------------- ### Run HD Render Source: https://github.com/dreamworksanimation/openmoonray/blob/main/building/Rocky9/rocky9_container_build.md Renders a USD scene file using the 'hd_render' tool and saves the output to a temporary EXR file. ```bash > hd_render -in /source/testdata/sphere.usd -out /tmp/sphere.exr ``` -------------------------------- ### Build MoonRay Source: https://github.com/dreamworksanimation/openmoonray/blob/main/building/Rocky9/rocky9_container_build.md Cleans the build directory, navigates to the source directory, and configures MoonRay for release build using CMake presets, disabling OptiX. It then builds MoonRay using all available cores. ```bash > rm -rf /build/* > cd /source > cmake --preset rocky9-release -DMOONRAY_USE_OPTIX=NO > cmake --build --preset rocky9-release -- -j $(nproc) ``` -------------------------------- ### Build MoonRay Project Source: https://github.com/dreamworksanimation/openmoonray/blob/main/building/macOS/macOS_build.md Compiles the main MoonRay project. If building for Houdini, use the 'macos-houdini-release' preset instead of 'macos-release'. ```bash cd /Applications/MoonRay/openmoonray cmake --preset macos-release cmake --build --preset macos-release ``` -------------------------------- ### Docker Run Command for Building Source: https://github.com/dreamworksanimation/openmoonray/blob/main/building/general_build.md Build MoonRay inside a Docker container by mounting the source code and temporary directories. The --security-opt seccomp=unconfined option may be required for Rocky 9 images. ```bash docker run --security-opt seccomp=unconfined -v :/source -v /tmp:/tmp --network=host --rm -it rockylinux:9 ``` -------------------------------- ### Build MoonRay Source: https://github.com/dreamworksanimation/openmoonray/blob/main/building/Rocky9/rocky9_build.md Compiles the MoonRay project. For Houdini integration, use the `rocky9-houdini-release` preset instead of `rocky9-release`. ```bash cd /opt/MoonRay/source/openmoonray cmake --preset rocky9-release cmake --build --preset rocky9-release -- -j $(nproc) ``` -------------------------------- ### Run CMake for repository build Source: https://github.com/dreamworksanimation/openmoonray/blob/main/building/general_build.md Execute CMake in a build directory with the necessary source path and module path configuration. ```bash cmake /source/moonray/moonray -DCMAKE_MODULE_PATH=${CMAKE_MODULES_ROOT}/cmake -DPYTHON_EXECUTABLE=python3 -DBOOST_PYTHON_COMPONENT_NAME=python39 -DABI_VERSION=0 ``` -------------------------------- ### Create Symbolic Links for MoonRay Source: https://github.com/dreamworksanimation/openmoonray/blob/main/building/macOS/macOS_build.md Creates symbolic links within the MoonRay directory to organize the building and source directories. This helps in managing the project structure. ```bash cd /Applications/MoonRay ln -s source/openmoonray/building . ln -s source/openmoonray . ``` -------------------------------- ### Render USD Scenes with Hydra Source: https://context7.com/dreamworksanimation/openmoonray/llms.txt Define USD scenes with cameras, lights, and materials using MoonRay's Hydra render delegate. ```python #usda 1.0 def Camera "shot_cam" { matrix4d xformOp:transform = ( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0.5, 10, 1) ) uniform token[] xformOpOrder = ["xformOp:transform"] } def DistantLight "d_light" { matrix4d xformOp:transform = ( (0, 0, 1, 0), (0, 1, 0, 0), (-1, 0, 0, 0), (-10, 0, 0, 1) ) uniform token[] xformOpOrder = ["xformOp:transform"] float intensity = 1 bool normalize = true } def Sphere "sphere" ( prepend apiSchemas = ["MaterialBindingAPI"] ) { rel material:binding = } def Material "checkerboard" { color4f outputs:moonray:surface.connect = def Shader "baseMtl" { uniform token info:id = "BaseMaterial" color4f outputs:surface color3f inputs:diffuse_color.connect = <../checkerboardMap.outputs:out> } def Shader "checkerboardMap" { uniform token info:id = "CheckerboardMap" color3f inputs:color_A = (0,1,0) color3f inputs:color_B = (0,0,1) int inputs:num_u_tiles = 24 int inputs:num_v_tiles = 24 color3f outputs:out } } ``` -------------------------------- ### Clone OpenMoonRay Source Code Source: https://github.com/dreamworksanimation/openmoonray/blob/main/building/macOS/macOS_build.md Navigates to the source directory and clones the OpenMoonRay repository, including its submodules. Replace '' with the actual repository URL. ```bash cd /Applications/MoonRay/source git clone --recurse-submodules ``` -------------------------------- ### Instance Geometry with RdlInstancerGeometry Source: https://context7.com/dreamworksanimation/openmoonray/llms.txt Efficiently render multiple instances of geometry using per-instance transforms and attributes. Supports multi-level instancing by referencing other instancer nodes. ```lua -- Define base geometry types boxGeom = BoxGeometry("boxGeom") {} sphereGeom = SphereGeometry("sphereGeom") {} -- Per-instance color data colorData = UserData("colorData") { ["color_key"] = "Cd", ["color_values_0"] = { Rgb(1.0, 0.0, 0.0), Rgb(0.0, 1.0, 0.0), Rgb(0.0, 0.0, 1.0), Rgb(1.0, 0.0, 1.0), Rgb(0.0, 1.0, 1.0), }, } -- Create instances with positions, rotations, and scales SingleTree = RdlInstancerGeometry("SingleTree") { ["references"] = { boxGeom, sphereGeom }, ["ref_indices"] = {0, 1, 0, 1, 0}, ["positions"] = { Vec3(-0.04, 0.05, 0.0), Vec3(0.04, 0.10, 0.0), Vec3(-0.04, 0.15, 0.0), Vec3(0.04, 0.2, 0.0), Vec3(-0.04, 0.25, 0.0), }, ["orientations"] = { Vec4(0.0, 0.0, -0.487175, -0.873305), Vec4(0.0, 0.0, 0.0, 0.0), Vec4(0.0, -0.487175, 0.0, -0.873305), Vec4(0.0, 0.0, 0.0, 0.0), Vec4(0.0, 0.0, 0.0, 0.0), }, ["scales"] = { Vec3(0.075, 0.025, 0.025), Vec3(0.025, 0.025, 0.025), Vec3(0.05, 0.025, 0.1), Vec3(0.025, 0.05, 0.025), Vec3(0.05, 0.05, 0.05), }, ["primitive_attributes"] = { colorData }, } -- Multi-level instancing (instances of instances) GroupOfTrees = RdlInstancerGeometry("GroupOfTrees") { ["references"] = { SingleTree }, ["positions"] = { Vec3(-0.1, 0.0, 0.0), Vec3(-0.0, 0.1, -0.2), Vec3(0.1, 0.0, 0.0), }, ["primitive_attributes"] = { colorData2 }, } ``` -------------------------------- ### Generate Shader JSON Descriptions Source: https://github.com/dreamworksanimation/openmoonray/blob/main/moonray/hydra/README.md Use the rdl2_json_exporter to generate JSON descriptions for all shaders. Ensure the output directory path has a trailing slash. ```bash rel_root= export RDL2_DSO_PATH=${rel_root}/rdl2dso.proxy ${rel_root}/bin/rdl2_json_exporter --out ${rel_root}/shader_json/ --sparse ``` -------------------------------- ### Configure CMake Build Options Source: https://context7.com/dreamworksanimation/openmoonray/llms.txt Various CMake configurations for customizing features, dependencies, and integration targets. ```bash # Standard build with all features cmake \ -DPYTHON_EXECUTABLE=python3 \ -DBOOST_PYTHON_COMPONENT_NAME=python39 \ -DABI_VERSION=0 # Build without GPU/XPU support cmake \ -DMOONRAY_USE_OPTIX=NO \ -DPYTHON_EXECUTABLE=python3 # Build without Qt GUI applications cmake \ -DBUILD_QT_APPS=NO \ -DPYTHON_EXECUTABLE=python3 # Build for Houdini integration cmake --preset rocky9-houdini-release # Using custom dependency locations export CMAKE_PREFIX_PATH=/custom/deps:${CMAKE_PREFIX_PATH} export JSONCPP_ROOT=/custom/jsoncpp export OPENSUBDIV_ROOT=/custom/opensubdiv cmake ```