Skip to content

Latest commit

 

History

History

old-watch-ibl

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Old watch (IBL)

View shader on Shadertoy - Published on 2018-04-30

thumbnail

This shader uses Image Based Lighting (IBL) to render an old watch. The materials of the objects have physically-based properties.

A material is defined by its albedo and roughness value and it can be a metal or a non-metal.

I have used the IBL technique as explained in the article 'Real Shading in Unreal Engine 4' by Brian Karis of Epic Games.[1] According to this article, the lighting of a material is the sum of two components:

  1. Diffuse: a look-up (using the normal vector) in a pre-computed environment map.
  2. Specular: a look-up (based on the reflection vector and the roughness of the material) in a pre-computed environment map, combined with a look-up in a pre-calculated BRDF integration map (Buf B).

Note that I do NOT (pre)compute the environment maps needed in this shader. Instead, I use (the lod levels of) a Shadertoy cubemap that I have remapped using a random function to get something HDR-ish. This is not correct and not how it is described in the article, but I think that for this scene the result is good enough.

I made a shader that renders this same scene using a simple path tracer. You can compare the result here:

https://www.shadertoy.com/view/MlyyzW

[1] http://blog.selfshadow.com/publications/s2013-shading-course/karis/s2013_pbs_epic_notes_v2.pdf

Shaders

Common

Source: Common.glsl

Buffer A

Source: Buffer A.glsl

Inputs

  • iChannel0: Buffer A (linear, clamp, vflipped)
  • iChannel1: texture (mipmap, repeat, vflipped)
  • iChannel2: texture (mipmap, repeat, vflipped)

Buffer B

Source: Buffer B.glsl

Inputs

  • iChannel0: Buffer B (linear, clamp, vflipped)

Image

Source: Image.glsl

Inputs

  • iChannel0: cubemap (mipmap, repeat, vflipped)
  • iChannel1: texture (mipmap, repeat, vflipped)
  • iChannel2: Buffer A (linear, clamp, vflipped)
  • iChannel3: Buffer B (linear, clamp, vflipped)

Links

License

Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.