Rain effects, better lighting model, optimized code

  • View media
  • View media
  • View media
  • View media
  • View media
  • View media
pbrshot
embed
share
view previous next
Share Image
Share on Facebook Post Email a friend
Embed Image
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account:

Description

Cook-Torrance PBR BRDF for specular.

After bolting the C-T model in, all that's really going on is the specular light dot is being replaced from Phong with C-T. It jumps through more hoops to create, so it has more detail on surfaces.

Another thing that got added ... kd/ks ratios to ensure that diffuse + specular light energy output (reflected) off a surface doesn't out-weigh the light energy hitting the surface in the first place.

After studying up on PBR, the kd/ks ratios are done using fresnel, which determines how much shine vs. color you see based on your viewing angle.

While I did that with C-T, I also added in ks/kd ratios for non-PBR lighting when you have Phong or Blinn-Phong doing specular.

But, we can also turn on fresnel highlights to break the laws of physics and magically enhance the lighting. (This is a video game. We can start with PBR for a more realistic lighting foundation, then add to it with enhancements that make the game look better.)

To make the C-T work, I had to fake spec & roughness maps in many cases. I did this by grayscaling diffuse rgb texture in order to add more variety in shine and surface detail.