Blender V5.3
eevee_bxdf_types.bsl.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
8
12
17
18struct BsdfEval {
19 /* BSDF * NL. */
21 /* Probability of sampling a light direction. */
22 float pdf;
23 /* `throughput / pdf`. */
24 float weight;
25};
26
27/* Approximation types for computing the irradiance (form factor on point) of area lights. */
29 /* Form factor of a horizon-clipped sphere affecting a single-sided surface. */
31 /* Form factor of an unclipped sphere affecting a two-sided surface. */
33};
34
36 /* Shading normal. */
38 /* Enum used as index to fetch which light intensity to use [0..3]. */
39 LightingType type;
40 /* Output both shadowed and unshadowed for shadow denoising. */
43 /* Packed LTC matrix and attenuation data. */
45};
46
47/* Represent an approximation of a bunch of rays from a BSDF. */
49 /* Average direction of sampled rays or its approximation.
50 * Magnitude will reduce directionality of spherical harmonic evaluation. */
52 /* Perceptual roughness in [0..1] range.
53 * Modulate blur level of spherical probe and blend between sphere probe and spherical harmonic
54 * evaluation at higher roughness. */
56};
57
58/* -------------------------------------------------------------------- */
61
62/* Fresnel monochromatic, perfect mirror */
63float F_eta(float eta, float cos_theta)
64{
65 /* Compute fresnel reflectance without explicitly computing
66 * the refracted direction. */
67 float c = abs(cos_theta);
68 float g = eta * eta - 1.0f + c * c;
69 if (g > 0.0f) {
70 g = sqrt(g);
71 float A = (g - c) / (g + c);
72 float B = (c * (g + c) - 1.0f) / (c * (g - c) + 1.0f);
73 return 0.5f * A * A * (1.0f + B * B);
74 }
75 /* Total internal reflections. */
76 return 1.0f;
77}
78
#define A
ccl_device_inline float cos_theta(const float3 w)
float F_eta(float eta, float cos_theta)
#define abs
#define sqrt
unsigned int uchar
#define B
packed_float3 direction
packed_float3 light_shadowed
packed_float3 light_unshadowed
packed_float3 dominant_direction