15 #include <vsg/core/Array.h>
16 #include <vsg/core/Value.h>
27 float shininess{100.0f};
31 input.read(
"ambientColor", ambientColor);
32 input.read(
"diffuseColor", diffuseColor);
33 input.read(
"specularColor", specularColor);
34 input.read(
"shininess", shininess);
39 output.
write(
"ambientColor", ambientColor);
40 output.
write(
"diffuseColor", diffuseColor);
41 output.
write(
"specularColor", specularColor);
42 output.
write(
"shininess", shininess);
47 constexpr
bool has_read_write<material>() {
return true; }
49 VSG_value(materialValue, material);
50 VSG_array(materialArray, material);
56 vec4 ambient{1.0f, 1.0f, 1.0f, 1.0f};
57 vec4 diffuse{0.9f, 0.9f, 0.9f, 1.0f};
58 vec4 specular{0.2f, 0.2f, 0.2f, 1.0f};
59 vec4 emissive{0.0f, 0.0f, 0.0f, 0.0f};
60 float shininess{100.0f};
61 float alphaMask{1.0f};
62 float alphaMaskCutoff{0.5f};
66 input.read(
"ambient", ambient);
67 input.read(
"diffuse", diffuse);
68 input.read(
"specular", specular);
69 input.read(
"emissive", emissive);
70 input.read(
"shininess", shininess);
71 input.read(
"alphaMask", alphaMask);
72 input.read(
"alphaMaskCutoff", alphaMaskCutoff);
77 output.
write(
"ambient", ambient);
78 output.
write(
"diffuse", diffuse);
79 output.
write(
"specular", specular);
80 output.
write(
"emissive", emissive);
81 output.
write(
"shininess", shininess);
82 output.
write(
"alphaMask", alphaMask);
83 output.
write(
"alphaMaskCutoff", alphaMaskCutoff);
88 constexpr
bool has_read_write<PhongMaterial>() {
return true; }
90 VSG_value(PhongMaterialValue, PhongMaterial);
91 VSG_array(PhongMaterialArray, PhongMaterial);
97 vec4 baseColorFactor{1.0f, 1.0f, 1.0f, 1.0f};
98 vec4 emissiveFactor{0.0f, 0.0f, 0.0f, 1.0f};
99 vec4 diffuseFactor{0.9f, 0.9f, 0.9f, 1.0f};
100 vec4 specularFactor{0.2f, 0.2f, 0.2f, 1.0f};
101 float metallicFactor{1.0f};
102 float roughnessFactor{1.0f};
103 float alphaMask{1.0f};
104 float alphaMaskCutoff{0.5f};
108 input.read(
"baseColorFactor", baseColorFactor);
109 input.read(
"emissiveFactor", emissiveFactor);
110 input.read(
"diffuseFactor", diffuseFactor);
111 input.read(
"specularFactor", specularFactor);
112 input.read(
"metallicFactor", metallicFactor);
113 input.read(
"roughnessFactor", roughnessFactor);
114 input.read(
"alphaMask", alphaMask);
115 input.read(
"alphaMaskCutoff", alphaMaskCutoff);
120 output.
write(
"baseColorFactor", baseColorFactor);
121 output.
write(
"emissiveFactor", emissiveFactor);
122 output.
write(
"diffuseFactor", diffuseFactor);
123 output.
write(
"specularFactor", specularFactor);
124 output.
write(
"metallicFactor", metallicFactor);
125 output.
write(
"roughnessFactor", roughnessFactor);
126 output.
write(
"alphaMask", alphaMask);
127 output.
write(
"alphaMaskCutoff", alphaMaskCutoff);
132 constexpr
bool has_read_write<PbrMaterial>() {
return true; }
134 VSG_value(PbrMaterialValue, PbrMaterial);
135 VSG_array(PbrMaterialArray, PbrMaterial);
virtual void write(size_t num, const int8_t *value)=0
write contiguous array of value(s)
Definition: material.h:96
Definition: material.h:55
simple material struct for passing material settings as uniform value to fragment shader
Definition: material.h:23