The shader is called and the output values are assigned to the correct required output values of the surface shader (Ci and Oi). sl file, created by Slim, shows that the RSLFunction block from Slim is just carried over as a function inside the shader. $bakePassClassProp SetValue "\"Ī close look at this. $bakedFileProp SetValue "\[bakemap -atlas $atl -chan $ch -map $map In the case of the material, it stores the sample directions and the material response at that direction (the evaluation of the BRDF and the PDF, but not the lighting). In the case of the light, generateSamples() stores the sample directions and the light radiance. The generateSamples() method is defined in both the material and light, and is used to store the response of that portion of the final result. With both lights and shaders, two new functions must be defined in RPS 16 to work with the MIS system. I have already covered how in some cases it is better for the material to generate the sample directions, and in other cases it is better for the light to provide sample directions to the material. These shaders are constructed like any other, but utilize new lighting integrators and new required functions for multiple importance sampling.įirst, an overview of the shading process with respect to multiple importance sampling. RenderMan Pro Server 16's physically-plausible shading makes use of both structs and class-based shaders. The ShadingContext struct is intialized in the begin() method of a class-based shader, and can be used throughout the shading pipeline for easy access to ray depth, the faceforward normal, tangents, etc. One good example is Pixar's ShadingContext struct, which stores a myriad of data about the current shading point and provides many utility functions for dealing with that data. In my case, I used several Pixar structs and a custom struct for my final shader. Structs can be used to store functions and data for reuse across the shading pipeline, and mainly serve to organize code and facilitate reuse. This framework, along with user-created functions, is essential to creating a MIS-aware material in RPS 16. Additionally, values from these internal methods are cached, offering further speed advantages.Ī more advanced version of shader objects utilizes multiple functions to break up the lighting process, as well as an initialization function to precompute values and speed up the shading process. This way we can accomplish the same behavior without ugly changes to the surface shader code. In RSL 2.0, the opacity method executes before the surface method, and will not run the surface shader if the opacity is below the threshold. Malcolm mentioned this as a scenario with shading of tree leaves, and I suspected then that the speed could be improved by solving opacity first, and then wrapping the rest of the surface shader in a conditional based on the opacity being greater than some threshold. In RSL 1.0 shaders, the shader may execute all the way to the end, only to end up with an opacity of 0. This allows for the sharing of data between these methods and more efficient execution by breaking the shading process into separate methods. Both provide benefits to the shading pipeline speed.įirst, the new shader objects (or class-based shaders) can contain separate methods for displacement, surface, and opacity in the simplest implementation. RSL 2.0 introduced two new concepts - shader objects and C-style structs. Prior to this project, I had never attempted anything involving combined shading or shader objects. With RPS 17 and beyond, most of these features are standard, and I haven't continued development as I no longer have a RenderMan license at home. The original page is still available here. The following is a transcription of one of my independent projects while I was a student at SCAD.
0 Comments
Leave a Reply. |