Blender  V3.3
shader_nodes.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: Apache-2.0
2  * Copyright 2011-2022 Blender Foundation */
3 
4 #ifndef __NODES_H__
5 #define __NODES_H__
6 
7 #include "graph/node.h"
8 #include "scene/image.h"
9 #include "scene/shader_graph.h"
10 
11 #include "util/array.h"
12 #include "util/string.h"
13 
15 
16 class ImageManager;
17 class LightManager;
18 class Scene;
19 class Shader;
20 
21 /* Texture Mapping */
22 
24  public:
27  bool skip();
28  void compile(SVMCompiler &compiler, int offset_in, int offset_out);
29  int compile(SVMCompiler &compiler, ShaderInput *vector_in);
30  void compile(OSLCompiler &compiler);
31 
32  int compile_begin(SVMCompiler &compiler, ShaderInput *vector_in);
33  void compile_end(SVMCompiler &compiler, ShaderInput *vector_in, int vector_offset);
34 
38 
40  bool use_minmax;
41 
42  enum Type { POINT = 0, TEXTURE = 1, VECTOR = 2, NORMAL = 3 };
44 
45  enum Mapping { NONE = 0, X = 1, Y = 2, Z = 3 };
47 
50 };
51 
52 /* Nodes */
53 
54 class TextureNode : public ShaderNode {
55  public:
56  explicit TextureNode(const NodeType *node_type) : ShaderNode(node_type)
57  {
58  }
71 };
72 
73 /* Any node which uses image manager's slot should be a subclass of this one. */
75  public:
76  explicit ImageSlotTextureNode(const NodeType *node_type) : TextureNode(node_type)
77  {
79  }
80 
81  virtual bool equals(const ShaderNode &other)
82  {
83  const ImageSlotTextureNode &other_node = (const ImageSlotTextureNode &)other;
84  return TextureNode::equals(other) && handle == other_node.handle;
85  }
86 
88 };
89 
91  public:
96  {
97  return true;
98  }
99 
100  virtual bool equals(const ShaderNode &other)
101  {
102  const ImageTextureNode &other_node = (const ImageTextureNode &)other;
103  return ImageSlotTextureNode::equals(other) && animated == other_node.animated;
104  }
105 
106  ImageParams image_params() const;
107 
108  /* Parameters. */
109  NODE_SOCKET_API(ustring, filename)
110  NODE_SOCKET_API(ustring, colorspace)
111  NODE_SOCKET_API(ImageAlphaType, alpha_type)
113  NODE_SOCKET_API(InterpolationType, interpolation)
114  NODE_SOCKET_API(ExtensionType, extension)
115  NODE_SOCKET_API(float, projection_blend)
116  NODE_SOCKET_API(bool, animated)
119 
120  protected:
122 };
123 
125  public:
130  {
131  return true;
132  }
133 
134  virtual bool equals(const ShaderNode &other)
135  {
136  const EnvironmentTextureNode &other_node = (const EnvironmentTextureNode &)other;
137  return ImageSlotTextureNode::equals(other) && animated == other_node.animated;
138  }
139 
140  ImageParams image_params() const;
141 
142  /* Parameters. */
143  NODE_SOCKET_API(ustring, filename)
144  NODE_SOCKET_API(ustring, colorspace)
145  NODE_SOCKET_API(ImageAlphaType, alpha_type)
147  NODE_SOCKET_API(InterpolationType, interpolation)
148  NODE_SOCKET_API(bool, animated)
150 };
151 
152 class SkyTextureNode : public TextureNode {
153  public:
155 
156  NODE_SOCKET_API(NodeSkyType, sky_type)
157  NODE_SOCKET_API(float3, sun_direction)
158  NODE_SOCKET_API(float, turbidity)
159  NODE_SOCKET_API(float, ground_albedo)
160  NODE_SOCKET_API(bool, sun_disc)
161  NODE_SOCKET_API(float, sun_size)
162  NODE_SOCKET_API(float, sun_intensity)
163  NODE_SOCKET_API(float, sun_elevation)
164  NODE_SOCKET_API(float, sun_rotation)
165  NODE_SOCKET_API(float, altitude)
166  NODE_SOCKET_API(float, air_density)
167  NODE_SOCKET_API(float, dust_density)
168  NODE_SOCKET_API(float, ozone_density)
171 
172  float get_sun_size()
173  {
174  /* Clamping for numerical precision. */
175  return fmaxf(sun_size, 0.0005f);
176  }
177 };
178 
179 class OutputNode : public ShaderNode {
180  public:
182 
184  NODE_SOCKET_API(Node *, volume)
185  NODE_SOCKET_API(float3, displacement)
187 
188  /* Don't allow output node de-duplication. */
189  virtual bool equals(const ShaderNode & /*other*/)
190  {
191  return false;
192  }
193 };
194 
195 class OutputAOVNode : public ShaderNode {
196  public:
198  virtual void simplify_settings(Scene *scene);
199 
200  NODE_SOCKET_API(float, value)
202 
203  NODE_SOCKET_API(ustring, name)
204 
205  /* Don't allow output node de-duplication. */
206  virtual bool equals(const ShaderNode & /*other*/)
207  {
208  return false;
209  }
210 
211  int offset;
212  bool is_color;
213 };
214 
216  public:
218 
219  NODE_SOCKET_API(NodeGradientType, gradient_type)
221 };
222 
224  public:
226 
227  NODE_SOCKET_API(int, dimensions)
228  NODE_SOCKET_API(float, w)
229  NODE_SOCKET_API(float, scale)
230  NODE_SOCKET_API(float, detail)
231  NODE_SOCKET_API(float, roughness)
232  NODE_SOCKET_API(float, distortion)
234 };
235 
237  public:
239 
240  virtual int get_feature()
241  {
243  if (dimensions == 4) {
245  }
246  else if (dimensions >= 2 && feature == NODE_VORONOI_SMOOTH_F1) {
248  }
249  return result;
250  }
251 
252  NODE_SOCKET_API(int, dimensions)
255  NODE_SOCKET_API(float, w)
256  NODE_SOCKET_API(float, scale)
257  NODE_SOCKET_API(float, exponent)
258  NODE_SOCKET_API(float, smoothness)
259  NODE_SOCKET_API(float, randomness)
261 };
262 
264  public:
266 
267  NODE_SOCKET_API(int, dimensions)
268  NODE_SOCKET_API(NodeMusgraveType, musgrave_type)
269  NODE_SOCKET_API(float, w)
270  NODE_SOCKET_API(float, scale)
271  NODE_SOCKET_API(float, detail)
272  NODE_SOCKET_API(float, dimension)
273  NODE_SOCKET_API(float, lacunarity)
274  NODE_SOCKET_API(float, offset)
275  NODE_SOCKET_API(float, gain)
277 };
278 
279 class WaveTextureNode : public TextureNode {
280  public:
282 
283  NODE_SOCKET_API(NodeWaveType, wave_type)
284  NODE_SOCKET_API(NodeWaveBandsDirection, bands_direction)
285  NODE_SOCKET_API(NodeWaveRingsDirection, rings_direction)
287 
288  NODE_SOCKET_API(float, scale)
289  NODE_SOCKET_API(float, distortion)
290  NODE_SOCKET_API(float, detail)
291  NODE_SOCKET_API(float, detail_scale)
292  NODE_SOCKET_API(float, detail_roughness)
293  NODE_SOCKET_API(float, phase)
295 };
296 
298  public:
300 
301  NODE_SOCKET_API(int, depth)
303  NODE_SOCKET_API(float, scale)
304  NODE_SOCKET_API(float, distortion)
305 };
306 
308  public:
310 
312  NODE_SOCKET_API(float3, color1)
313  NODE_SOCKET_API(float3, color2)
314  NODE_SOCKET_API(float, scale)
315 };
316 
318  public:
320 
321  NODE_SOCKET_API(float, offset)
322  NODE_SOCKET_API(float, squash)
323  NODE_SOCKET_API(int, offset_frequency)
324  NODE_SOCKET_API(int, squash_frequency)
325 
326  NODE_SOCKET_API(float3, color1)
327  NODE_SOCKET_API(float3, color2)
328  NODE_SOCKET_API(float3, mortar)
329  NODE_SOCKET_API(float, scale)
330  NODE_SOCKET_API(float, mortar_size)
331  NODE_SOCKET_API(float, mortar_smooth)
332  NODE_SOCKET_API(float, bias)
333  NODE_SOCKET_API(float, brick_width)
334  NODE_SOCKET_API(float, row_height)
336 };
337 
339  public:
341 
346  {
347  return true;
348  }
349 
351  {
352  return true;
353  }
354 
355  /* Parameters. */
356  NODE_SOCKET_API(ustring, filename)
358  NODE_SOCKET_API(InterpolationType, interpolation)
361 
362  /* Runtime. */
364 
365  ImageParams image_params() const;
366 
367  virtual bool equals(const ShaderNode &other)
368  {
369  const PointDensityTextureNode &other_node = (const PointDensityTextureNode &)other;
370  return ShaderNode::equals(other) && handle == other_node.handle;
371  }
372 };
373 
374 class IESLightNode : public TextureNode {
375  public:
377 
378  ~IESLightNode();
380 
381  NODE_SOCKET_API(ustring, filename)
382  NODE_SOCKET_API(ustring, ies)
383 
384  NODE_SOCKET_API(float, strength)
386 
387  private:
388  LightManager *light_manager;
389  int slot;
390 
391  void get_slot();
392 };
393 
395  public:
397 
398  NODE_SOCKET_API(int, dimensions)
400  NODE_SOCKET_API(float, w)
401 };
402 
403 class MappingNode : public ShaderNode {
404  public:
406  void constant_fold(const ConstantFolder &folder);
407 
409  NODE_SOCKET_API(float3, location)
410  NODE_SOCKET_API(float3, rotation)
411  NODE_SOCKET_API(float3, scale)
412  NODE_SOCKET_API(NodeMappingType, mapping_type)
413 };
414 
415 class RGBToBWNode : public ShaderNode {
416  public:
418  void constant_fold(const ConstantFolder &folder);
419 
421 };
422 
423 class ConvertNode : public ShaderNode {
424  public:
425  ConvertNode(SocketType::Type from, SocketType::Type to, bool autoconvert = false);
426  ConvertNode(const ConvertNode &other);
428 
429  void constant_fold(const ConstantFolder &folder);
430 
431  private:
433 
434  union {
435  float value_float;
441  };
442  ustring value_string;
443 
444  static const int MAX_TYPE = 12;
445  static bool register_types();
446  static Node *create(const NodeType *type);
447  static const NodeType *node_types[MAX_TYPE][MAX_TYPE];
448  static bool initialized;
449 };
450 
451 class BsdfBaseNode : public ShaderNode {
452  public:
453  BsdfBaseNode(const NodeType *node_type);
454 
456  {
457  return true;
458  }
460  {
461  return closure;
462  }
463  virtual bool has_bump();
464 
465  virtual bool equals(const ShaderNode & /*other*/)
466  {
467  /* TODO(sergey): With some care BSDF nodes can be de-duplicated. */
468  return false;
469  }
470 
471  virtual int get_feature()
472  {
474  }
475 
476  protected:
478 };
479 
480 class BsdfNode : public BsdfBaseNode {
481  public:
482  explicit BsdfNode(const NodeType *node_type);
484 
485  void compile(SVMCompiler &compiler,
486  ShaderInput *param1,
487  ShaderInput *param2,
488  ShaderInput *param3 = NULL,
489  ShaderInput *param4 = NULL);
490 
493  NODE_SOCKET_API(float, surface_mix_weight)
494 };
495 
497  public:
499 
500  NODE_SOCKET_API(float3, tangent)
501  NODE_SOCKET_API(float, roughness)
502  NODE_SOCKET_API(float, anisotropy)
503  NODE_SOCKET_API(float, rotation)
504  NODE_SOCKET_API(ClosureType, distribution)
505 
507  {
508  return distribution;
509  }
512  {
513  return true;
514  }
515 };
516 
517 class DiffuseBsdfNode : public BsdfNode {
518  public:
520 
521  NODE_SOCKET_API(float, roughness)
522 };
523 
524 /* Disney principled BRDF */
526  public:
528 
529  void expand(ShaderGraph *graph);
530  bool has_surface_bssrdf();
531  bool has_bssrdf_bump();
532  void compile(SVMCompiler &compiler,
534  ShaderInput *subsurface,
535  ShaderInput *subsurface_radius,
536  ShaderInput *subsurface_ior,
537  ShaderInput *subsurface_anisotropy,
540  ShaderInput *specular_tint,
541  ShaderInput *anisotropic,
542  ShaderInput *sheen,
543  ShaderInput *sheen_tint,
545  ShaderInput *clearcoat_roughness,
546  ShaderInput *ior,
547  ShaderInput *transmission,
548  ShaderInput *anisotropic_rotation,
549  ShaderInput *transmission_roughness);
550 
551  NODE_SOCKET_API(float3, base_color)
552  NODE_SOCKET_API(float3, subsurface_color)
553  NODE_SOCKET_API(float3, subsurface_radius)
554  NODE_SOCKET_API(float, subsurface_ior)
555  NODE_SOCKET_API(float, subsurface_anisotropy)
556  NODE_SOCKET_API(float, metallic)
557  NODE_SOCKET_API(float, subsurface)
558  NODE_SOCKET_API(float, specular)
559  NODE_SOCKET_API(float, roughness)
560  NODE_SOCKET_API(float, specular_tint)
561  NODE_SOCKET_API(float, anisotropic)
562  NODE_SOCKET_API(float, sheen)
563  NODE_SOCKET_API(float, sheen_tint)
564  NODE_SOCKET_API(float, clearcoat)
565  NODE_SOCKET_API(float, clearcoat_roughness)
566  NODE_SOCKET_API(float, ior)
567  NODE_SOCKET_API(float, transmission)
568  NODE_SOCKET_API(float, anisotropic_rotation)
569  NODE_SOCKET_API(float, transmission_roughness)
571  NODE_SOCKET_API(float3, clearcoat_normal)
572  NODE_SOCKET_API(float3, tangent)
573  NODE_SOCKET_API(float, surface_mix_weight)
574  NODE_SOCKET_API(ClosureType, distribution)
575  NODE_SOCKET_API(ClosureType, subsurface_method)
576  NODE_SOCKET_API(float3, emission)
577  NODE_SOCKET_API(float, emission_strength)
578  NODE_SOCKET_API(float, alpha)
579 
580  private:
581  ClosureType distribution_orig;
582 
583  public:
587  {
588  return true;
589  }
590 };
591 
593  public:
595 };
596 
598  public:
600 
602  {
603  return true;
604  }
605 };
606 
607 class VelvetBsdfNode : public BsdfNode {
608  public:
610 
611  NODE_SOCKET_API(float, sigma)
612 };
613 
614 class GlossyBsdfNode : public BsdfNode {
615  public:
617 
621  {
622  return distribution;
623  }
624 
625  NODE_SOCKET_API(float, roughness)
626  NODE_SOCKET_API(ClosureType, distribution)
627 
628  private:
629  float roughness_orig;
630  ClosureType distribution_orig;
631 };
632 
633 class GlassBsdfNode : public BsdfNode {
634  public:
636 
640  {
641  return distribution;
642  }
643 
644  NODE_SOCKET_API(float, roughness)
645  NODE_SOCKET_API(float, IOR)
646  NODE_SOCKET_API(ClosureType, distribution)
647 
648  private:
649  float roughness_orig;
650  ClosureType distribution_orig;
651 };
652 
653 class RefractionBsdfNode : public BsdfNode {
654  public:
656 
660  {
661  return distribution;
662  }
663 
664  NODE_SOCKET_API(float, roughness)
665  NODE_SOCKET_API(float, IOR)
666  NODE_SOCKET_API(ClosureType, distribution)
667 
668  private:
669  float roughness_orig;
670  ClosureType distribution_orig;
671 };
672 
673 class ToonBsdfNode : public BsdfNode {
674  public:
676 
677  NODE_SOCKET_API(float, smooth)
678  NODE_SOCKET_API(float, size)
680 };
681 
683  public:
686  {
687  return true;
688  }
689  bool has_bssrdf_bump();
691  {
692  return method;
693  }
694 
695  NODE_SOCKET_API(float, scale)
696  NODE_SOCKET_API(float3, radius)
697  NODE_SOCKET_API(float, subsurface_ior)
698  NODE_SOCKET_API(float, subsurface_anisotropy)
700 };
701 
702 class EmissionNode : public ShaderNode {
703  public:
705  void constant_fold(const ConstantFolder &folder);
706 
708  {
709  return true;
710  }
712  {
713  return true;
714  }
715 
716  virtual int get_feature()
717  {
719  }
720 
722  NODE_SOCKET_API(float, strength)
723  NODE_SOCKET_API(float, surface_mix_weight)
724 };
725 
726 class BackgroundNode : public ShaderNode {
727  public:
729  void constant_fold(const ConstantFolder &folder);
730 
731  virtual int get_feature()
732  {
734  }
735 
737  NODE_SOCKET_API(float, strength)
738  NODE_SOCKET_API(float, surface_mix_weight)
739 };
740 
741 class HoldoutNode : public ShaderNode {
742  public:
745  {
746  return CLOSURE_HOLDOUT_ID;
747  }
748 
749  NODE_SOCKET_API(float, surface_mix_weight)
750  NODE_SOCKET_API(float, volume_mix_weight)
751 };
752 
754  public:
756 
758  {
759  return true;
760  }
761  virtual int get_feature()
762  {
764  }
765 
767  NODE_SOCKET_API(float, distance)
769  NODE_SOCKET_API(int, samples)
770 
771  NODE_SOCKET_API(bool, only_local)
772  NODE_SOCKET_API(bool, inside)
773 };
774 
775 class VolumeNode : public ShaderNode {
776  public:
777  VolumeNode(const NodeType *node_type);
779 
780  void compile(SVMCompiler &compiler, ShaderInput *param1, ShaderInput *param2);
781  virtual int get_feature()
782  {
784  }
786  {
787  return closure;
788  }
789  virtual bool has_volume_support()
790  {
791  return true;
792  }
793 
795  NODE_SOCKET_API(float, density)
796  NODE_SOCKET_API(float, volume_mix_weight)
797 
798  protected:
800 
801  public:
802  virtual bool equals(const ShaderNode & /*other*/)
803  {
804  /* TODO(sergey): With some care Volume nodes can be de-duplicated. */
805  return false;
806  }
807 };
808 
810  public:
812 };
813 
815  public:
817 
818  NODE_SOCKET_API(float, anisotropy)
819 };
820 
822  public:
826  {
827  return true;
828  }
829 
830  NODE_SOCKET_API(ustring, density_attribute)
831  NODE_SOCKET_API(ustring, color_attribute)
832  NODE_SOCKET_API(ustring, temperature_attribute)
833 
834  NODE_SOCKET_API(float, anisotropy)
835  NODE_SOCKET_API(float3, absorption_color)
836  NODE_SOCKET_API(float, emission_strength)
837  NODE_SOCKET_API(float3, emission_color)
838  NODE_SOCKET_API(float, blackbody_intensity)
839  NODE_SOCKET_API(float3, blackbody_tint)
840  NODE_SOCKET_API(float, temperature)
841 };
842 
843 /* Interface between the I/O sockets and the SVM/OSL backend. */
845  public:
848 
849  /* Longitudinal roughness. */
850  NODE_SOCKET_API(float, roughness)
851  /* Azimuthal roughness. */
852  NODE_SOCKET_API(float, radial_roughness)
853  /* Randomization factor for roughnesses. */
854  NODE_SOCKET_API(float, random_roughness)
855  /* Longitudinal roughness factor for only the diffuse bounce (shiny undercoat). */
856  NODE_SOCKET_API(float, coat)
857  /* Index of reflection. */
858  NODE_SOCKET_API(float, ior)
859  /* Cuticle tilt angle. */
860  NODE_SOCKET_API(float, offset)
861  /* Direct coloring's color. */
863  /* Melanin concentration. */
864  NODE_SOCKET_API(float, melanin)
865  /* Melanin redness ratio. */
866  NODE_SOCKET_API(float, melanin_redness)
867  /* Dye color. */
868  NODE_SOCKET_API(float3, tint)
869  /* Randomization factor for melanin quantities. */
870  NODE_SOCKET_API(float, random_color)
871  /* Absorption coefficient (unfiltered). */
872  NODE_SOCKET_API(float3, absorption_coefficient)
873 
875  NODE_SOCKET_API(float, surface_mix_weight)
876  /* If linked, here will be the given random number. */
877  NODE_SOCKET_API(float, random)
878  /* Selected coloring parametrization. */
880 };
881 
882 class HairBsdfNode : public BsdfNode {
883  public:
886  {
887  return component;
888  }
889 
891  NODE_SOCKET_API(float, offset)
892  NODE_SOCKET_API(float, roughness_u)
893  NODE_SOCKET_API(float, roughness_v)
894  NODE_SOCKET_API(float3, tangent)
895 };
896 
897 class GeometryNode : public ShaderNode {
898  public:
902  {
903  return true;
904  }
906  {
907  return true;
908  }
909  int get_group();
910 
911  NODE_SOCKET_API(float3, normal_osl)
912 };
913 
915  public:
919  {
920  return true;
921  }
923  {
924  return true;
925  }
926 
927  NODE_SOCKET_API(float3, normal_osl)
928  NODE_SOCKET_API(bool, from_dupli)
929  NODE_SOCKET_API(bool, use_transform)
930  NODE_SOCKET_API(Transform, ob_tfm)
931 };
932 
933 class UVMapNode : public ShaderNode {
934  public:
938  {
939  return true;
940  }
942  {
943  return true;
944  }
945 
946  NODE_SOCKET_API(ustring, attribute)
947  NODE_SOCKET_API(bool, from_dupli)
948 };
949 
950 class LightPathNode : public ShaderNode {
951  public:
953 };
954 
955 class LightFalloffNode : public ShaderNode {
956  public:
959  {
960  return true;
961  }
962 
963  NODE_SOCKET_API(float, strength)
964  NODE_SOCKET_API(float, smooth)
965 };
966 
967 class ObjectInfoNode : public ShaderNode {
968  public:
970 };
971 
972 class ParticleInfoNode : public ShaderNode {
973  public:
977  {
978  return true;
979  }
980 };
981 
982 class HairInfoNode : public ShaderNode {
983  public:
985 
988  {
989  return true;
990  }
992  {
993  return true;
994  }
995 };
996 
997 class PointInfoNode : public ShaderNode {
998  public:
1000 
1003  {
1004  return true;
1005  }
1007  {
1008  return true;
1009  }
1010 };
1011 
1012 class VolumeInfoNode : public ShaderNode {
1013  public:
1017  {
1018  return true;
1019  }
1021  {
1022  return true;
1023  }
1024  void expand(ShaderGraph *graph);
1025 };
1026 
1027 class VertexColorNode : public ShaderNode {
1028  public:
1032  {
1033  return true;
1034  }
1036  {
1037  return true;
1038  }
1039 
1040  NODE_SOCKET_API(ustring, layer_name)
1041 };
1042 
1043 class ValueNode : public ShaderNode {
1044  public:
1046 
1047  void constant_fold(const ConstantFolder &folder);
1048 
1049  NODE_SOCKET_API(float, value)
1050 };
1051 
1052 class ColorNode : public ShaderNode {
1053  public:
1055 
1056  void constant_fold(const ConstantFolder &folder);
1057 
1058  NODE_SOCKET_API(float3, value)
1059 };
1060 
1061 class AddClosureNode : public ShaderNode {
1062  public:
1064  void constant_fold(const ConstantFolder &folder);
1065 };
1066 
1067 class MixClosureNode : public ShaderNode {
1068  public:
1070  void constant_fold(const ConstantFolder &folder);
1071 
1072  NODE_SOCKET_API(float, fac)
1073 };
1074 
1076  public:
1078 
1079  NODE_SOCKET_API(float, weight)
1080  NODE_SOCKET_API(float, fac)
1081 };
1082 
1083 class InvertNode : public ShaderNode {
1084  public:
1086  void constant_fold(const ConstantFolder &folder);
1087 
1088  NODE_SOCKET_API(float, fac)
1090 };
1091 
1092 class MixNode : public ShaderNode {
1093  public:
1095  void constant_fold(const ConstantFolder &folder);
1096 
1097  NODE_SOCKET_API(NodeMix, mix_type)
1098  NODE_SOCKET_API(bool, use_clamp)
1099  NODE_SOCKET_API(float3, color1)
1100  NODE_SOCKET_API(float3, color2)
1101  NODE_SOCKET_API(float, fac)
1102 };
1103 
1105  public:
1107  void constant_fold(const ConstantFolder &folder);
1108 
1110  NODE_SOCKET_API(float, r)
1111  NODE_SOCKET_API(float, g)
1112  NODE_SOCKET_API(float, b)
1113 };
1114 
1115 class CombineRGBNode : public ShaderNode {
1116  public:
1118  void constant_fold(const ConstantFolder &folder);
1119 
1120  NODE_SOCKET_API(float, r)
1121  NODE_SOCKET_API(float, g)
1122  NODE_SOCKET_API(float, b)
1123 };
1124 
1125 class CombineHSVNode : public ShaderNode {
1126  public:
1128  void constant_fold(const ConstantFolder &folder);
1129 
1130  NODE_SOCKET_API(float, h)
1131  NODE_SOCKET_API(float, s)
1132  NODE_SOCKET_API(float, v)
1133 };
1134 
1135 class CombineXYZNode : public ShaderNode {
1136  public:
1138  void constant_fold(const ConstantFolder &folder);
1139 
1140  NODE_SOCKET_API(float, x)
1141  NODE_SOCKET_API(float, y)
1142  NODE_SOCKET_API(float, z)
1143 };
1144 
1145 class GammaNode : public ShaderNode {
1146  public:
1148  void constant_fold(const ConstantFolder &folder);
1149 
1151  NODE_SOCKET_API(float, gamma)
1152 };
1153 
1155  public:
1157  void constant_fold(const ConstantFolder &folder);
1158 
1160  NODE_SOCKET_API(float, bright)
1161  NODE_SOCKET_API(float, contrast)
1162 };
1163 
1165  public:
1167  void constant_fold(const ConstantFolder &folder);
1168 
1171 };
1172 
1173 class SeparateRGBNode : public ShaderNode {
1174  public:
1176  void constant_fold(const ConstantFolder &folder);
1177 
1179 };
1180 
1181 class SeparateHSVNode : public ShaderNode {
1182  public:
1184  void constant_fold(const ConstantFolder &folder);
1185 
1187 };
1188 
1189 class SeparateXYZNode : public ShaderNode {
1190  public:
1192  void constant_fold(const ConstantFolder &folder);
1193 
1195 };
1196 
1197 class HSVNode : public ShaderNode {
1198  public:
1200 
1201  NODE_SOCKET_API(float, hue)
1202  NODE_SOCKET_API(float, saturation)
1203  NODE_SOCKET_API(float, value)
1204  NODE_SOCKET_API(float, fac)
1206 };
1207 
1208 class AttributeNode : public ShaderNode {
1209  public:
1213  {
1214  return true;
1215  }
1217  {
1218  return true;
1219  }
1220 
1221  NODE_SOCKET_API(ustring, attribute)
1222 };
1223 
1224 class CameraNode : public ShaderNode {
1225  public:
1228  {
1229  return true;
1230  }
1231 };
1232 
1233 class FresnelNode : public ShaderNode {
1234  public:
1237  {
1238  return true;
1239  }
1240 
1242  NODE_SOCKET_API(float, IOR)
1243 };
1244 
1245 class LayerWeightNode : public ShaderNode {
1246  public:
1249  {
1250  return true;
1251  }
1252 
1254  NODE_SOCKET_API(float, blend)
1255 };
1256 
1257 class WireframeNode : public ShaderNode {
1258  public:
1261  {
1262  return true;
1263  }
1264 
1265  NODE_SOCKET_API(float, size)
1266  NODE_SOCKET_API(bool, use_pixel_size)
1267 };
1268 
1269 class WavelengthNode : public ShaderNode {
1270  public:
1272 
1273  NODE_SOCKET_API(float, wavelength)
1274 };
1275 
1276 class BlackbodyNode : public ShaderNode {
1277  public:
1279  void constant_fold(const ConstantFolder &folder);
1280 
1281  NODE_SOCKET_API(float, temperature)
1282 };
1283 
1285  public:
1287  void expand(ShaderGraph *graph);
1288 
1290  NODE_SOCKET_API(float3, from_min)
1291  NODE_SOCKET_API(float3, from_max)
1292  NODE_SOCKET_API(float3, to_min)
1293  NODE_SOCKET_API(float3, to_max)
1295  NODE_SOCKET_API(NodeMapRangeType, range_type)
1296  NODE_SOCKET_API(bool, use_clamp)
1297 };
1298 
1299 class MapRangeNode : public ShaderNode {
1300  public:
1302  void expand(ShaderGraph *graph);
1303 
1304  NODE_SOCKET_API(float, value)
1305  NODE_SOCKET_API(float, from_min)
1306  NODE_SOCKET_API(float, from_max)
1307  NODE_SOCKET_API(float, to_min)
1308  NODE_SOCKET_API(float, to_max)
1309  NODE_SOCKET_API(float, steps)
1310  NODE_SOCKET_API(NodeMapRangeType, range_type)
1311  NODE_SOCKET_API(bool, clamp)
1312 };
1313 
1314 class ClampNode : public ShaderNode {
1315  public:
1317  void constant_fold(const ConstantFolder &folder);
1318  NODE_SOCKET_API(float, value)
1319  NODE_SOCKET_API(float, min)
1320  NODE_SOCKET_API(float, max)
1321  NODE_SOCKET_API(NodeClampType, clamp_type)
1322 };
1323 
1324 class MathNode : public ShaderNode {
1325  public:
1327  void expand(ShaderGraph *graph);
1328  void constant_fold(const ConstantFolder &folder);
1329 
1330  NODE_SOCKET_API(float, value1)
1331  NODE_SOCKET_API(float, value2)
1332  NODE_SOCKET_API(float, value3)
1333  NODE_SOCKET_API(NodeMathType, math_type)
1334  NODE_SOCKET_API(bool, use_clamp)
1335 };
1336 
1337 class NormalNode : public ShaderNode {
1338  public:
1340 
1341  NODE_SOCKET_API(float3, direction)
1343 };
1344 
1345 class VectorMathNode : public ShaderNode {
1346  public:
1348  void constant_fold(const ConstantFolder &folder);
1349 
1350  NODE_SOCKET_API(float3, vector1)
1351  NODE_SOCKET_API(float3, vector2)
1353  NODE_SOCKET_API(float, scale)
1355 };
1356 
1358  public:
1360 
1362  NODE_SOCKET_API(bool, invert)
1365  NODE_SOCKET_API(float3, axis)
1366  NODE_SOCKET_API(float, angle)
1367  NODE_SOCKET_API(float3, rotation)
1368 };
1369 
1371  public:
1373 
1374  NODE_SOCKET_API(NodeVectorTransformType, transform_type)
1378 };
1379 
1380 class BumpNode : public ShaderNode {
1381  public:
1383  void constant_fold(const ConstantFolder &folder);
1385  {
1386  return true;
1387  }
1388  virtual int get_feature()
1389  {
1390  return KERNEL_FEATURE_NODE_BUMP;
1391  }
1392 
1393  NODE_SOCKET_API(bool, invert)
1394  NODE_SOCKET_API(bool, use_object_space)
1395  NODE_SOCKET_API(float, height)
1396  NODE_SOCKET_API(float, sample_center)
1397  NODE_SOCKET_API(float, sample_x)
1398  NODE_SOCKET_API(float, sample_y)
1400  NODE_SOCKET_API(float, strength)
1401  NODE_SOCKET_API(float, distance)
1402 };
1403 
1404 class CurvesNode : public ShaderNode {
1405  public:
1406  explicit CurvesNode(const NodeType *node_type);
1408 
1410  NODE_SOCKET_API(float, min_x)
1411  NODE_SOCKET_API(float, max_x)
1412  NODE_SOCKET_API(float, fac)
1413  NODE_SOCKET_API(float3, value)
1414  NODE_SOCKET_API(bool, extrapolate)
1415 
1416  protected:
1418  void constant_fold(const ConstantFolder &folder, ShaderInput *value_in);
1419  void compile(SVMCompiler &compiler, int type, ShaderInput *value_in, ShaderOutput *value_out);
1420  void compile(OSLCompiler &compiler, const char *name);
1421 };
1422 
1423 class RGBCurvesNode : public CurvesNode {
1424  public:
1426  void constant_fold(const ConstantFolder &folder);
1427 };
1428 
1430  public:
1432  void constant_fold(const ConstantFolder &folder);
1433 };
1434 
1435 class FloatCurveNode : public ShaderNode {
1436  public:
1438  void constant_fold(const ConstantFolder &folder);
1439 
1441  NODE_SOCKET_API(float, min_x)
1442  NODE_SOCKET_API(float, max_x)
1443  NODE_SOCKET_API(float, fac)
1444  NODE_SOCKET_API(float, value)
1445  NODE_SOCKET_API(bool, extrapolate)
1446 };
1447 
1448 class RGBRampNode : public ShaderNode {
1449  public:
1451  void constant_fold(const ConstantFolder &folder);
1452 
1454  NODE_SOCKET_API_ARRAY(array<float>, ramp_alpha)
1455  NODE_SOCKET_API(float, fac)
1457 };
1458 
1459 class SetNormalNode : public ShaderNode {
1460  public:
1462  NODE_SOCKET_API(float3, direction)
1463 };
1464 
1465 class OSLNode final : public ShaderNode {
1466  public:
1467  static OSLNode *create(ShaderGraph *graph, size_t num_inputs, const OSLNode *from = NULL);
1468  ~OSLNode();
1469 
1470  static void operator delete(void *ptr)
1471  {
1472  /* Override delete operator to silence new-delete-type-mismatch ASAN warnings
1473  * regarding size mismatch in the destructor. This is intentional as we allocate
1474  * extra space at the end of the node. */
1475  ::operator delete(ptr);
1476  }
1477  static void operator delete(void *, void *)
1478  {
1479  /* Deliberately empty placement delete operator, to avoid MSVC warning C4291. */
1480  }
1481 
1482  ShaderNode *clone(ShaderGraph *graph) const;
1483 
1484  char *input_default_value();
1485  void add_input(ustring name, SocketType::Type type);
1486  void add_output(ustring name, SocketType::Type type);
1487 
1489 
1490  /* Ideally we could better detect this, but we can't query this now. */
1492  {
1493  return true;
1494  }
1496  {
1497  return true;
1498  }
1499 
1500  virtual bool equals(const ShaderNode & /*other*/)
1501  {
1502  return false;
1503  }
1504 
1505  string filepath;
1507 };
1508 
1509 class NormalMapNode : public ShaderNode {
1510  public:
1514  {
1515  return true;
1516  }
1518  {
1519  return true;
1520  }
1521 
1523  NODE_SOCKET_API(ustring, attribute)
1524  NODE_SOCKET_API(float, strength)
1526  NODE_SOCKET_API(float3, normal_osl)
1527 };
1528 
1529 class TangentNode : public ShaderNode {
1530  public:
1534  {
1535  return true;
1536  }
1538  {
1539  return true;
1540  }
1541 
1542  NODE_SOCKET_API(NodeTangentDirectionType, direction_type)
1544  NODE_SOCKET_API(ustring, attribute)
1545  NODE_SOCKET_API(float3, normal_osl)
1546 };
1547 
1548 class BevelNode : public ShaderNode {
1549  public:
1552  {
1553  return true;
1554  }
1555  virtual int get_feature()
1556  {
1558  }
1559 
1560  NODE_SOCKET_API(float, radius)
1562  NODE_SOCKET_API(int, samples)
1563 };
1564 
1566  public:
1568  void constant_fold(const ConstantFolder &folder);
1569  virtual int get_feature()
1570  {
1571  return KERNEL_FEATURE_NODE_BUMP;
1572  }
1573 
1575  NODE_SOCKET_API(float, height)
1576  NODE_SOCKET_API(float, midlevel)
1577  NODE_SOCKET_API(float, scale)
1579 };
1580 
1582  public:
1586  {
1587  return true;
1588  }
1589  void constant_fold(const ConstantFolder &folder);
1590  virtual int get_feature()
1591  {
1592  return KERNEL_FEATURE_NODE_BUMP;
1593  }
1594 
1596  NODE_SOCKET_API(ustring, attribute)
1598  NODE_SOCKET_API(float, midlevel)
1599  NODE_SOCKET_API(float, scale)
1600 };
1601 
1603 
1604 #endif /* __NODES_H__ */
#define final(a, b, c)
Definition: BLI_hash.h:21
static uint8 component(Color32 c, uint i)
Definition: ColorBlock.cpp:108
NSNotificationCenter * center
_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
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_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 y
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 producing a negative Combine Generate a color from its and blue Hue Saturation Apply a color transformation in the HSV color model Specular Similar to the Principled BSDF node but uses the specular workflow instead of metallic
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 curves
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 hue
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 saturation
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 attribute
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 * v
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition: btDbvt.cpp:52
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition: btQuadWord.h:119
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
Definition: btVector3.h:356
void constant_fold(const ConstantFolder &folder)
virtual int get_feature()
Definition: shader_nodes.h:761
bool has_attribute_dependency()
Definition: shader_nodes.h:511
ClosureType get_closure_type()
Definition: shader_nodes.h:506
void attributes(Shader *shader, AttributeRequestSet *attributes)
bool has_spatial_varying()
void attributes(Shader *shader, AttributeRequestSet *attributes)
bool has_attribute_dependency()
void constant_fold(const ConstantFolder &folder)
virtual int get_feature()
Definition: shader_nodes.h:731
virtual int get_feature()
bool has_spatial_varying()
void constant_fold(const ConstantFolder &folder)
void constant_fold(const ConstantFolder &folder)
virtual bool equals(const ShaderNode &)
Definition: shader_nodes.h:465
virtual bool has_bump()
virtual int get_feature()
Definition: shader_nodes.h:471
ClosureType closure
Definition: shader_nodes.h:477
virtual ClosureType get_closure_type()
Definition: shader_nodes.h:459
BsdfBaseNode(const NodeType *node_type)
bool has_spatial_varying()
Definition: shader_nodes.h:455
BsdfNode(const NodeType *node_type)
void compile(SVMCompiler &compiler, ShaderInput *param1, ShaderInput *param2, ShaderInput *param3=NULL, ShaderInput *param4=NULL)
virtual int get_feature()
void constant_fold(const ConstantFolder &folder)
bool has_spatial_varying()
bool has_spatial_varying()
void constant_fold(const ConstantFolder &folder)
void constant_fold(const ConstantFolder &folder)
void constant_fold(const ConstantFolder &folder)
void constant_fold(const ConstantFolder &folder)
void constant_fold(const ConstantFolder &folder)
void constant_fold(const ConstantFolder &folder)
void constant_fold(const ConstantFolder &folder)
float value_float
Definition: shader_nodes.h:435
float3 value_point
Definition: shader_nodes.h:439
float3 value_normal
Definition: shader_nodes.h:440
float3 value_vector
Definition: shader_nodes.h:438
ConvertNode(SocketType::Type from, SocketType::Type to, bool autoconvert=false)
float3 value_color
Definition: shader_nodes.h:437
CurvesNode(const NodeType *node_type)
virtual void constant_fold(const ConstantFolder &)
Definition: shader_graph.h:169
void compile(SVMCompiler &compiler, int type, ShaderInput *value_in, ShaderOutput *value_out)
virtual int get_feature()
void constant_fold(const ConstantFolder &folder)
void constant_fold(const ConstantFolder &folder)
bool has_surface_emission()
Definition: shader_nodes.h:707
bool has_volume_support()
Definition: shader_nodes.h:711
virtual int get_feature()
Definition: shader_nodes.h:716
ImageParams image_params() const
virtual bool equals(const ShaderNode &other)
Definition: shader_nodes.h:134
ShaderNode * clone(ShaderGraph *graph) const
void attributes(Shader *shader, AttributeRequestSet *attributes)
void constant_fold(const ConstantFolder &folder)
bool has_spatial_varying()
void constant_fold(const ConstantFolder &folder)
bool has_spatial_varying()
Definition: shader_nodes.h:905
bool has_attribute_dependency()
Definition: shader_nodes.h:901
void attributes(Shader *shader, AttributeRequestSet *attributes)
ClosureType get_closure_type()
Definition: shader_nodes.h:639
void simplify_settings(Scene *scene)
bool has_integrator_dependency()
bool has_integrator_dependency()
void simplify_settings(Scene *scene)
ClosureType get_closure_type()
Definition: shader_nodes.h:620
ClosureType get_closure_type()
Definition: shader_nodes.h:885
void attributes(Shader *shader, AttributeRequestSet *attributes)
bool has_attribute_dependency()
Definition: shader_nodes.h:987
bool has_spatial_varying()
Definition: shader_nodes.h:991
virtual ClosureType get_closure_type()
Definition: shader_nodes.h:744
ShaderNode * clone(ShaderGraph *graph) const
ImageHandle handle
Definition: shader_nodes.h:87
ImageSlotTextureNode(const NodeType *node_type)
Definition: shader_nodes.h:76
virtual bool equals(const ShaderNode &other)
Definition: shader_nodes.h:81
ImageParams image_params() const
void attributes(Shader *shader, AttributeRequestSet *attributes)
void cull_tiles(Scene *scene, ShaderGraph *graph)
bool has_attribute_dependency()
Definition: shader_nodes.h:95
virtual bool equals(const ShaderNode &other)
Definition: shader_nodes.h:100
ShaderNode * clone(ShaderGraph *graph) const
void constant_fold(const ConstantFolder &folder)
bool has_spatial_varying()
bool has_spatial_varying()
Definition: shader_nodes.h:958
void expand(ShaderGraph *graph)
void constant_fold(const ConstantFolder &folder)
void constant_fold(const ConstantFolder &folder)
void expand(ShaderGraph *graph)
void constant_fold(const ConstantFolder &folder)
void constant_fold(const ConstantFolder &folder)
void attributes(Shader *shader, AttributeRequestSet *attributes)
bool has_attribute_dependency()
bool has_spatial_varying()
string bytecode_hash
virtual bool equals(const ShaderNode &)
static OSLNode * create(ShaderGraph *graph, size_t num_inputs, const OSLNode *from=NULL)
bool has_volume_support()
ShaderNode * clone(ShaderGraph *graph) const
void add_output(ustring name, SocketType::Type type)
bool has_spatial_varying()
char * input_default_value()
string filepath
void add_input(ustring name, SocketType::Type type)
virtual void simplify_settings(Scene *scene)
virtual bool equals(const ShaderNode &)
Definition: shader_nodes.h:206
virtual bool equals(const ShaderNode &)
Definition: shader_nodes.h:189
bool has_attribute_dependency()
Definition: shader_nodes.h:976
void attributes(Shader *shader, AttributeRequestSet *attributes)
ImageParams image_params() const
virtual bool equals(const ShaderNode &other)
Definition: shader_nodes.h:367
ShaderNode * clone(ShaderGraph *graph) const
void attributes(Shader *shader, AttributeRequestSet *attributes)
bool has_spatial_varying()
void attributes(Shader *shader, AttributeRequestSet *attributes)
bool has_attribute_dependency()
bool has_attribute_dependency()
Definition: shader_nodes.h:586
bool has_integrator_dependency()
void expand(ShaderGraph *graph)
void attributes(Shader *shader, AttributeRequestSet *attributes)
void compile(SVMCompiler &compiler, ShaderInput *metallic, ShaderInput *subsurface, ShaderInput *subsurface_radius, ShaderInput *subsurface_ior, ShaderInput *subsurface_anisotropy, ShaderInput *specular, ShaderInput *roughness, ShaderInput *specular_tint, ShaderInput *anisotropic, ShaderInput *sheen, ShaderInput *sheen_tint, ShaderInput *clearcoat, ShaderInput *clearcoat_roughness, ShaderInput *ior, ShaderInput *transmission, ShaderInput *anisotropic_rotation, ShaderInput *transmission_roughness)
void attributes(Shader *shader, AttributeRequestSet *attributes)
bool has_attribute_dependency()
Definition: shader_nodes.h:825
void attributes(Shader *shader, AttributeRequestSet *attributes)
void constant_fold(const ConstantFolder &folder)
void constant_fold(const ConstantFolder &folder)
bool has_integrator_dependency()
void simplify_settings(Scene *scene)
ClosureType get_closure_type()
Definition: shader_nodes.h:659
void constant_fold(const ConstantFolder &folder)
void constant_fold(const ConstantFolder &folder)
void constant_fold(const ConstantFolder &folder)
void constant_fold(const ConstantFolder &folder)
ShaderNodeSpecialType special_type
Definition: shader_graph.h:220
virtual bool equals(const ShaderNode &other)
virtual int get_feature()
Definition: shader_graph.h:232
virtual void constant_fold(const ConstantFolder &)
Definition: shader_graph.h:169
float get_sun_size()
Definition: shader_nodes.h:172
ImageHandle handle
Definition: shader_nodes.h:170
ClosureType get_closure_type()
Definition: shader_nodes.h:690
bool has_attribute_dependency()
void attributes(Shader *shader, AttributeRequestSet *attributes)
bool has_spatial_varying()
void attributes(Shader *shader, AttributeRequestSet *attributes)
int compile(SVMCompiler &compiler, ShaderInput *vector_in)
void compile_end(SVMCompiler &compiler, ShaderInput *vector_in, int vector_offset)
Transform compute_transform()
Projection projection
Definition: shader_nodes.h:49
Mapping x_mapping
Definition: shader_nodes.h:46
Mapping z_mapping
Definition: shader_nodes.h:46
void compile(SVMCompiler &compiler, int offset_in, int offset_out)
Mapping y_mapping
Definition: shader_nodes.h:46
int compile_begin(SVMCompiler &compiler, ShaderInput *vector_in)
float3 translation
Definition: shader_nodes.h:35
TextureMapping tex_mapping
Definition: shader_nodes.h:59
TextureNode(const NodeType *node_type)
Definition: shader_nodes.h:56
bool has_surface_transparent()
Definition: shader_nodes.h:601
void attributes(Shader *shader, AttributeRequestSet *attributes)
bool has_attribute_dependency()
Definition: shader_nodes.h:937
bool has_spatial_varying()
Definition: shader_nodes.h:941
void constant_fold(const ConstantFolder &folder)
virtual int get_feature()
void constant_fold(const ConstantFolder &folder)
void attributes(Shader *shader, AttributeRequestSet *attributes)
void expand(ShaderGraph *graph)
void constant_fold(const ConstantFolder &folder)
bool has_spatial_varying()
void attributes(Shader *shader, AttributeRequestSet *attributes)
bool has_attribute_dependency()
bool has_spatial_varying()
void expand(ShaderGraph *graph)
bool has_attribute_dependency()
void attributes(Shader *shader, AttributeRequestSet *attributes)
void compile(SVMCompiler &compiler, ShaderInput *param1, ShaderInput *param2)
ClosureType closure
Definition: shader_nodes.h:799
virtual bool has_volume_support()
Definition: shader_nodes.h:789
virtual int get_feature()
Definition: shader_nodes.h:781
virtual ClosureType get_closure_type()
Definition: shader_nodes.h:785
VolumeNode(const NodeType *node_type)
virtual bool equals(const ShaderNode &)
Definition: shader_nodes.h:802
virtual int get_feature()
Definition: shader_nodes.h:240
bool has_spatial_varying()
#define CCL_NAMESPACE_END
Definition: cuda/compat.h:9
Depsgraph * graph
StackEntry * from
Scene scene
Curve curve
struct @211::@212 surface
IMETHOD void random(Vector &a)
addDelta operator for displacement rotational velocity.
Definition: frames.inl:1282
#define NODE_SOCKET_API_STRUCT_MEMBER(type_, name, member)
Definition: graph/node.h:75
#define NODE_SOCKET_API_ARRAY(type_, name)
Definition: graph/node.h:62
#define NODE_SOCKET_API(type_, name)
Definition: graph/node.h:54
IconTextureDrawCall normal
CCL_NAMESPACE_BEGIN ccl_device float invert(float color, float factor)
Definition: invert.h:8
ccl_gpu_kernel_postfix ccl_global KernelWorkTile * tiles
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
NodeClampType
NodeEnvironmentProjection
NodeMathType
NodeMusgraveType
NodeMapRangeType
NodeWaveBandsDirection
NodeMappingType
NodeVectorTransformConvertSpace
NodeTangentAxis
NodePrincipledHairParametrization
NodeVoronoiFeature
@ NODE_VORONOI_SMOOTH_F1
NodeWaveType
NodeVoronoiDistanceMetric
NodeSkyType
NodeWaveProfile
NodeTexVoxelSpace
ClosureType
@ CLOSURE_HOLDOUT_ID
NodeVectorRotateType
NodeVectorTransformType
NodeImageProjection
NodeCombSepColorType
NodeGradientType
NodeTangentDirectionType
NodeVectorMathType
NodeWaveRingsDirection
NodeNormalMapSpace
@ KERNEL_FEATURE_NODE_VOLUME
@ KERNEL_FEATURE_NODE_EMISSION
@ KERNEL_FEATURE_NODE_BSDF
@ KERNEL_FEATURE_NODE_BUMP
@ KERNEL_FEATURE_NODE_VORONOI_EXTRA
@ KERNEL_FEATURE_NODE_RAYTRACE
#define fmaxf(x, y)
Definition: metal/compat.h:228
void interpolate(const Span< T > src, const Span< int > indices, const Span< float > factors, MutableSpan< T > dst)
T clamp(const T &a, const T &min, const T &max)
T distance(const T &a, const T &b)
static const pxr::TfToken clearcoat("clearcoat", pxr::TfToken::Immortal)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
static const pxr::TfToken ior("ior", pxr::TfToken::Immortal)
static const pxr::TfToken g("g", pxr::TfToken::Immortal)
static const pxr::TfToken density("density", pxr::TfToken::Immortal)
static const pxr::TfToken roughness("roughness", pxr::TfToken::Immortal)
static const pxr::TfToken specular("specular", pxr::TfToken::Immortal)
smooth(Type::FLOAT, "mask_weight")
#define SHADER_NODE_NO_CLONE_CLASS(type)
Definition: shader_graph.h:267
@ SHADER_SPECIAL_TYPE_IMAGE_SLOT
Definition: shader_graph.h:52
#define SHADER_NODE_CLASS(type)
Definition: shader_graph.h:257
#define SHADER_NODE_BASE_CLASS(type)
Definition: shader_graph.h:273
static const int steps
Definition: sky_nishita.cpp:19
#define min(a, b)
Definition: sort.c:35
const NodeType * type
Definition: graph/node.h:175
ustring name
Definition: graph/node.h:174
static int blend(const Tex *tex, const float texvec[3], TexResult *texres)
float max
ImageAlphaType
Definition: util/texture.h:48
InterpolationType
Definition: util/texture.h:19
ExtensionType
Definition: util/texture.h:61
PointerRNA * ptr
Definition: wm_files.c:3480