This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
specular_lys [2017/05/15 16:52] adavies [Image Based Lighting Sample Shader] |
specular_lys [2017/05/15 21:53] adavies old revision restored (2017/05/15 21:52) |
||
---|---|---|---|
Line 49: | Line 49: | ||
==== Image Based Lighting Sample Shader ==== | ==== Image Based Lighting Sample Shader ==== | ||
- | In the following we describe how to use cube maps generated with Lys in a shader for image based lighting. We also provide a free, full IBL sample shader, the 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. | + | In the following we describe how to use cube maps generated with Lys in a shader for image based lighting. We also provide a free, complete IBL sample shader & associated source files. |
Please see the [[ibl_sample_shader_lys|Image Based Lighting Sample Shader]] page for more details. | Please see the [[ibl_sample_shader_lys|Image Based Lighting Sample Shader]] page for more details. | ||
Line 132: | Line 132: | ||
Note that our implementation of BurleyToMip() below differs from the more typical form as cube maps convolved in Lys are based on RdotL and not NdotH. You can find a more detailed description in [[specular_lys#pre-convolved_cube_maps_vs_path_tracers|Pre-convolved Cube Maps vs Path Tracers]]. | Note that our implementation of BurleyToMip() below differs from the more typical form as cube maps convolved in Lys are based on RdotL and not NdotH. You can find a more detailed description in [[specular_lys#pre-convolved_cube_maps_vs_path_tracers|Pre-convolved Cube Maps vs Path Tracers]]. | ||
+ | |||
+ | Despite the difference in distribution of MIPs the lit specular response resulting from the generated “roughness texture” will be identical to other PBR based game engines and tools. | ||
<code glsl>float BurleyToMip(float fPerceptualRoughness, int nMips, float NdotR) | <code glsl>float BurleyToMip(float fPerceptualRoughness, int nMips, float NdotR) | ||
Line 257: | Line 259: | ||
- | \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ | + | \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ |
As an approximation we can correlate size of solid angle with "blur strength"and replace ''h_dot_r'' with ''n_dot_r''. So ultimately what we do is adjust our specular power in the following way: | As an approximation we can correlate size of solid angle with "blur strength"and replace ''h_dot_r'' with ''n_dot_r''. So ultimately what we do is adjust our specular power in the following way: |