Something went wrong. Try again later

Akrid

This user has not updated recently.

1397 0 65 90
Forum Posts Wiki Points Following Followers

Guitar Modeling - Part 3

This week was a bit of a break for me. I'm in the rendering stage of my guitar project which mainly consists of tweaking for 15 minutes and then waiting an hour or two for it to render out, ad nauseam. It's times like these when I wish I had a little more power under the hood, It's only been a few months since I upgraded to a quad-core but it's already starting to lose it's novelty.


 Just noticed I forgot the fret dots... How in the hell did I miss that?
 Just noticed I forgot the fret dots... How in the hell did I miss that?
I changed the guitar to the "Cognac Burst" style. I own a "Natural", as I found the burst to be rather ostentatious, but I'm none to confident in my ability to pull off the delicate simplicity of my own guitar effectively. Above is my horrendously over-lit render, it's main intention being to bring out the colors as vibrantly as possible.


  Would probably look better with some context as well..
  Would probably look better with some context as well..
In pursuit of a more natural looking lighting scheme, I threw the model into an old medium-sized scene. It certainly produces a fairly natural and realistic result, but that's also the problem. Sometimes, things just aren't pretty in the real world. This is something that I run into all the time when I'm going for photo-realism; I take a look at the finished product and think to myself: Boring. Can't help but try and make it larger than life.

No Caption Provided

I think the main thing letting these renders down are the the textures. Despite my best efforts, these were the best I could find, and for those I couldn't find I had to generate procedurally (Neck, fingerboard, pickguard). In fact, I think the body and the branding textures are the only image based textures I used.

In any case, the prettiest renders are yet to come. In the mean time,

Shaders

The world around us is entirely defined by light. The science behind light is fairly straightforward: Rays are cast from a light source onto a surface. The ray of light changes direction upon striking it, it's course altered according to the attributes of said surface. A shader is simply the container for those attributes. For practicalities sake, these attributes can then be broken down into two groups: Reflective and refractive.

Reflective Properties


 Brought to you by: Some science-y site.
 Brought to you by: Some science-y site.
The law of reflection states that the outgoing angle of a ray is always equal to the incoming angle. This makes perfect sense in the context of a mirror; if you take a laser pointer and aim it at a mirror, the angle will always be perfectly predictable in that it is always the opposite and equal angle. However, all non-transparent surfaces are defined by reflection, not just mirrors. If this law of reflection is true, how does light interact with surfaces that are not perfectly reflective like a mirror?

All reflection based shading is based on the concept of roughness. The reason that a mirror is perfectly reflective is because it's a completely smooth surface. Take a look at an object near to you that is generally not considered "reflective", and feel it. It has, without a doubt, some degree of roughness to it. This provides an inexorable subconscious link in your mind that relates smooth surfaces as reflective and rough surfaces as not. However, this is not true. All non-transparent surfaces are defined by reflection.


No Caption Provided
If you compare a rough surface and a smooth surface at a microscopic level, there is a stark contrast in their profile. Now, if you think of the rays hitting those surfaces, what will happen? The rough surface bounces the light in all sorts of directions, as well as having a good chance of inter-reflecting with itself. This is called a diffuse reflection. Meanwhile on the smooth surface, the light hits the surface and exits at the equal opposite angle in a fairly uniform manner. This is called a specular reflection.

All this is from a purely scientific perspective. Which I explained because I think understanding how light works has helped me better understand how to construct shaders. Let's look at the application of this in regards to CG.

One of the few things that is truly universal among CG programs is that reflectance is always defined by three parameters: Diffuse, specular, and reflection. 

 80%, 40%, 0% diffuse respectively. Diffuse amount ends up being just a brightness modifier for the color. 0% here shows the complete absence of reflections.
 80%, 40%, 0% diffuse respectively. Diffuse amount ends up being just a brightness modifier for the color. 0% here shows the complete absence of reflections.
Diffuse can be largely considered the actual color of the object; if I wanted to apply a wood texture to something, I would put the texture in the diffuse input. An example of a purely diffuse surface would be drywall, or pretty much anything that's soft.


 40/40, 30/40, 40/90 (Specular amount/roughness)
 40/40, 30/40, 40/90 (Specular amount/roughness)

Specular(ity) is essentially the "Highlight" of the object. Look around and you will see that almost all objects have a particular shine where the light hits hardest, but this couldn't be considered a reflection in the traditional sense of the word. I think the cause of this has something to do with the way a surface absorbs and releases light energy, though that's purely an observation. Also note that on a smoother object the highlight becomes more pronounced and "Sharp", while on rough surfaces the energy is dispersed over a larger area and as a result is not as strong. This effect is controlled by an independent parameter called either roughness or glossiness depending on who you ask.

No Caption Provided
Reflection does exactly what it says on the tin: reflect light rays. Another important part of mirror-like reflections is a phenomenon referred to as fresnel. Simply put, this modulates the reflectivity of an object depending on the viewing angle. The best example of this would be a still lake. When looking out across the lake, the water provides an almost perfect reflection, but when you look down at your feet you can see fairly clearly through the water. Another example of fresnel would be a slab of marble. Reflection has it's own roughness as well, changing it causes blurrier reflections.

Some very basic shaders. Bottom middle is an example of reflections with roughness.
Some very basic shaders. Bottom middle is an example of reflections with roughness.
The combination of these three base parameters and their interaction with each other allow for nearly infinite shading variations. Combined with texturing and other techniques, you can make just about anything. This method of reflection shading is referred to as BRDF, or bidirectional reflectance distribution function, A name that always reminds me that something must be going on that's more complicated then these three parameters. 

 Modo 501's (The program I use) shader editor. Any parameters that went unmentioned are probably not important... Probably.
 Modo 501's (The program I use) shader editor. Any parameters that went unmentioned are probably not important... Probably.

The significant deviation from true science in this method is that a choice was made to separate specular reflections and just *plain* reflections into two separate parameters, when in reality they are supposed to be one and the same. This leads to some artists insisting that specularity is not a real-world phenomenon and attempt to boycott it, trying to substitute it with reflections with roughness applied.

And of course, the other fallacy is that a rendering engine is never really sending out millions of light rays and bouncing them off a microscopic surface to determine how it diffuses. It's always a predetermined outcome, the entire shading system is based upon fakery of known quantities.

If you're reading this, thanks for reading this! I hope it wasn't boring. I'll go into refraction at some other point in time, this blog is long enough as it is.

Any sort of feedback would be appreciated, though there is admittedly very little to comment on...
11 Comments