Home

Awesome

Layered Shading (LaSh)

LashLayers

This repository and its associated documentation contain the latest public reference implementation of the paper Layering Displaced Materials with Thickness, Accumulation, and Size.

Similar to the Laika Production Shading Library for RenderMan 20 from which it is derived, LaSh incorporates bxdfs and displacements into its definition of a LaSh Material so that it can represent a true physical substance, and implements a bxdf and displacement layering capability so LaSh Materials can be easily layered in a physically plausible way.

Documentation is in the doc directory.

As a bonus, this repository also contains the Siggraph 2023 Shader Writing in Open Shading Language course Supplementary Material shading nodes.

Please feel free to use the Discussions Tab. I'd love you hear what you think, or to discuss any issues or thoughts you may have about this repository and its Layered Shading implementation.

Requirements

Other rendering and application systems can still make use of the core osl shading nodes and make system to assemble the necessary functionality to implement the LaSh system in those environments.

Quick Start

To use the supplied repository content as is:

  1. Set up RenderMan:

    1. Install RenderManProServer and ensure it is functioning properly.

    2. Optionally install Katana and RenderMan for Katana and ensure they are functioning properly. While optional, this step is highly recommended, as the core LaSh functionality is packaged into Katana ShadingGroup macros. If another RenderMan Bridge Application is used, you'll have to implement their functionality yourself using the individual osl and Lama shading nodes.

  2. Set these environment variables appropriately. These are required by the make system that's used to compile and install the shaders:

    • PIXAR_ROOT
    • RMAN_VERSION

    For example, if your version of RenderManProServer is installed in /opt/pixar/RenderManProServer-25.0, then using bash shell:

    export PIXAR_ROOT="/opt/pixar"
    export RMAN_VERSION="25.0"
    

    Since RenderManProServer requires an RMANTREE environment variable to be set to its installation location, you can conveniently use these to define it as well:

    export RMANTREE="${PIXAR_ROOT}/RenderManProServer-${RMAN_VERSION}"
    
  3. Download or clone this repository.

  4. cd into the dowloaded or cloned repository's directory.

  5. At this point, you can use the make or make all command (they are equivalent) to build the shaders. You can also cd osl into the osl directory and make the shaders there. The osl Makefile will only make shaders for .osl files that are more recent than their complied shader. In this way, you can edit a source file and execute make from within the osl directory and only the updated source file(s) will be built.

    make clean and make help can also be executed from either the top-level directory or the osl directory. make clean removes the built shaders, and make help provides additional information about the make system and how it's controlled.

  6. Set these environment variables appropriately.

    1. This is required so the built shaders can be found by RenderMan and a RenderMan Bridge Application:

      • RMAN_SHADERPATH

      For example, if you downloaded or cloned this repository to ${HOME}/LaSh, then using bash shell:

      export RMAN_SHADERPATH="${HOME}/LaSh/build/${RMAN_VERSION}/shaders:${RMAN_SHADERPATH}"
      
    2. If you're using Katana and you want to make use of the supplied ShadingGroup macros and the shading node "alt+p" and "alt+shift+p" Shading Node Menus:

      export KATANA_RESOURCES="${HOME}/LaSh/build/katana:${KATANA_RESOURCES}"
      

      so that katana will load them when it starts.

License

This repository's content is licensed under either the

at your option.