RenderMan Shading Language: Difference between revisions

Content deleted Content added
Addbot (talk | contribs)
m Bot: Migrating 1 interwiki links, now provided by Wikidata on d:q5368813
No edit summary
 
(11 intermediate revisions by 11 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 [[Pixie (renderer)|Pixie]] or [[Aqsis]].
 
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:
<sourcesyntaxhighlight lang="c">
surface metal (float Ka = 1; float Ks = 1; float roughness = 0.1;)
{
normal Nf = faceforward (normalize(N), I);
vector V = - normalize (I);
Oi = Os;
Ci = Os * Cs * (Ka * ambient() + Ks * specular (Nf, V, roughness));
}
</syntaxhighlight>
</source>
Shaders doexpress thetheir work by reading and writing special variables such as Cs (surface color), N (normal at given point), and Ci (final surface color).
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 ".":
<sourcesyntaxhighlight lang="c">
float length (vector v) {
return sqrt (v . v); /* . is a dot product */
}
</syntaxhighlight>
</source>
 
==Further reading==
* [[Steve{{cite book | last=Upstill]]: ''| first=Steve | title=The RenderMan Companioncompanion : Aa Programmerprogrammer's Guideguide to Realisticrealistic Computercomputer Graphics'',graphics [[| publisher=Addison-Wesle]]yWesley | ___location=Reading, ISBNMass | year=1990 | isbn=0-201-50868-0 | url=https://archive.org/details/rendermancompani00upst }}
* [[Anthony{{cite book | last=Apodaca | first=Anthony A.| authorlink=Anthony Apodaca]], [[Larry| last2=Gritz]]: ''| first2=Larry | title=Advanced RenderMan : Creatingcreating CGI for Motionmotion Pictures'',pictures | publisher=Morgan Kaufmann Publishers,| ISBN___location=San Francisco | year=1999 | isbn=1-55860-618-1 | url=https://archive.org/details/advancedrenderma00apod_0 }}
* {{cite book | last=Cortes | first=Rudy | last2=Raghavachary |first2=Saty | title=The RenderMan shading language guide | publisher=Thomson Course Technology | ___location=Boston, Mass | year=2008 | isbn=1-59863-286-8 }}
* [[Ian Stephenson:]] ''Essential RenderMan Fast'', Springer, ISBN 1-85233-608-0
* [[Saty Raghavachary]]: ''Rendering for Beginners: Image synthesis using RenderMan'', [[Focal Press]], ISBN 0-240-51935-3
* [[Rudy Cortes and Saty Raghavachary]]: ''The RenderMan Shading Language Guide'', Course Technology PTR, 1 edition (December 27, 2007), ISBN 1-59863-286-8
 
==External links==
===RenderMan knowledge===
* [https://renderman.pixar.com/resources/RenderMan_20/shadingLanguage.html Shading Language (RSL) documentation]
* [http://www.fundza.com/ CG References & Tutorials] by Prof. Malcolm Kesson
* [http://accad.osu.edu/~smay/RManNotes/rmannotes.html RenderMan Notes] (notes on shader writing)
* [http://www.vga.hr/resources/tutorials/3d/rsl/index.htm RenderMan Shader Language] by Dominik Susmel
 
[[Category:{{RenderMan]]}}
{{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)]]