Content deleted Content added
No edit summary Tags: Mobile edit Mobile web edit |
No edit summary |
||
(3 intermediate revisions by 3 users not shown) | |||
Line 1:
'''Renderman Shading Language''' (abbreviated RSL) is a component of the [[RenderMan Interface Specification]], and is used to define [[shader]]s. The language syntax is [[C (programming language)|C-like]].
A shader written in RSL can be used without changes on any RenderMan-compliant renderer, such as Pixar's [[PhotoRealistic RenderMan]], DNA Research's [[3Delight]], Sitexgraphics' Air or an open source solution such as
RenderMan Shading Language defines standalone functions and five types of shaders: surface, light, volume, imager and displacement shaders.
An example of a surface shader that defines a metal surface is:
<
surface metal (float Ka = 1; float Ks = 1; float roughness = 0.1;)
{
Line 14:
Ci = Os * Cs * (Ka * ambient() + Ks * specular (Nf, V, roughness));
}
</syntaxhighlight>
Shaders
The arguments to the shaders are global parameters that are attached to objects of the model (so one metal shader can be used for different metals and so on). Shaders have no return values, but functions can be defined which take arguments and return a value. For example, the following function computes vector length using the [[dot product]] operator ".":
<
float length (vector v) {
return sqrt (v . v); /* . is a dot product */
}
</syntaxhighlight>
==Further reading==
Line 31:
* [https://renderman.pixar.com/resources/RenderMan_20/shadingLanguage.html Shading Language (RSL) documentation]
{{DEFAULTSORT:Renderman Shading Language}}▼
▲[[Category:RenderMan]]
[[Category:Shading languages]]▼
▲{{DEFAULTSORT:Renderman Shading Language}}
{{graphics-software-stub}}
[[Category:RenderMan]]
▲[[Category:Shading languages]]
[[zh:RenderMan规范#RenderMan着色语言(RSL)]]
|