User Tools

Site Tools


ibl_sample_shader_lys

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
ibl_sample_shader_lys [2017/05/07 20:34]
adavies
ibl_sample_shader_lys [2017/05/23 03:49] (current)
Line 1: Line 1:
 ====== Image Based Lighting Sample Shader ====== ====== Image Based Lighting Sample Shader ======
  
-Throughout the following page we are providing a free IBL sample shaderthe associated source files for the shader and a general user guide in that you may test the various aspects of IBL with a minimal setup and iteration time+Throughout the following page we are providing a free IBL sample shader ​and the associated source files.
  
-The shader specifically covers cube maps that have been generated within Lys, though ​may still be very useful ​general ​reference in other cases.+The shader specifically covers cube maps that have been generated within Lys using the Burley option for image based lighting but may also serve as a useful reference in general.
  
  
Line 14: Line 14:
  
  
-  - Download the shader and asset files from HERE.+  - Download the shader and asset files from [[https://​s3-us-west-2.amazonaws.com/​knalduswest/​docs/​freeLysIblSample.zip|HERE]].
   - Download FX Composer from [[http://​developer.download.nvidia.com/​tools/​FX_Composer/​2.5/​FX_Composer2_2.51.0701.1135.exe|HERE]] & install.   - Download FX Composer from [[http://​developer.download.nvidia.com/​tools/​FX_Composer/​2.5/​FX_Composer2_2.51.0701.1135.exe|HERE]] & install.
   - Extract the .zip file to a location of your choosing.   - Extract the .zip file to a location of your choosing.
Line 23: Line 23:
   - Enjoy!   - Enjoy!
  
-Below is the full shader. You can download the sample shader and assets HERE+Below is the full shader. You can download the sample shader and assets ​[[https://​s3-us-west-2.amazonaws.com/​knalduswest/​docs/​freeLysIblSample.zip|HERE]]
  
 <code glsl> <code glsl>
 /* /*
  
-% Free IBL sample using cube map exported from Knaldtech'​s tool Lys+% Copyright 2017 Knald Technologies,​ LLC 
 +% See LICENSE.txt for licensing and redistribution terms. 
 +% Free IBL sample using cube map exported from Knaldtech'​s tool Lys. https://​www.knaldtech.com/​lys/​
 % The cube map was made with offset set to 3 and exported as GGX with Burley roughness drop. % The cube map was made with offset set to 3 and exported as GGX with Burley roughness drop.
 */ */
Line 122: Line 124:
 // form as cube maps convolved in Lys are based on RdotL and not NdotH. You can find // form as cube maps convolved in Lys are based on RdotL and not NdotH. You can find
 // a more detailed description in "​Pre-convolved Cube Maps vs Path Tracers"​ // a more detailed description in "​Pre-convolved Cube Maps vs Path Tracers"​
 +// Despite the difference in distribution of MIPs the lit specular response resulting from
 +// the “roughness texture” will be identical to existing PBR based game engines and tools.
 float BurleyToMip(float fPerceptualRoughness,​ int nMips, float NdotR) float BurleyToMip(float fPerceptualRoughness,​ int nMips, float NdotR)
 { {
Line 189: Line 193:
     ​     ​
     // material properties from texture     // material properties from texture
-    float smoothness = smoothness_tex.Sample(samLinear,​ st).x; ​ // not gamma corrected+    float smoothness = smoothness_tex.Sample(samLinear,​ st).x; ​ // inverted roughness texture map (1-x) and no gamma correction
     float perceptualRoughness = 1.0 - smoothness;     float perceptualRoughness = 1.0 - smoothness;
 +    //float perceptualRoughness = roughness_tex.Sample(samLinear,​ st).x; // For those using roughness texture maps use this line instead to initialize perceptualRoughness.
     float metalness = metalness_tex.Sample(samLinear,​ st).x; ​   // not gamma corrected     float metalness = metalness_tex.Sample(samLinear,​ st).x; ​   // not gamma corrected
     float3 texNormal = 2*normal_tex.Sample(samLinear,​ st).xyz - 1.0;    // not gamma corrected     float3 texNormal = 2*normal_tex.Sample(samLinear,​ st).xyz - 1.0;    // not gamma corrected
ibl_sample_shader_lys.1494189246.txt.gz · Last modified: 2017/05/23 03:49 (external edit)