MCPcopy Create free account
hub / github.com/3DAnimals/3DAnimals / bsdf_lambda_ggx

Function bsdf_lambda_ggx

model/render/renderutils/bsdf.py:105–110  ·  view source on GitHub ↗
(alphaSqr, cosTheta)

Source from the content-addressed store, hash-verified

103 return alphaSqr / (d * d * math.pi)
104
105def bsdf_lambda_ggx(alphaSqr, cosTheta):
106 _cosTheta = torch.clamp(cosTheta, min=specular_epsilon, max=1.0 - specular_epsilon)
107 cosThetaSqr = _cosTheta * _cosTheta
108 tanThetaSqr = (1.0 - cosThetaSqr) / cosThetaSqr
109 res = 0.5 * (torch.sqrt(1 + alphaSqr * tanThetaSqr) - 1.0)
110 return res
111
112def bsdf_masking_smith_ggx_correlated(alphaSqr, cosThetaI, cosThetaO):
113 lambdaI = bsdf_lambda_ggx(alphaSqr, cosThetaI)

Callers 2

_lambda_ggxFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected