21 float tmp = (1.0f - wm.
z) + alpha * wm.
z;
22 return alpha /
max(
M_PI_F * tmp * tmp, 1e-7f);
28 float slope_x = -wm.
x / alpha.
x;
29 float slope_y = -wm.
y / alpha.
y;
30 float tmp = wm.
z * wm.
z + slope_x * slope_x + slope_y * slope_y;
32 return 1.0f /
max(
M_PI_F * tmp * tmp * alpha.
x * alpha.
y, 1e-7f);
40 if (cosI > 0.9999f ||
fabsf(cosI) < 1e-6f) {
41 const float r =
sqrtf(randx /
max(1.0f - randx, 1e-7f));
42 const float phi =
M_2PI_F * randy;
46 const float sinI =
safe_sqrtf(1.0f - cosI * cosI);
47 const float tanI = sinI / cosI;
48 const float projA = 0.5f * (cosI + 1.0f);
51 const float A = 2.0f * randx * projA / cosI - 1.0f;
52 float tmp =
A *
A - 1.0f;
53 if (
fabsf(tmp) < 1e-7f)
56 const float D =
safe_sqrtf(tanI * tanI * tmp * tmp - (
A *
A - tanI * tanI) * tmp);
58 const float slopeX2 = tanI * tmp +
D;
59 const float slopeX = (
A < 0.0f || slopeX2 > 1.0f / tanI) ? (tanI * tmp -
D) : slopeX2;
63 U2 = 2.0f * (randy - 0.5f);
65 U2 = 2.0f * (0.5f - randy);
66 const float z = (U2 * (U2 * (U2 * 0.27385f - 0.73369f) + 0.46341f)) /
67 (U2 * (U2 * (U2 * 0.093073f + 0.309420f) - 1.0f) + 0.597999f);
68 const float slopeY =
z *
sqrtf(1.0f + slopeX * slopeX);
87 const float slope_x = alpha.
x * (cossin_phi.
x * slope_11.
x - cossin_phi.
y * slope_11.
y);
88 const float slope_y = alpha.
y * (cossin_phi.
y * slope_11.
x + cossin_phi.
x * slope_11.
y);
101 return -wi + 2.0f * wm *
dot(wi, wm);
116 float pArea = (
w.z < -0.9999f) ? 1.0f : lambda *
w.z;
118 const float dotW_WH =
dot(-
w, wh);
122 float phase =
max(0.0f, dotW_WH) * 0.25f /
max(pArea * dotW_WH, 1e-7f);
123 if (alpha.
x == alpha.
y)
124 phase *=
D_ggx(wh, alpha.
x);
139 float cosI =
dot(wi, wm);
143 return -wi + 2.0f * wm * cosI;
146 float inv_eta = 1.0f / eta;
147 float cosT = -
safe_sqrtf(1.0f - (1.0f - cosI * cosI) * inv_eta * inv_eta);
148 return normalize(wm * (cosI * inv_eta + cosT) - wi * inv_eta);
154 const bool wo_outside,
161 float pArea = (
w.z < -0.9999f) ? 1.0f : lambda *
w.z;
168 const float dotW_WH =
dot(-
w, wh);
176 const float dotW_WH =
dot(-
w, wh), dotWO_WH =
dot(wo, wh);
180 float temp = dotW_WH + eta * dotWO_WH;
182 D_ggx(wh, alpha.
x) / (pArea * temp * temp);
195 else if (
w.z < -0.9999f)
198 const float inv_wz2 = 1.0f /
max(
w.z *
w.z, 1e-7f);
200 float v =
sqrtf(1.0f +
dot(wa, wa) * inv_wz2);
204 return 0.5f * (
v - 1.0f);
225 return powf(C1, lambda);
239 if (
w.z < -0.9999f) {
242 *G1 =
mf_G1(
w, *C1, *lambda);
244 else if (
fabsf(
w.z) >= 0.0001f) {
247 if (*lambda >= 0.0f) {
251 *C1 *=
powf(1.0f -
U, -1.0f / *lambda);
254 *G1 =
mf_G1(
w, *C1, *lambda);
267 float albedo = 0.806495f *
expf(-1.98712f *
r *
r) + 0.199531f;
268 albedo -= ((((((1.76741f *
r - 8.43891f) *
r + 15.784f) *
r - 14.398f) *
r + 6.45221f) *
r -
284 float I_1 = 0.0476898f *
expf(-0.978352f * (
ior - 0.65657f) * (
ior - 0.65657f)) -
285 0.033756f *
ior + 0.993261f;
286 float R_1 = (((0.116991f *
a - 0.270369f) *
a + 0.0501366f) *
a - 0.00411511f) *
a + 1.00008f;
287 float I_2 = (((-2.08704f *
ior + 26.3298f) *
ior - 127.906f) *
ior + 292.958f) *
ior - 287.946f +
289 float R_2 = ((((5.3725f *
a - 24.9307f) *
a + 22.7437f) *
a - 3.40751f) *
a + 0.0986325f) *
a +
292 return saturatef(1.0f + I_2 * R_2 * 0.0019127f - (1.0f - I_1) * (1.0f - R_1) * 9.3205f);
299 float singlescatter = 0.25f *
D /
max((1.0f + lambda) * wi.
z, 1e-7f);
304 return albedo * singlescatter + (1.0f - albedo) * multiscatter;
311 float singlescatter = 0.25f *
D /
max((1.0f + lambda) * wi.
z, 1e-7f);
316 return albedo * singlescatter + (1.0f - albedo) * multiscatter;
324 bool reflective = (wi.
z * wo.
z > 0.0f);
330 float3 r_wi = (wi.
z < 0.0f) ? -wi : wi;
332 float D =
D_ggx(wh, alpha);
337 float singlescatter = 0.25f *
D /
max((1.0f + lambda) * r_wi.
z, 1e-7f);
339 return fresnel * (albedo * singlescatter + (1.0f - albedo) * multiscatter);
342 float singlescatter =
fabsf(
dot(r_wi, wh) *
dot(wo, wh) *
D * eta * eta /
343 max((1.0f + lambda) * r_wi.
z * wh_len * wh_len, 1e-7f));
345 return (1.0f - fresnel) * (albedo * singlescatter + (1.0f - albedo) * multiscatter);
352 #define MF_NAME_JOIN(x, y) x##_##y
353 #define MF_NAME_EVAL(x, y) MF_NAME_JOIN(x, y)
354 #define MF_FUNCTION_FULL_NAME(prefix) MF_NAME_EVAL(prefix, MF_PHASE_FUNCTION)
356 #define MF_PHASE_FUNCTION glass
357 #define MF_MULTI_GLASS
360 #define MF_PHASE_FUNCTION glossy
361 #define MF_MULTI_GLOSSY
378 bsdf->alpha_x =
clamp(bsdf->alpha_x, 1e-4f, 1.0f);
379 bsdf->alpha_y =
clamp(bsdf->alpha_y, 1e-4f, 1.0f);
380 bsdf->extra->color =
saturate(bsdf->extra->color);
381 bsdf->extra->cspec0 =
saturate(bsdf->extra->cspec0);
411 bsdf->alpha_y = bsdf->alpha_x;
436 if (bsdf->alpha_x * bsdf->alpha_y < 1e-7f) {
445 if (
dot(
Z,
I) <= 0.0f ||
dot(
Z, omega_in) <= 0.0f) {
452 bool is_aniso = (bsdf->alpha_x != bsdf->alpha_y);
464 *pdf =
mf_ggx_pdf(localI, localO, bsdf->alpha_x);
465 return mf_eval_glossy(localI,
474 bsdf->extra->cspec0);
498 if (
dot(
Z,
I) <= 0.0f) {
505 if (bsdf->alpha_x * bsdf->alpha_y < 1e-7f) {
506 *omega_in = 2 *
dot(
Z,
I) *
Z -
I;
507 if (
dot(Ng, *omega_in) <= 0.0f) {
513 #ifdef __RAY_DIFFERENTIALS__
514 *domega_in_dx = (2 *
dot(
Z, dIdx)) *
Z - dIdx;
515 *domega_in_dy = (2 *
dot(
Z, dIdy)) *
Z - dIdy;
522 bool is_aniso = (bsdf->alpha_x != bsdf->alpha_y);
531 *eval = mf_sample_glossy(localI,
539 bsdf->extra->cspec0);
540 *omega_in =
X * localO.
x +
Y * localO.
y +
Z * localO.
z;
543 if (
dot(Ng, *omega_in) <= 0.0f) {
551 *pdf =
mf_ggx_pdf(localI, localO, bsdf->alpha_x);
554 #ifdef __RAY_DIFFERENTIALS__
555 *domega_in_dx = (2 *
dot(
Z, dIdx)) *
Z - dIdx;
556 *domega_in_dy = (2 *
dot(
Z, dIdy)) *
Z - dIdy;
565 bsdf->alpha_x =
clamp(bsdf->alpha_x, 1e-4f, 1.0f);
566 bsdf->alpha_y = bsdf->alpha_x;
567 bsdf->ior =
max(0.0f, bsdf->ior);
568 bsdf->extra->color =
saturate(bsdf->extra->color);
578 bsdf->alpha_x =
clamp(bsdf->alpha_x, 1e-4f, 1.0f);
579 bsdf->alpha_y = bsdf->alpha_x;
580 bsdf->ior =
max(0.0f, bsdf->ior);
581 bsdf->extra->color =
saturate(bsdf->extra->color);
582 bsdf->extra->cspec0 =
saturate(bsdf->extra->cspec0);
600 if (bsdf->alpha_x * bsdf->alpha_y < 1e-7f) {
612 *pdf =
mf_glass_pdf(localI, localO, bsdf->alpha_x, bsdf->ior);
613 return mf_eval_glass(localI,
633 if (bsdf->alpha_x * bsdf->alpha_y < 1e-7f) {
647 *pdf =
mf_glass_pdf(localI, localO, bsdf->alpha_x, bsdf->ior);
648 return mf_eval_glass(localI,
657 bsdf->extra->cspec0);
680 if (bsdf->alpha_x * bsdf->alpha_y < 1e-7f) {
682 #ifdef __RAY_DIFFERENTIALS__
683 float3 dRdx, dRdy, dTdx, dTdy;
703 if (randu < fresnel) {
705 #ifdef __RAY_DIFFERENTIALS__
706 *domega_in_dx = dRdx;
707 *domega_in_dy = dRdy;
713 #ifdef __RAY_DIFFERENTIALS__
714 *domega_in_dx = dTdx;
715 *domega_in_dy = dTdy;
728 *eval = mf_sample_glass(localI,
736 bsdf->extra->cspec0);
737 *pdf =
mf_glass_pdf(localI, localO, bsdf->alpha_x, bsdf->ior);
740 *omega_in =
X * localO.
x +
Y * localO.
y +
Z * localO.
z;
741 if (localO.
z * localI.
z > 0.0f) {
742 #ifdef __RAY_DIFFERENTIALS__
743 *domega_in_dx = (2 *
dot(
Z, dIdx)) *
Z - dIdx;
744 *domega_in_dy = (2 *
dot(
Z, dIdy)) *
Z - dIdy;
749 #ifdef __RAY_DIFFERENTIALS__
750 float cosI =
dot(
Z,
I);
751 float dnp =
max(
sqrtf(1.0f - (bsdf->ior * bsdf->ior * (1.0f - cosI * cosI))), 1e-7f);
752 *domega_in_dx = -(bsdf->ior * dIdx) +
753 ((bsdf->ior - bsdf->ior * bsdf->ior * cosI / dnp) *
dot(dIdx,
Z)) *
Z;
754 *domega_in_dy = -(bsdf->ior * dIdy) +
755 ((bsdf->ior - bsdf->ior * bsdf->ior * cosI / dnp) *
dot(dIdy,
Z)) *
Z;
MINLINE float safe_sqrtf(float a)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble z
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble GLdouble r _GL_VOID_RET _GL_VOID GLfloat GLfloat r _GL_VOID_RET _GL_VOID GLint GLint r _GL_VOID_RET _GL_VOID GLshort GLshort r _GL_VOID_RET _GL_VOID GLdouble GLdouble r
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a or normal between and object coordinate space Combine Create a color from its and value channels Color Retrieve a color or the default fallback if none is specified Separate Split a vector into its X
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a or normal between and object coordinate space Combine Create a color from its and value channels Color Retrieve a color or the default fallback if none is specified Separate Split a vector into its Y
ATTR_WARN_UNUSED_RESULT const BMVert * v
ccl_device_forceinline void bsdf_microfacet_fresnel_color(ccl_private const ShaderData *sd, ccl_private MicrofacetBsdf *bsdf)
ccl_device int bsdf_microfacet_multi_ggx_common_setup(ccl_private MicrofacetBsdf *bsdf)
ccl_device float3 bsdf_microfacet_multi_ggx_glass_eval_reflect(ccl_private const ShaderClosure *sc, const float3 I, const float3 omega_in, ccl_private float *pdf, ccl_private uint *lcg_state)
ccl_device void bsdf_microfacet_multi_ggx_blur(ccl_private ShaderClosure *sc, float roughness)
ccl_device_forceinline float3 mf_eval_phase_glossy(const float3 w, const float lambda, const float3 wo, const float2 alpha)
ccl_device_forceinline float D_ggx_aniso(const float3 wm, const float2 alpha)
ccl_device_forceinline float mf_C1(const float h)
ccl_device_forceinline float3 mf_sample_phase_glass(const float3 wi, const float eta, const float3 wm, const float randV, ccl_private bool *outside)
ccl_device float3 bsdf_microfacet_multi_ggx_eval_reflect(ccl_private const ShaderClosure *sc, const float3 I, const float3 omega_in, ccl_private float *pdf, ccl_private uint *lcg_state)
ccl_device_forceinline bool mf_sample_height(const float3 w, ccl_private float *h, ccl_private float *C1, ccl_private float *G1, ccl_private float *lambda, const float U)
ccl_device_forceinline float mf_lambda(const float3 w, const float2 alpha)
ccl_device_forceinline float mf_invC1(const float h)
ccl_device int bsdf_microfacet_multi_ggx_glass_fresnel_setup(ccl_private MicrofacetBsdf *bsdf, ccl_private const ShaderData *sd)
ccl_device int bsdf_microfacet_multi_ggx_setup(ccl_private MicrofacetBsdf *bsdf)
ccl_device float3 bsdf_microfacet_multi_ggx_eval_transmit(ccl_private const ShaderClosure *sc, const float3 I, const float3 omega_in, ccl_private float *pdf, ccl_private uint *lcg_state)
ccl_device float3 bsdf_microfacet_multi_ggx_glass_eval_transmit(ccl_private const ShaderClosure *sc, const float3 I, const float3 omega_in, ccl_private float *pdf, ccl_private uint *lcg_state)
ccl_device_forceinline float3 mf_eval_phase_glass(const float3 w, const float lambda, const float3 wo, const bool wo_outside, const float2 alpha, const float eta)
ccl_device int bsdf_microfacet_multi_ggx_glass_setup(ccl_private MicrofacetBsdf *bsdf)
ccl_device_forceinline float mf_ggx_aniso_pdf(const float3 wi, const float3 wo, const float2 alpha)
ccl_device int bsdf_microfacet_multi_ggx_refraction_setup(ccl_private MicrofacetBsdf *bsdf)
ccl_device_forceinline float mf_glass_pdf(const float3 wi, const float3 wo, const float alpha, const float eta)
CCL_NAMESPACE_BEGIN ccl_device_forceinline float D_ggx(float3 wm, float alpha)
ccl_device_forceinline float3 mf_sample_vndf(const float3 wi, const float2 alpha, const float randx, const float randy)
ccl_device_forceinline float2 mf_sampleP22_11(const float cosI, const float randx, const float randy)
ccl_device_inline float mf_ggx_transmission_albedo(float a, float ior)
ccl_device int bsdf_microfacet_multi_ggx_glass_sample(KernelGlobals kg, ccl_private const ShaderClosure *sc, float3 Ng, float3 I, float3 dIdx, float3 dIdy, float randu, float randv, ccl_private float3 *eval, ccl_private float3 *omega_in, ccl_private float3 *domega_in_dx, ccl_private float3 *domega_in_dy, ccl_private float *pdf, ccl_private uint *lcg_state)
ccl_device_forceinline float mf_G1(const float3 w, const float C1, const float lambda)
ccl_device int bsdf_microfacet_multi_ggx_fresnel_setup(ccl_private MicrofacetBsdf *bsdf, ccl_private const ShaderData *sd)
ccl_device int bsdf_microfacet_multi_ggx_sample(KernelGlobals kg, ccl_private const ShaderClosure *sc, float3 Ng, float3 I, float3 dIdx, float3 dIdy, float randu, float randv, ccl_private float3 *eval, ccl_private float3 *omega_in, ccl_private float3 *domega_in_dx, ccl_private float3 *domega_in_dy, ccl_private float *pdf, ccl_private uint *lcg_state)
ccl_device_forceinline float mf_ggx_albedo(float r)
ccl_device_forceinline float mf_ggx_pdf(const float3 wi, const float3 wo, const float alpha)
ccl_device_forceinline float3 mf_sample_phase_glossy(const float3 wi, ccl_private float3 *weight, const float3 wm)
ccl_device float fresnel_dielectric_cos(float cosi, float eta)
CCL_NAMESPACE_BEGIN ccl_device float fresnel_dielectric(float eta, const float3 N, const float3 I, ccl_private float3 *R, ccl_private float3 *T, ccl_private bool *is_inside)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
#define kernel_assert(cond)
#define ccl_device_forceinline
#define ccl_device_inline
#define CCL_NAMESPACE_END
const KernelGlobalsCPU *ccl_restrict KernelGlobals
@ CLOSURE_BSDF_MICROFACET_MULTI_GGX_ID
@ CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID
@ CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_FRESNEL_ID
@ CLOSURE_BSDF_MICROFACET_MULTI_GGX_FRESNEL_ID
#define __RAY_DIFFERENTIALS__
ccl_device_inline float2 safe_normalize(const float2 &a)
ccl_device_inline float2 normalize_len(const float2 &a, float *t)
ccl_device_inline float3 saturate(float3 a)
T dot(const vec_base< T, Size > &a, const vec_base< T, Size > &b)
T clamp(const T &a, const T &min, const T &max)
vec_base< T, Size > normalize(const vec_base< T, Size > &v)
static const pxr::TfToken ior("ior", pxr::TfToken::Immortal)
static const pxr::TfToken roughness("roughness", pxr::TfToken::Immortal)
ccl_device void make_orthonormals_tangent(const float3 N, const float3 T, ccl_private float3 *a, ccl_private float3 *b)
ccl_device_inline float saturatef(float a)
ccl_device_inline void make_orthonormals(const float3 N, ccl_private float3 *a, ccl_private float3 *b)
BLI_INLINE float D(const float *data, const int res[3], int x, int y, int z)