9 #ifndef CCL_STDCYCLESOSL_H
10 #define CCL_STDCYCLESOSL_H
16 #define BUILTIN [[int builtin = 1]]
17 #define BUILTIN_DERIV [[ int builtin = 1, int deriv = 1 ]]
85 float NdotNg =
dot(
N, Ng);
89 float Ix2 =
sqr(Ix), Iz2 =
sqr(Iz);
96 float N1_z2 = fac * (
b +
c), N2_z2 = fac * (-
b +
c);
97 int valid1 = (N1_z2 > 1
e-5) && (N1_z2 <= (1.0 + 1
e-5));
98 int valid2 = (N2_z2 > 1
e-5) && (N2_z2 <= (1.0 + 1
e-5));
100 float N_new_x, N_new_z;
101 if (valid1 && valid2) {
102 float N1_x =
sqrt(1.0 - N1_z2), N1_z =
sqrt(N1_z2);
103 float N2_x =
sqrt(1.0 - N2_z2), N2_z =
sqrt(N2_z2);
105 float R1 = 2 * (N1_x * Ix + N1_z * Iz) * N1_z - Iz;
106 float R2 = 2 * (N2_x * Ix + N2_z * Iz) * N2_z - Iz;
108 valid1 = (R1 >= 1
e-5);
109 valid2 = (R2 >= 1
e-5);
110 if (valid1 && valid2) {
111 N_new_x = (R1 < R2) ? N1_x : N2_x;
112 N_new_z = (R1 < R2) ? N1_z : N2_z;
115 N_new_x = (R1 > R2) ? N1_x : N2_x;
116 N_new_z = (R1 > R2) ? N1_z : N2_z;
119 else if (valid1 || valid2) {
120 float Nz2 = valid1 ? N1_z2 : N2_z2;
121 N_new_x =
sqrt(1.0 - Nz2);
128 return N_new_x *
X + N_new_z * Ng;
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
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a color
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
IconTextureDrawCall normal
ccl_gpu_kernel_postfix ccl_global float int int int int float threshold
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
T dot(const vec_base< T, Size > &a, const vec_base< T, Size > &b)
vec_base< T, Size > normalize(const vec_base< T, Size > &v)
static const pxr::TfToken clearcoat("clearcoat", pxr::TfToken::Immortal)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
static const pxr::TfToken g("g", pxr::TfToken::Immortal)
static const pxr::TfToken roughness("roughness", pxr::TfToken::Immortal)
smooth(Type::FLOAT, "mask_weight")
closure color microfacet_ggx(normal N, float ag) BUILTIN
closure color principled_diffuse(normal N, float roughness) BUILTIN
closure color microfacet_multi_ggx_glass_fresnel(normal N, float ag, float eta, color C, color Cspec0) BUILTIN
closure color absorption() BUILTIN
closure color microfacet_ggx_aniso_fresnel(normal N, vector T, float ax, float ay, float eta, color C, color Cspec0) BUILTIN
closure color phong_ramp(normal N, float exponent, color colors[8]) BUILTIN
closure color microfacet_multi_ggx_glass(normal N, float ag, float eta, color C) BUILTIN
closure color microfacet_multi_ggx_aniso_fresnel(normal N, vector T, float ax, float ay, float eta, color C, color Cspec0) BUILTIN
closure color microfacet_multi_ggx_fresnel(normal N, float ag, float eta, color C, color Cspec0) BUILTIN
closure color diffuse_toon(normal N, float size, float smooth) BUILTIN
closure color henyey_greenstein(float g) BUILTIN
closure color ambient_occlusion() BUILTIN
closure color microfacet_multi_ggx(normal N, float ag, color C) BUILTIN
closure color microfacet_multi_ggx_aniso(normal N, vector T, float ax, float ay, color C) BUILTIN
closure color hair_transmission(normal N, float roughnessu, float roughnessv, vector T, float offset) BUILTIN
closure color ashikhmin_velvet(normal N, float sigma) BUILTIN
closure color diffuse_ramp(normal N, color colors[8]) BUILTIN
closure color bssrdf(string method, normal N, vector radius, color albedo) BUILTIN
closure color microfacet_ggx_refraction(normal N, float ag, float eta) BUILTIN
closure color principled_clearcoat(normal N, float clearcoat, float clearcoat_roughness) BUILTIN
closure color hair_reflection(normal N, float roughnessu, float roughnessv, vector T, float offset) BUILTIN
normal ensure_valid_reflection(normal Ng, vector I, normal N)
closure color microfacet_beckmann(normal N, float ab) BUILTIN
closure color microfacet_ggx_aniso(normal N, vector T, float ax, float ay) BUILTIN
closure color principled_hair(normal N, color sigma, float roughnessu, float roughnessv, float coat, float alpha, float eta) BUILTIN
closure color microfacet_ggx_fresnel(normal N, float ag, float eta, color C, color Cspec0) BUILTIN
closure color ashikhmin_shirley(normal N, vector T, float ax, float ay) BUILTIN
closure color microfacet_beckmann_aniso(normal N, vector T, float ax, float ay) BUILTIN
closure color glossy_toon(normal N, float size, float smooth) BUILTIN
closure color microfacet_beckmann_refraction(normal N, float ab, float eta) BUILTIN
closure color principled_sheen(normal N) BUILTIN
ccl_device_inline float sqr(float a)