Unfortunately, there is no equivalent statement in Cg. This statement indicates that the following code will be executed for all lights in the scene that satisfy the illuminance condition. The single illuminance statement in the RenderMan fur shader code is: // RenderMan illuminance statement illuminance (P, norm_hair, radians(illum_width)) More information on this topic can be found in Upstill 1990. Extra information, beyond the light color and the light direction vector, can be exchanged between the surface and the light through message passing. The illuminance statement lets the surface shader gather samples over all light sources in a scene, at the point being shaded. In RenderMan, light sources are iterated over by the illuminance statement. This section covers light sources and light source shaders. That's because these RenderMan constructs have no equivalent mapping. An analysis of the results, which covers the differences between the original Cg shaders and their optimizations, as well as the differences between the Cg and RenderMan resultsĪs of this writing, lights and the way they are handled are arguably the largest deviation from the RenderMan specification when writing Cg code.A comparison of vertex and fragment programs, with close attention paid to hardware-specific optimizations (which are necessary for good performance).Frequency-independent issues, particularly handling multiple light sources.The RenderMan fur shader from the movie Stuart Little is used throughout this chapter as an example of converting a RenderMan shader to a Cg program (see Berney and Redd 2000 for a description of the fur shader). For example, Listing 33-1, which contains the fur shader for Stuart Little, is in the listing1 subdirectory for Chapter 33. You can find each listing mentioned in this chapter on the book's CD or Web site, in the appropriate subdirectory. The concepts we present are applicable to other shading languages as well. Using Cg does not limit the scope of the chapter, because the Cg compiler can generate many different forms of shader instructions, including OpenGL ARB_fragment program-compliant code. The hardware shading language used is Cg. This chapter demonstrates that it is possible to convert a Pixar RenderMan surface shader into a hardware shader. In particular, the recent advances of graphics hardware technology and the development of hardware shading languages have offered a recognizable mapping between real-time and production effects. Consequently, visual effects houses are considering real-time gaming techniques for optimized visualization. If the rendering time takes hours per frame, it is critical to be able to visualize incremental changes in the least amount of time. Additionally, with the demand for bigger and better effects, the complexity of these shaders increases. Although these shading languages are extremely powerful, the complexity they need in order to produce innovative images often leads to long rendering times. Since the late 1980s, visual effects houses have used shading languages to generate convincing images for the motion picture industry. Sony Pictures Imageworks 33.1 Introduction Converting Production RenderMan Shaders to Real-Time The CD content, including demos and content, is available on the web and for download.Ĭhapter 33. You can purchase a beautifully printed version of this book, and others in the series, at a 30% discount courtesy of InformIT and Addison-Wesley. GPU Gems GPU Gems is now available, right here, online.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |