Skip to content

mruegenberg/mrAiHouOceanShader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mrAiHouOceanShader

This project derives from mrAiVexShader to render Houdini Ocean spectra directly in Arnold, without exporting displacement maps or similar.

Prerequisites

  • An installation of Houdini
  • The right compiler version matching your Houdini. You can find this in Help > About Houdini > Show Details > Build platform.
    For Linux, this would be GCC 6.3 in the case of Houdini 18.5 (though Clang/LLVM also appears to work fine), for Windows, you'll need to install Visual Studio (include the Windows SDK as well as the Windows 10 C++ SDK), for OS X you'll need Xcode. For details, see the Houdini HDK documentation.

Compilation/Installation

  1. Get the Arnold SDK for your system and Arnold version from SolidAngle and put it in deps.
  2. Adjust the path to match your Arnold SDK and Houdini versions in compile.sh / compile.bat
    (depending on your system, you just need to modify the .bat (Windows) or .sh (Linux/OS X)).
  3. Windows only: you might also have to modify the MSVCDir line in compile.bat to point to where you installed it
    (by default, the system variable is used and if that is not defined, we assume Visual Studio Community Edition).
  4. Run the script for your OS from the command line
  5. Copy ai_ocean_samplelayers.dll/.so/.dylib from the build to the dso directory in your Arnold installation (or wherever your Arnold looks for shaders).
    Do the Same with the .mtd file from the src folder (this provides the shader UI). It's easiest to put both somewhere in your ARNOLD_PLUGIN_PATH (and potentially add [ARNOLD_PLUGIN_PATH] to the Procedural Path in the System section of your Arnold settings).
  6. Start Houdini with Arnold and have some fun. (It's theoretically even possible to use this without Houdini, e.g in Maya or C4D, but you will probably use that to author the ocean spectra anyway.)

Usage

  1. Cache your ocean spectra to disk with the regular Houdini workflow for this.
  2. In you Arnold Shader Network or Arnold Material Builder, create a new Ai Ocean Samplelayers node.
  3. Connect its output to the input slot of a Vector Map node with Tangent Space disabled, and connect that to the displacement slot on your Material Output node.
  4. The a output of Ai Ocean Samplelayers corresponds to the cusp output of Houdini's Ocean Sample Layers node and can be used for shading

Examples

See the blog post

Status and Limitations

Limitations

  • At the moment, the Arnold render still starts significantly slower than the Houdini version, probably due to differences in renderer architecture/displacement performance.
  • No possibility to export velocity or cuspdir. This is due to Arnold shaders always having only one output.
  • the Anti-Alias Blur parameter is not supported. To achieve a similar result, just reduce the maximum subdivision iterations.

Future Plans

  • possibly provide better support for cusp by creating a separate shading node which outputs the value (and gets it from the main shader via message passing

  • create an auxiliary shader to output bump/normal maps for reducing the amount of subdivisions needed