Artistic Experiments
  • Home
  • Reel
  • Shaders
    • Stylized Shaders
    • Lighting Techniques
    • Shader Effects
    • Cubemaps
    • Pixel Lit Shaders (Basic)
    • Vertex Lit Shaders (Basic)
    • Unlit Shaders (Basic)
  • Tools
  • WIP
  • Contact

CG Shaders - Strauss

3/15/2014

0 Comments

 
Oren Nayar got me more interested in physically based shaders. In the simplest sense, they are shaders that approach lighting from a Physics rather than mathematical perspective. Oren Nayar does this by adding a roughness attribute that attempts to simulate the effects of microscopic bumps on light reflection. While these bumps would be smaller than a pixel, their effect is quite noticeable in terms of overall light contribution, and so they are worth taking into account.

Strauss is another shading technique that is physically based. I based my implementation on this post. The interesting thing about Strauss is that it only uses 3 attributes to calculate diffuse and specular light: how smooth the surface is , how metallic it is, and how transparent it is. This greatly simplifies the material setup and makes the lighting more consistent than phong, producing a wider range of materials and generally producing more realistic results. 

Consider the following scenario, with Strauss on the left and Phong on the right. As you can see the light is causing the phong to blow out in areas, and is generally more plastic in appearance.
Picture
While we could adjust the Phong to work better, this might cause it to look worse in another lighting situation. For example, a common hack would be to tint the diffuse with a darker color, say 50% grey. This would keep your highlights from blowing out but it would also make your shadows twice as dark. This leads to more hacks and tweaks, which eventually means that all the materials are carefully tweaked to work for certain scenarios, but perform worse in others. Instead, by taking a few more things into account in the shader, we can get more consistent results with less work - always a good thing.

1 thing to note is that i haven't figured out what to do with my spec map yet. It seems rather silly to use for this shader but i haven't got a better solution just yet so it stays as it is for now. It will probably become either a metallic or roughness map in the future once i learn a bit more about physically based rendering, but i'm not sure what makes the most sense yet.

Maya CGFX File:

strauss.cgfx
File Size: 9 kb
File Type: cgfx
Download File

Unity Shader File:

strauss.shader
File Size: 13 kb
File Type: shader
Download File

0 Comments



Leave a Reply.

    CG Shaders

    Shaders I've built as i teach myself CG. Feel free to download and use for whatever. If you like them you can buy me a beer or something.

    Archives

    December 2014
    April 2014
    March 2014
    February 2014
    January 2014
    December 2013
    November 2013

    Categories

    All

    RSS Feed

Powered by Create your own unique website with customizable templates.