Blender V4.3
stdcycles.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2009-2010 Sony Pictures Imageworks Inc., et al. All Rights Reserved.
2 * SPDX-FileCopyrightText: 2011-2022 Blender Foundation
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 * Adapted code from Open Shading Language. */
7
8#ifndef CCL_STDCYCLESOSL_H
9#define CCL_STDCYCLESOSL_H
10
11#include "stdosl.h"
12
13// Constants
14#define FLT_MAX 3.402823466e+38 // max value
15
16// Declaration of built-in functions and closures, stdosl.h does not make
17// these available so we have to redefine them.
18#define BUILTIN [[int builtin = 1]]
19#define BUILTIN_DERIV [[ int builtin = 1, int deriv = 1 ]]
20
21closure color diffuse_ramp(normal N, color colors[8]) BUILTIN;
22closure color phong_ramp(normal N, float exponent, color colors[8]) BUILTIN;
23closure color diffuse_toon(normal N, float size, float smooth) BUILTIN;
24closure color glossy_toon(normal N, float size, float smooth) BUILTIN;
25closure color ashikhmin_velvet(normal N, float sigma) BUILTIN;
26closure color sheen(normal N, float roughness) BUILTIN;
28
30 string distribution, vector N, vector T, float ax, float ay, color f0, color f82) BUILTIN;
31
32/* Needed to pass along the color for multi-scattering saturation adjustment,
33 * otherwise could be replaced by microfacet() */
34closure color microfacet_multi_ggx_glass(normal N, float ag, float eta, color C) BUILTIN;
35closure color microfacet_multi_ggx_aniso(normal N, vector T, float ax, float ay, color C) BUILTIN;
36
37// BSSRDF
38closure color bssrdf(string method, normal N, vector radius, color albedo) BUILTIN;
39
40// Hair
41closure color
42hair_reflection(normal N, float roughnessu, float roughnessv, vector T, float offset) BUILTIN;
43closure color
44hair_transmission(normal N, float roughnessu, float roughnessv, vector T, float offset) BUILTIN;
45closure color hair_chiang(normal N,
46 color sigma,
47 float roughnessu,
48 float roughnessv,
49 float coat,
50 float alpha,
51 float eta) BUILTIN;
52closure color hair_huang(normal N,
53 color sigma,
54 float roughness,
55 float tilt,
56 float eta,
57 float aspect_ratio,
58 float r_lobe,
59 float tt_lobe,
60 float trt_lobe) BUILTIN;
61
62// Volume
64closure color fournier_forand(float B, float IOR) BUILTIN;
65closure color draine(float g, float alpha) BUILTIN;
68
69// Ray Portal
70closure color ray_portal_bsdf(vector position, vector direction) BUILTIN;
71
72#endif /* CCL_STDOSL_H */
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 Brightness Control the brightness and contrast of the input color Vector Map input vector components with curves 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 Invert a color
#define C
Definition RandGen.cpp:29
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition btDbvt.cpp:52
smooth(Type::VEC3, "P") .flat(Type out_color storage_buf(0, Qualifier::READ, "Surfel", "surfels_buf[]") .push_constant(Type smooth(Type::VEC4, "interp_color")
#define N
#define T
#define B
closure color absorption() BUILTIN
closure color fournier_forand(float B, float IOR) 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 ray_portal_bsdf(vector position, vector direction) BUILTIN
closure color hair_chiang(normal N, color sigma, float roughnessu, float roughnessv, float coat, float alpha, float eta) BUILTIN
closure color diffuse_toon(normal N, float size, float smooth) BUILTIN
closure color henyey_greenstein(float g) BUILTIN
#define BUILTIN
Definition stdcycles.h:18
closure color ambient_occlusion() 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 hair_huang(normal N, color sigma, float roughness, float tilt, float eta, float aspect_ratio, float r_lobe, float tt_lobe, float trt_lobe) BUILTIN
closure color sheen(normal N, float roughness) BUILTIN
closure color hair_reflection(normal N, float roughnessu, float roughnessv, vector T, float offset) BUILTIN
closure color microfacet_f82_tint(string distribution, vector N, vector T, float ax, float ay, color f0, color f82) BUILTIN
closure color rayleigh() BUILTIN
closure color draine(float g, float alpha) BUILTIN
closure color glossy_toon(normal N, float size, float smooth) BUILTIN