You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: include/irr/builtin/glsl/bxdf/bsdf/specular/ggx.glsl
+23-9Lines changed: 23 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -77,29 +77,42 @@ vec3 irr_glsl_ggx_height_correlated_cos_eval(in irr_glsl_LightSample _sample, in
77
77
78
78
79
79
80
-
// TODO: unifty the two following functions into `irr_glsl_microfacet_BRDF_cos_generate_wo_clamps(vec3 H,...)` and `irr_glsl_microfacet_BRDF_cos_generate` or at least a auto declaration macro in lieu of a template
81
-
irr_glsl_LightSample irr_glsl_ggx_cos_generate_wo_clamps(invec3 localV, inmat3 m, invec2 u, infloat _ax, infloat _ay, out irr_glsl_AnisotropicMicrofacetCache _cache)
80
+
// TODO: unifty the two following functions into `irr_glsl_microfacet_BSDF_cos_generate_wo_clamps(vec3 H,...)` and `irr_glsl_microfacet_BSDF_cos_generate` or at least a auto declaration macro in lieu of a template
81
+
irr_glsl_LightSample irr_glsl_ggx_dielectric_cos_generate_wo_clamps(invec3 localV, inbool backside, invec3 upperHemisphereLocalV, inmat3 m, invec3 u, infloat _ax, infloat _ay, infloat rcpOrientedEta, infloat orientedEta2, infloat rcpOrientedEta2, out irr_glsl_AnisotropicMicrofacetCache _cache)
82
82
{
83
-
constvec3 H = irr_glsl_ggx_cos_generate(localV,u,_ax,_ay);
83
+
// thanks to this manouvre the H will always be in the upper hemisphere (NdotH>0.0)
84
+
constvec3 H = irr_glsl_ggx_cos_generate(upperHemisphereLocalV,u.xy,_ax,_ay);
irr_glsl_LightSample irr_glsl_ggx_cos_generate(in irr_glsl_AnisotropicViewSurfaceInteraction interaction, invec2 u, infloat_ax, infloat_ay, out irr_glsl_AnisotropicMicrofacetCache _cache)
98
+
irr_glsl_LightSample irr_glsl_ggx_dielectric_cos_generate(in irr_glsl_AnisotropicViewSurfaceInteraction interaction, invec3 u, infloatax, infloatay, infloat eta, out irr_glsl_AnisotropicMicrofacetCache _cache)
0 commit comments