-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merian-nodes: ggx start implementation
- Loading branch information
Showing
2 changed files
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#ifndef _MERIAN_SHADERS_BSDF_GGX_H_ | ||
#define _MERIAN_SHADERS_BSDF_GGX_H_ | ||
|
||
#include "merian-shaders/common.glsl" | ||
|
||
// Smiths shadow masking term | ||
float smith_g1(const float roughness, const float wodotn) { | ||
const float alpha_sq = pow(roughness, 4); | ||
return 2.0 * wodotn / (wodotn + sqrt(alpha_sq + (1.0 - alpha_sq) * MERIAN_SQUARE(wodotn))); | ||
} | ||
|
||
#endif // _MERIAN_SHADERS_BSDF_GGX_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#ifndef _MERIAN_SHADERS_FRESNEL_H_ | ||
#define _MERIAN_SHADERS_FRESNEL_H_ | ||
|
||
#define fresnel_schlick(minuswi_dot_h, F0) ((F0) + (1. - (F0)) * pow(max(1. - (minuswi_dot_h), 0), 5.)) | ||
|
||
#endif // _MERIAN_SHADERS_FRESNEL_H_ |