---
title: Creating a 3D application with hydra rendering
framework: metal
role: sampleCode
role_heading: Sample Code
path: sample-code/metal/creating-a-3d-application-with-hydra-rendering
---

# Creating a 3D application with hydra rendering

Build a 3D application that integrates with Hydra and USD.

## Overview

Overview note: This sample code project is associated with WWDC22 session 10141: Explore USD tools and rendering. Configure the sample code project This sample requires Xcode 14 or later and macOS 13 or later. To build the project, you first need to get and build the USD source code from the Pixar GitHub repository, and then use CMake to generate an Xcode project with references to both the compiled USD libraries and the header files in the USD source code. If you don’t already have CMake installed, download the latest version of CMake to your Applications folder. CMake is both a GUI and command-line app. To use the command-line tool, open a Terminal window and add the /Contents/bin folder from the CMake.app application bundle to your PATH environment variable, like this: path+=('/Applications/CMake.app/Contents/bin/') export PATH note: The previous command assumes you use the default zsh shell and adds cmake to your path for only the current terminal session. To add cmake to your path permanently, or if you’re using another shell like bash, add /Applications/CMake.app/Contents/bin/ to the $PATH declaration in your .zshrc file or in the configuration file your shell uses. Clone the USD repo, using the following command: git clone https://github.com/PixarAnimationStudios/USD Next, build USD using the following command: python3 <path to usd source>/build_scripts/build_usd.py --generator Xcode --no-python <path to install the built USD>. For example, if you’ve cloned the USD source code into ~/dev/USD, the build command might look like this: python3 ~/dev/USD/build_scripts/build_usd.py --generator Xcode --no-python ./USDInstall Configure the USD_Path environment variable: export USD_PATH=<path to usd install>. For example, if you’ve installed USD at ~/dev/USDInstall, use this command:  export USD_PATH=~/dev/USDInstall Run the following CMake command to generate an Xcode project: cmake -S <path to project source folder> -B <path to directory where it creates the Xcode project>. If the sample code is at ~/dev/, the command might look like this:  cmake -S ~/dev/CreatingA3DApplicationWithHydraRendering/ -B ~/dev/CreatingA3DApplicationWithHydraRendering/ Finally, open the generated Xcode project, and change the scheme to hydraplayer. important: You’re responsible for abiding by the terms of the license(s) associated with the code from the USD repo.

## See Also

### Render workflows

- [Using Metal to draw a view’s contents](metal/using-metal-to-draw-a-view's-contents.md)
- [Drawing a triangle with Metal 4](metal/drawing-a-triangle-with-metal-4.md)
- [Selecting device objects for graphics rendering](metal/selecting-device-objects-for-graphics-rendering.md)
- [Customizing render pass setup](metal/customizing-render-pass-setup.md)
- [Creating a custom Metal view](metal/creating-a-custom-metal-view.md)
- [Calculating primitive visibility using depth testing](metal/calculating-primitive-visibility-using-depth-testing.md)
- [Encoding indirect command buffers on the CPU](metal/encoding-indirect-command-buffers-on-the-cpu.md)
- [Implementing order-independent transparency with image blocks](metal/implementing-order-independent-transparency-with-image-blocks.md)
- [Loading textures and models using Metal fast resource loading](metal/loading-textures-and-models-using-metal-fast-resource-loading.md)
- [Adjusting the level of detail using Metal mesh shaders](metal/adjusting-the-level-of-detail-using-metal-mesh-shaders.md)
- [Culling occluded geometry using the visibility result buffer](metal/culling-occluded-geometry-using-the-visibility-result-buffer.md)
- [Improving edge-rendering quality with multisample antialiasing (MSAA)](metal/improving-edge-rendering-quality-with-multisample-antialiasing-msaa.md)
- [Achieving smooth frame rates with a Metal display link](metal/achieving-smooth-frame-rates-with-a-metal-display-link.md)
