The documenation for this repository is the Siggraph 2024 course itself: Shader Writing in Open Shading Language.
However, here is some additional information about this repositry's content and how to make use of it.
Other rendering and application systems can still make use of the osl
shading nodes with little or no changes.
While a Linux system was used to develop this repository's content, as long as a make
command and python
are available, any necessary modifications to the Makefiles and python installation script should be minor or non-existent.
To use the supplied repository content as is:
-
Get a professional (paid) or non-commercial (free) license for RenderMan.
-
Install RenderMan and ensure it is functioning properly.
-
Set these environment variables appropriately. These are required by the make system that's used to build and install the shaders:
- PIXAR_ROOT
- RMAN_VERSION
For example, if your version of the RenderMan renderer is installed in
/opt/pixar/RenderManProServer-26.1
, then usingbash
shell:export PIXAR_ROOT="/opt/pixar" export RMAN_VERSION="26.1"
And since RenderMan requires an RMANTREE environment variable to be set to the renderer's installation location, you can conveniently use these to define that as well:
export RMANTREE="${PIXAR_ROOT}/RenderManProServer-${RMAN_VERSION}"
-
Download or clone this repository.
-
Set this environment variable appropriately. This is required so the built shaders can be found by RenderMan:
- RMAN_SHADERPATH
For example, if you downloaded or cloned this repository to
${HOME}/OSLShaderWriting
, then usingbash
shell:export RMAN_SHADERPATH="${HOME}/OSLShaderWriting/build/${RMAN_VERSION}/shaders:${RMAN_SHADERPATH}"
-
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 oslMakefile
will only make shaders for .osl files that are more recent than their complied .oso file. 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.
To modify the existing shaders or to develop your own, cd
into the osl
directory. This is where you will run make
in order to build any modified or new shaders during their development.
To create a new category of shader, create a directory with the category's name in the osl
directory and add it to the osl/Makefile
's SUBDIRS
variable on line 34.
Any .osl
files in this new directory will then also be built when make
is executed from the osl
directory location.
To build the entire set of shaders, run make clean ; make -j
from the cloned repository's directory rather than the osl
directory.
If you cloned this repository, you'll have created a local git repository, so all the source code management tools of git will be available to you. If you are not already famililar with git, it will be very worthwile to at least learn the basics of adding new files and committing changes for existing ones.
At this point you're all set to start writing or modifying your very own OSL shaders!