Wednesday, December 11, 2013

First Foray Into Physically-Based Shaders

Yesterday I made my first foray into physically-based shading (with some minor fixes and tweaks applied today).
For those of you who don't know, physically based shading is based on the principle that a surface can never reflect more light energy than it receives. It's actually much simpler than it sounds.
For diffuse, you can get away with just using regular Lambert (some games use Oren-Nayer, but I don't think that's at all necessary). For specular, things get much more complicated, and I won't get into details in this post.

One thing physically-based shaders are REALLY good at is having a wide range of materials - with a few parameters, you can fairly easily reproduce a lot of hard surfaces.
Anyway, here's a screenshot of my hard surface shader in action. On the left, three plastic spheres, in the middle, three polished metal spheres, and on the right three unpolished metal spheres. All nine spheres use the same shader (as does the ground underneath them).
I'll post more on the technique in a later post.

No comments:

Post a Comment