Blender V5.3
NOD_socket_declarations.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
8
9#pragma once
10
11#include <cfloat>
12#include <climits>
13
14#include "NOD_bundle_type.hh"
15#include "NOD_menu_value.hh"
17
18#include "RNA_types.hh"
19
20#include "BKE_node_enum.hh"
21
22#include "BLI_color_types.hh"
26
27namespace blender::nodes {
29}
30
31namespace blender::nodes::decl {
32
33class FloatBuilder;
34
35class Float : public SocketDeclaration {
36 public:
38
39 float default_value = 0.0f;
43
45
47
48 bNodeSocket &build(bNodeTree &ntree, bNode &node) const override;
49 bool matches(const bNodeSocket &socket) const override;
50 bNodeSocket &update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override;
51 bool can_connect(const bNodeSocket &socket) const override;
52};
53
55 public:
56 FloatBuilder &min(float value);
57 FloatBuilder &max(float value);
58 FloatBuilder &default_value(float value);
60 FloatBuilder &try_copy_ui_data(const SocketDeclaration &other_decl) override;
61};
62
63class IntBuilder;
64
65class Int : public SocketDeclaration {
66 public:
68
73
74 friend IntBuilder;
75
77
78 bNodeSocket &build(bNodeTree &ntree, bNode &node) const override;
79 bool matches(const bNodeSocket &socket) const override;
80 bNodeSocket &update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override;
81 bool can_connect(const bNodeSocket &socket) const override;
82};
83
85 public:
86 IntBuilder &min(int value);
87 IntBuilder &max(int value);
88 IntBuilder &default_value(int value);
90 IntBuilder &try_copy_ui_data(const SocketDeclaration &other_decl) override;
91};
92
93class VectorBuilder;
94
95class Vector : public SocketDeclaration {
96 public:
98
99 float4 default_value = {0, 0, 0, 0};
102 int dimensions = 3;
104
106
108
109 bNodeSocket &build(bNodeTree &ntree, bNode &node) const override;
110 bool matches(const bNodeSocket &socket) const override;
111 bNodeSocket &update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override;
112 bool can_connect(const bNodeSocket &socket) const override;
113};
114
116 public:
117 VectorBuilder &default_value(const float2 value);
118 VectorBuilder &default_value(const float3 value);
119 VectorBuilder &default_value(const float4 value);
122 VectorBuilder &min(float min);
123 VectorBuilder &max(float max);
125 VectorBuilder &try_copy_ui_data(const SocketDeclaration &other_decl) override;
126};
127
128class IntVectorBuilder;
129
131 public:
133
134 int3 default_value = {0, 0, 0};
135 int soft_min_value = INT_MIN;
137 int dimensions = 3;
139
141
143
144 bNodeSocket &build(bNodeTree &ntree, bNode &node) const override;
145 bool matches(const bNodeSocket &socket) const override;
146 bNodeSocket &update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override;
147 bool can_connect(const bNodeSocket &socket) const override;
148};
149
160
161class BoolBuilder;
162
163class Bool : public SocketDeclaration {
164 public:
166
167 bool default_value = false;
169
171
172 bNodeSocket &build(bNodeTree &ntree, bNode &node) const override;
173 bool matches(const bNodeSocket &socket) const override;
174 bNodeSocket &update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override;
175 bool can_connect(const bNodeSocket &socket) const override;
176};
177
179 public:
180 BoolBuilder &default_value(bool value);
181 BoolBuilder &try_copy_ui_data(const SocketDeclaration &other_decl) override;
182};
183
184class ColorBuilder;
185
186class Color : public SocketDeclaration {
187 public:
189
190 ColorGeometry4f default_value{0.8f, 0.8f, 0.8f, 1.0f};
191
193
195
196 bNodeSocket &build(bNodeTree &ntree, bNode &node) const override;
197 bool matches(const bNodeSocket &socket) const override;
198 bNodeSocket &update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override;
199 bool can_connect(const bNodeSocket &socket) const override;
200};
201
203 public:
205 ColorBuilder &try_copy_ui_data(const SocketDeclaration &other_decl) override;
206};
207
208class RotationBuilder;
209
211 public:
213
215
217
219
220 bNodeSocket &build(bNodeTree &ntree, bNode &node) const override;
221 bool matches(const bNodeSocket &socket) const override;
222 bNodeSocket &update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override;
223 bool can_connect(const bNodeSocket &socket) const override;
224};
225
227 public:
229 RotationBuilder &try_copy_ui_data(const SocketDeclaration &other_decl) override;
230};
231
232class MatrixBuilder;
233
234class Matrix : public SocketDeclaration {
235 public:
237
239
241
242 bNodeSocket &build(bNodeTree &ntree, bNode &node) const override;
243 bool matches(const bNodeSocket &socket) const override;
244 bNodeSocket &update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override;
245 bool can_connect(const bNodeSocket &socket) const override;
246};
247
248class MatrixBuilder : public SocketDeclarationBuilder<Matrix> {};
249
250class StringBuilder;
251
252class String : public SocketDeclaration {
253 public:
255
256 std::string default_value;
258 std::optional<std::string> path_filter;
259
261
263
264 bNodeSocket &build(bNodeTree &ntree, bNode &node) const override;
265 bool matches(const bNodeSocket &socket) const override;
266 bNodeSocket &update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override;
267 bool can_connect(const bNodeSocket &socket) const override;
268};
269
271 public:
272 StringBuilder &default_value(const std::string value);
274 StringBuilder &path_filter(std::optional<std::string> filter);
275 StringBuilder &try_copy_ui_data(const SocketDeclaration &other_decl) override;
276};
277
278class MenuBuilder;
279
280class Menu : public SocketDeclaration {
281 public:
283
285 bool is_expanded = false;
287
289
291
292 bNodeSocket &build(bNodeTree &ntree, bNode &node) const override;
293 bool matches(const bNodeSocket &socket) const override;
294 bNodeSocket &update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override;
295 bool can_connect(const bNodeSocket &socket) const override;
296};
297
299 public:
301
303 MenuBuilder &expanded(bool value = true);
304
305 using StaticItemFilterFn = bool (*)(const EnumPropertyItem &item);
308 const StaticItemFilterFn filter_fn = nullptr);
309};
310
311class BundleBuilder;
312
313class Bundle : public SocketDeclaration {
314 public:
320 std::optional<int> pass_through_input_index;
321
322 std::optional<BundleType> bundle_type;
323
325
327
328 bNodeSocket &build(bNodeTree &ntree, bNode &node) const override;
329 bool matches(const bNodeSocket &socket) const override;
330 bNodeSocket &update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override;
331 bool can_connect(const bNodeSocket &socket) const override;
332};
333
335 public:
337
339 BundleBuilder &pass_through_input_index(std::optional<int> index);
340};
341
342class ClosureBuilder;
343
345 public:
346 std::unique_ptr<std::function<ClosureSignature(const bNode &)>> create_signature;
347
349 ~Closure() override;
350
352
354
356
357 bNodeSocket &build(bNodeTree &ntree, bNode &node) const override;
358 bool matches(const bNodeSocket &socket) const override;
359 bNodeSocket &update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override;
360 bool can_connect(const bNodeSocket &socket) const override;
361};
362
364 public:
365 void create_signature(std::function<ClosureSignature(const bNode &)> create_signature);
366};
367
369 public:
370 const char *idname;
376 std::function<ID *(const bNode &node)> default_value_fn;
377
378 IDSocketDeclaration(const char *idname);
379
380 bNodeSocket &build(bNodeTree &ntree, bNode &node) const override;
381 bool matches(const bNodeSocket &socket) const override;
382 bNodeSocket &update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override;
383 bool can_connect(const bNodeSocket &socket) const override;
384};
385
386template<typename T> class IDSocketDeclarationBuilder : public SocketDeclarationBuilder<T> {
387 public:
389 {
390 this->decl_->default_value_fn = std::move(fn);
391 return *this;
392 }
393};
394
403
412
421
430
432 public:
434
436
437 Image();
438};
439
440class Font : public IDSocketDeclaration {
441 public:
443
445
446 Font();
447};
448
450 public:
452
454
455 Scene();
456};
457
458class Text : public IDSocketDeclaration {
459 public:
461
463
464 Text();
465};
466
467class Mask : public IDSocketDeclaration {
468 public:
470
472
473 Mask();
474};
475
477 public:
479
481
482 Sound();
483};
484
485class ShaderBuilder;
486
487class Shader : public SocketDeclaration {
488 public:
490
492
494
495 bNodeSocket &build(bNodeTree &ntree, bNode &node) const override;
496 bool matches(const bNodeSocket &socket) const override;
497 bool can_connect(const bNodeSocket &socket) const override;
498};
499
500class ShaderBuilder : public SocketDeclarationBuilder<Shader> {};
501
502class ExtendBuilder;
503
504class Extend : public SocketDeclaration {
505 private:
506 friend ExtendBuilder;
507
508 public:
510
511 using Builder = ExtendBuilder;
512
513 bNodeSocket &build(bNodeTree &ntree, bNode &node) const override;
514 bool matches(const bNodeSocket &socket) const override;
515 bNodeSocket &update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override;
516 bool can_connect(const bNodeSocket &socket) const override;
517};
518
519class ExtendBuilder : public SocketDeclarationBuilder<Extend> {};
520
522
523class Custom : public SocketDeclaration {
524 public:
526
528
530
531 const char *idname_;
532 std::function<void(bNode &node, bNodeSocket &socket, const char *data_path)> init_socket_fn;
533
534 bNodeSocket &build(bNodeTree &ntree, bNode &node) const override;
535 bool matches(const bNodeSocket &socket) const override;
536 bNodeSocket &update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override;
537 bool can_connect(const bNodeSocket &socket) const override;
538};
539
541 public:
542 CustomTypeBuilder &idname(const char *idname);
543
545 std::function<void(bNode &node, bNodeSocket &socket, const char *data_path)> fn)
546 {
547 decl_->init_socket_fn = std::move(fn);
548 return *this;
549 }
550};
551
552/* -------------------------------------------------------------------- */
555
556inline FloatBuilder &FloatBuilder::min(const float value)
557{
558 decl_->soft_min_value = value;
559 return *this;
560}
561
562inline FloatBuilder &FloatBuilder::max(const float value)
563{
564 decl_->soft_max_value = value;
565 return *this;
566}
567
569{
570 decl_->default_value = value;
571 return *this;
572}
573
575{
576 decl_->subtype = subtype;
577 return *this;
578}
579
581
582/* -------------------------------------------------------------------- */
585
586inline IntBuilder &IntBuilder::min(const int value)
587{
588 decl_->soft_min_value = value;
589 return *this;
590}
591
592inline IntBuilder &IntBuilder::max(const int value)
593{
594 decl_->soft_max_value = value;
595 return *this;
596}
597
598inline IntBuilder &IntBuilder::default_value(const int value)
599{
600 decl_->default_value = value;
601 return *this;
602}
603
605{
606 decl_->subtype = subtype;
607 return *this;
608}
609
611
612/* -------------------------------------------------------------------- */
615
617{
618 decl_->default_value = float4(value, 0.0f, 0.0f);
619 return *this;
620}
621
623{
624 decl_->default_value = float4(value, 0.0f);
625 return *this;
626}
627
629{
630 decl_->default_value = value;
631 return *this;
632}
633
635{
636 decl_->subtype = subtype;
637 return *this;
638}
639
641{
642 BLI_assert(dimensions >= 2 && dimensions <= 4);
643 decl_->dimensions = dimensions;
644 return *this;
645}
646
648{
649 decl_->soft_min_value = min;
650 return *this;
651}
652
654{
655 decl_->soft_max_value = max;
656 return *this;
657}
658
660{
661 decl_->compact = true;
662 return *this;
663}
664
666
667/* -------------------------------------------------------------------- */
670
672{
673 decl_->default_value = int3(value, 0);
674 return *this;
675}
676
678{
679 decl_->default_value = value;
680 return *this;
681}
682
684{
685 decl_->subtype = subtype;
686 return *this;
687}
688
690{
691 BLI_assert(dimensions >= 2 && dimensions <= 3);
692 decl_->dimensions = dimensions;
693 return *this;
694}
695
697{
698 decl_->soft_min_value = min;
699 return *this;
700}
701
703{
704 decl_->soft_max_value = max;
705 return *this;
706}
707
709{
710 decl_->compact = true;
711 return *this;
712}
713
715
716/* -------------------------------------------------------------------- */
719
721{
722 decl_->default_value = value;
723 return *this;
724}
725
727
728/* -------------------------------------------------------------------- */
731
733{
734 decl_->default_value = value;
735 return *this;
736}
737
739
740/* -------------------------------------------------------------------- */
743
745{
746 decl_->default_value = std::move(value);
747 return *this;
748}
749
751{
752 decl_->subtype = subtype;
753 return *this;
754}
755
757
758/* -------------------------------------------------------------------- */
761
763{
764 decl_->default_value = value;
765 return *this;
766}
767
768inline MenuBuilder &MenuBuilder::expanded(const bool value)
769{
770 decl_->is_expanded = value;
771 return *this;
772}
773
775
776/* -------------------------------------------------------------------- */
779
781{
782 decl_->default_value = value;
783 return *this;
784}
785
787
788/* -------------------------------------------------------------------- */
791
793
794inline Object::Object() : IDSocketDeclaration("NodeSocketObject") {}
795
796inline Material::Material() : IDSocketDeclaration("NodeSocketMaterial") {}
797
798inline Collection::Collection() : IDSocketDeclaration("NodeSocketCollection") {}
799
800inline Texture::Texture() : IDSocketDeclaration("NodeSocketTexture") {}
801
802inline Image::Image() : IDSocketDeclaration("NodeSocketImage") {}
803
804inline Font::Font() : IDSocketDeclaration("NodeSocketFont") {}
805
806inline Scene::Scene() : IDSocketDeclaration("NodeSocketScene") {}
807
808inline Text::Text() : IDSocketDeclaration("NodeSocketText") {}
809
810inline Mask::Mask() : IDSocketDeclaration("NodeSocketMask") {}
811
812inline Sound::Sound() : IDSocketDeclaration("NodeSocketSound") {}
813
815
816/* -------------------------------------------------------------------- */
819
821{
822 decl_->idname_ = idname;
823 return *this;
824}
825
827
828} // namespace blender::nodes::decl
#define INT32_MAX
#define INT32_MIN
BoolBuilder & try_copy_ui_data(const SocketDeclaration &other_decl) override
bNodeSocket & build(bNodeTree &ntree, bNode &node) const override
bool matches(const bNodeSocket &socket) const override
static constexpr eNodeSocketDatatype static_socket_type
bNodeSocket & update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override
bool can_connect(const bNodeSocket &socket) const override
BundleBuilder & pass_through_input_index(std::optional< int > index)
BundleBuilder & bundle_type(BundleType bundle_type)
bNodeSocket & build(bNodeTree &ntree, bNode &node) const override
bool can_connect(const bNodeSocket &socket) const override
static constexpr eNodeSocketDatatype static_socket_type
std::optional< int > pass_through_input_index
bool matches(const bNodeSocket &socket) const override
std::optional< BundleType > bundle_type
bNodeSocket & update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override
void create_signature(std::function< ClosureSignature(const bNode &)> create_signature)
static constexpr eNodeSocketDatatype static_socket_type
bNodeSocket & build(bNodeTree &ntree, bNode &node) const override
bNodeSocket & update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override
std::unique_ptr< std::function< ClosureSignature(const bNode &)> > create_signature
bool matches(const bNodeSocket &socket) const override
bool can_connect(const bNodeSocket &socket) const override
IDSocketDeclarationBuilder< Collection > Builder
static constexpr eNodeSocketDatatype static_socket_type
ColorBuilder & default_value(const ColorGeometry4f value)
ColorBuilder & try_copy_ui_data(const SocketDeclaration &other_decl) override
bNodeSocket & update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override
bool can_connect(const bNodeSocket &socket) const override
bNodeSocket & build(bNodeTree &ntree, bNode &node) const override
static constexpr eNodeSocketDatatype static_socket_type
bool matches(const bNodeSocket &socket) const override
CustomTypeBuilder & idname(const char *idname)
CustomTypeBuilder & init_socket_fn(std::function< void(bNode &node, bNodeSocket &socket, const char *data_path)> fn)
bNodeSocket & build(bNodeTree &ntree, bNode &node) const override
bool matches(const bNodeSocket &socket) const override
bNodeSocket & update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override
static constexpr eNodeSocketDatatype static_socket_type
std::function< void(bNode &node, bNodeSocket &socket, const char *data_path)> init_socket_fn
bool can_connect(const bNodeSocket &socket) const override
static constexpr eNodeSocketDatatype static_socket_type
bool can_connect(const bNodeSocket &socket) const override
bool matches(const bNodeSocket &socket) const override
bNodeSocket & update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override
bNodeSocket & build(bNodeTree &ntree, bNode &node) const override
FloatBuilder & subtype(PropertySubType subtype)
FloatBuilder & try_copy_ui_data(const SocketDeclaration &other_decl) override
bool can_connect(const bNodeSocket &socket) const override
bNodeSocket & build(bNodeTree &ntree, bNode &node) const override
static constexpr eNodeSocketDatatype static_socket_type
bNodeSocket & update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override
bool matches(const bNodeSocket &socket) const override
IDSocketDeclarationBuilder< Font > Builder
static constexpr eNodeSocketDatatype static_socket_type
IDSocketDeclarationBuilder & default_value_fn(std::function< ID *(const bNode &node)> fn)
std::function< ID *(const bNode &node)> default_value_fn
bool can_connect(const bNodeSocket &socket) const override
bNodeSocket & build(bNodeTree &ntree, bNode &node) const override
bNodeSocket & update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override
bool matches(const bNodeSocket &socket) const override
static constexpr eNodeSocketDatatype static_socket_type
IDSocketDeclarationBuilder< Image > Builder
IntBuilder & try_copy_ui_data(const SocketDeclaration &other_decl) override
IntBuilder & subtype(PropertySubType subtype)
IntVectorBuilder & default_value(const int2 value)
IntVectorBuilder & subtype(PropertySubType subtype)
IntVectorBuilder & dimensions(int dimensions)
bool matches(const bNodeSocket &socket) const override
static constexpr eNodeSocketDatatype static_socket_type
bool can_connect(const bNodeSocket &socket) const override
bNodeSocket & update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override
bNodeSocket & build(bNodeTree &ntree, bNode &node) const override
bool can_connect(const bNodeSocket &socket) const override
bNodeSocket & build(bNodeTree &ntree, bNode &node) const override
bool matches(const bNodeSocket &socket) const override
bNodeSocket & update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override
static constexpr eNodeSocketDatatype static_socket_type
IDSocketDeclarationBuilder< Mask > Builder
static constexpr eNodeSocketDatatype static_socket_type
static constexpr eNodeSocketDatatype static_socket_type
IDSocketDeclarationBuilder< Material > Builder
static constexpr eNodeSocketDatatype static_socket_type
bool can_connect(const bNodeSocket &socket) const override
bNodeSocket & build(bNodeTree &ntree, bNode &node) const override
bNodeSocket & update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override
bool matches(const bNodeSocket &socket) const override
MenuBuilder & expanded(bool value=true)
bool(*)(const EnumPropertyItem &item) StaticItemFilterFn
MenuBuilder & default_value(MenuValue value)
MenuBuilder & static_items(const EnumPropertyItem *items, const StaticItemFilterFn filter_fn=nullptr)
bool matches(const bNodeSocket &socket) const override
bNodeSocket & build(bNodeTree &ntree, bNode &node) const override
bool can_connect(const bNodeSocket &socket) const override
ImplicitSharingPtr< bke::RuntimeNodeEnumItems > items
static constexpr eNodeSocketDatatype static_socket_type
bNodeSocket & update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override
IDSocketDeclarationBuilder< Object > Builder
static constexpr eNodeSocketDatatype static_socket_type
RotationBuilder & try_copy_ui_data(const SocketDeclaration &other_decl) override
RotationBuilder & default_value(const math::EulerXYZ &value)
bNodeSocket & build(bNodeTree &ntree, bNode &node) const override
bool matches(const bNodeSocket &socket) const override
bool can_connect(const bNodeSocket &socket) const override
static constexpr eNodeSocketDatatype static_socket_type
bNodeSocket & update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override
static constexpr eNodeSocketDatatype static_socket_type
IDSocketDeclarationBuilder< Scene > Builder
bool can_connect(const bNodeSocket &socket) const override
bNodeSocket & build(bNodeTree &ntree, bNode &node) const override
bool matches(const bNodeSocket &socket) const override
static constexpr eNodeSocketDatatype static_socket_type
IDSocketDeclarationBuilder< Sound > Builder
static constexpr eNodeSocketDatatype static_socket_type
StringBuilder & try_copy_ui_data(const SocketDeclaration &other_decl) override
StringBuilder & subtype(PropertySubType subtype)
StringBuilder & path_filter(std::optional< std::string > filter)
StringBuilder & default_value(const std::string value)
bool can_connect(const bNodeSocket &socket) const override
std::optional< std::string > path_filter
bool matches(const bNodeSocket &socket) const override
bNodeSocket & build(bNodeTree &ntree, bNode &node) const override
bNodeSocket & update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override
static constexpr eNodeSocketDatatype static_socket_type
static constexpr eNodeSocketDatatype static_socket_type
IDSocketDeclarationBuilder< Text > Builder
static constexpr eNodeSocketDatatype static_socket_type
IDSocketDeclarationBuilder< Texture > Builder
VectorBuilder & subtype(PropertySubType subtype)
VectorBuilder & try_copy_ui_data(const SocketDeclaration &other_decl) override
VectorBuilder & default_value(const float2 value)
VectorBuilder & dimensions(int dimensions)
bool can_connect(const bNodeSocket &socket) const override
bool matches(const bNodeSocket &socket) const override
static constexpr eNodeSocketDatatype static_socket_type
bNodeSocket & build(bNodeTree &ntree, bNode &node) const override
bNodeSocket & update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override
#define FLT_MAX
#define INT_MAX
EulerXYZBase< float > EulerXYZ
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
VecBase< float, 4 > float4
VecBase< int32_t, 2 > int2
VecBase< float, 2 > float2
VecBase< int32_t, 3 > int3
ColorSceneLinear4f< eAlpha::Premultiplied > ColorGeometry4f
VecBase< float, 3 > float3