Showing posts with label shader programming. Show all posts
Showing posts with label shader programming. Show all posts

Saturday, November 23, 2013

Plant Shader

One of my final projects was to create a "shader" in Renderman for a plant.  The idea of a shader is essentially all the colors and patterns of a surface as well as the way the light interacts with it.  In short, it is a tool that the user adjusts that makes 3D objects look like what they represent.  So a rock will have a rock shader, a tree with a tree shader, and so on.  But in reality, these shaders are rarely so specific.  Most shaders are adjustable to look like a variety of things, and you can stack things on top of each other to change the look.  It gets really involved actually.  But to actually write a shader out by hand means you have far more freedom to make something look exactly like what you want, and for a very specific purpose.  As such, we were learning how to make an organic plant shader.  We actually had to go out and buy plants to study the patterns and figure out how to recreate the look with a coded shader.

I admit my shader is not as refined as I would like it to be.  I intend to take it further and add what are called "octaves", which is really just another level or two of detail, to really refine the shader.  I also want to refine the controls, but overall I am pleased with what I was able to come up with.  I would love to learn how to implement things like image based lighting and ambient occlusion into the shader, so I may have to study this on my own.  There is so much more to learn for shader writing, and I really enjoyed it so I wouldn't mind diving into this more.

So for now, here is a final render of my shader.  All aspects of it (including the interaction of light and shadow, the transmission of light, the backside colors, and so much more) are developed by me, and I hope to take it further.

Enjoy!


Monday, November 4, 2013

Patterns and Tartans and Weaves, oh my!

Short post for now...
So back to the shader writing, I have finished a shader (which may still need editing) that has been inspired by weaves, tartans, and patterns.  I used sine waves to make subtle patterns in the background, diagonal lines, and layers and layers of stuff.
This was harder to make than it looks, plus it is editable in Maya so you can change things like the colors and the thickness of the stripes.

Enjoy


Sunday, October 27, 2013

An Intro to Shader Writing

So lately, I've been learning how to do shader writing.  What does that mean?  Well for anyone who uses Maya (or any other 3D software), the shader is the thing that lets you apply a texture or color to your geometry, and interacts with the lights in the scene, such as spec highlights, diffuse, glow, incandescence, etc...  Lambert, Phong, Blinn, and Phong E are all examples of shaders.  What I am just starting to learn is how to write my own shaders.  Eventually, I can even set these up so you can plug in the variables for the Maya users to adjust, to make it user friendly.
Right now, it really just looks like a grid, well a weave at this point, which isn't like any other shader I just mentioned.  It has none of the light-interaction controls yet, and the other shaders don't control patterns like this one does.  However, this is just a learning tool.
It has been really fun to program so far, and there is still more to do on it, but I figured I'd post what I have so far and let people see.  I plan to add more colors, and maybe another pattern to this.  We'll see how it turns out.


In other news, I have been doing some serious Photoshop editing, but I'll go into that on another post.  The long and short of it is, I haven't really learned any new tools in Photoshop since I started, but I did learn some techniques I have never used before (which is what i was hoping to learn).  I kind of wish I could take their advanced Photoshop class to really dive into it.  We'll see.