Upload
prabindh-sundareson
View
661
Download
1
Embed Size (px)
Citation preview
Introduction to Open Shading Language
Prabindh Sundareson
Introduction
●OSL was developed at Sony Imageworks, for use in its rendering pipelines for movies.
●It is a shader description language, built out of LLVM infrastructure.
Why OSL
● To be able to replicate the behaviour of pre-recorded BRDF using instruments like the Gonioreflectometer.
● Once recorded, these BRDFs can be replicated almost accurately in the rendered scene
● More flexible representation of properties of surfaces
The OSL shader
● In OSL, shaders do not calculate color output per pixel, but define a function that returns a surface, displacement, volume or define a new generic shader
● Reflectance and Transmittance of surfaces are modelled as functions, or "Closures"
● These shaders are evaluated during the rendering phase
Open Shading Language
● OSL's surface and volume shaders compute an explicit symbolic description, called a "closure", of the way a surface or volume scatters light, in units of radiance
● These radiance closures may be evaluated in particular directions, sampled to find important directions, or saved for later evaluation and re-evaluation (by component blocks called as "Integrators")
– From "Larry Gritz, OSL_Introduction"
Example Surface Shader
● A sample surface shader looks like below:
surface
test (string noisename = "gabor", float freq = 5, output color Cout = 0)
{
point p = P*freq * (1.0+10*v*v) * (1.0+10*u*u);
float n = noise(noisename, p[0], p[1]);
cout = n * 0.5 + 0.5;
}
Sample Scenes built out of OSL
● Some examples are to be found in chocofur.com (http://store.chocofur.com/exterior-scene-01), that look amazingly realistic
Source Code and More Details
● The source code for OSL is provided under a liberal New BSD license, at,
● https://github.com/imageworks/OpenShadingLanguage