Sunday, March 28, 2010

Shader Writing

As promised in my previous post, here are some of my images from my shader writing final project. For those who aren't familiar with computer graphics, when something is modeled in 3d it initially just looks like a flat gray object. Only when the artist assigns the model a shader and then textures it and finally renders it will it look like what you see in the movies. Shaders are what give the object certain visible properties and govern how the renderer's lights affect the object. For example you can make a glass shader that allows light to reflect and refract through an object. Even the most basic properties of a surface must be defined through some kind of code.

How a shader is rendered depend on the renderer. The renderer is what calculates all of the algorithms to display the graphics and there are many different techniques for even more different renderers. There are ray tracers, path tracers and micropolygon renderes among others.

There was a time when everything from the geometry to the shader had to be written out in code. Now a days, however, its pretty simple to use a 3d package like Maya to create geometry and use its built in shaders. For my grad class though we learned how to code shaders in Pixar's Renderman. PRman is a well known renderer, most notably used in Toy Story (and all the subsequent Pixar films). My shaders are just not as good as the built in ones that come with Maya (think Blinn or Lambert). So the surface shader work was an academic exercise that I learned a lot from. However I think some of my displacement shaders are pretty decent and I may use in future work. Displacement shaders don't affect the color of an object, rather they actually displace geometry in a scene. Bricks and peeling paint in my example.

No comments: