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.
make
python3
- Pixar's RenderMan is used in the examples
and the
make
system. - Foundry's Katana and its
associated RenderMan Bridge Application
are required to make use of the high-level ShadingGroup macros,
which contain the LaSh Material Layering and other functionality packaged for use in Katana,
as well as the supplied Katana
project
scene files.
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.
To use the supplied repository content as is:
-
Set up RenderMan:
-
Install RenderManProServer and ensure it is functioning properly.
-
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.
-
-
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 usingbash
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}"
-
Download or clone this repository.
-
cd
into the dowloaded or cloned repository's directory. -
At this point, you can use the
make
ormake all
command (they are equivalent) to build the shaders. You can alsocd osl
into the osl directory andmake
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 executemake
from within the osl directory and only the updated source file(s) will be built.make clean
andmake help
can also be executed from either the top-level directory or the osl directory.make clean
removes the built shaders, andmake help
provides additional information about the make system and how it's controlled. -
Set these environment variables appropriately.
-
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 usingbash
shell:export RMAN_SHADERPATH="${HOME}/LaSh/build/${RMAN_VERSION}/shaders:${RMAN_SHADERPATH}"
-
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.
-
This repository's content is licensed under either the
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0) or
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.