Blender  V3.3
EffectExporter.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
7 #include <map>
8 #include <set>
9 
10 #include "COLLADAFWColorOrTexture.h"
11 #include "COLLADASWEffectProfile.h"
12 
13 #include "DocumentExporter.h"
14 #include "EffectExporter.h"
15 #include "MaterialExporter.h"
16 
17 #include "collada_internal.h"
18 #include "collada_utils.h"
19 
20 #include "DNA_mesh_types.h"
21 #include "DNA_world_types.h"
22 
23 #include "BKE_collection.h"
24 #include "BKE_customdata.h"
25 #include "BKE_material.h"
26 #include "BKE_mesh.h"
27 
28 static std::string getActiveUVLayerName(Object *ob)
29 {
30  Mesh *me = (Mesh *)ob->data;
31 
32  int num_layers = CustomData_number_of_layers(&me->ldata, CD_MLOOPUV);
33  if (num_layers) {
34  return std::string(bc_CustomData_get_active_layer_name(&me->ldata, CD_MLOOPUV));
35  }
36 
37  return "";
38 }
39 
40 EffectsExporter::EffectsExporter(COLLADASW::StreamWriter *sw,
41  BCExportSettings &export_settings,
42  KeyImageMap &key_image_map)
43  : COLLADASW::LibraryEffects(sw), export_settings(export_settings), key_image_map(key_image_map)
44 {
45 }
46 
47 bool EffectsExporter::hasEffects(Scene *sce)
48 {
49  bool result = false;
50  FOREACH_SCENE_OBJECT_BEGIN (sce, ob) {
51  int a;
52  for (a = 0; a < ob->totcol; a++) {
53  Material *ma = BKE_object_material_get(ob, a + 1);
54 
55  /* no material, but check all of the slots */
56  if (!ma) {
57  continue;
58  }
59 
60  result = true;
61  break;
62  }
63  }
65  return result;
66 }
67 
69 {
70  if (hasEffects(sce)) {
71  this->mContext = C;
72  this->scene = sce;
73  openLibrary();
74  MaterialFunctor mf;
76  sce, *this, this->export_settings.get_export_set());
77 
78  closeLibrary();
79  }
80 }
81 
82 void EffectsExporter::set_shader_type(COLLADASW::EffectProfile &ep, Material *ma)
83 {
84  /* XXX check if BLINN and PHONG can be supported as well */
85  ep.setShaderType(COLLADASW::EffectProfile::LAMBERT);
86 }
87 
88 void EffectsExporter::set_transparency(COLLADASW::EffectProfile &ep, Material *ma)
89 {
90  double alpha = bc_get_alpha(ma);
91  if (alpha < 1) {
92  /* workaround use <transparent> to avoid wrong handling of <transparency> by other tools */
93  COLLADASW::ColorOrTexture cot = bc_get_cot(0, 0, 0, alpha);
94  ep.setTransparent(cot, false, "alpha");
95  ep.setOpaque(COLLADASW::EffectProfile::A_ONE);
96  }
97 }
98 
99 void EffectsExporter::set_diffuse_color(COLLADASW::EffectProfile &ep, Material *ma)
100 {
101  COLLADASW::ColorOrTexture cot = bc_get_base_color(ma);
102  ep.setDiffuse(cot, false, "diffuse");
103 }
104 
105 void EffectsExporter::set_ambient(COLLADASW::EffectProfile &ep, Material *ma)
106 {
107  COLLADASW::ColorOrTexture cot = bc_get_ambient(ma);
108  ep.setAmbient(cot, false, "ambient");
109 }
110 void EffectsExporter::set_specular(COLLADASW::EffectProfile &ep, Material *ma)
111 {
112  COLLADASW::ColorOrTexture cot = bc_get_specular(ma);
113  ep.setSpecular(cot, false, "specular");
114 }
115 void EffectsExporter::set_reflective(COLLADASW::EffectProfile &ep, Material *ma)
116 {
117  COLLADASW::ColorOrTexture cot = bc_get_reflective(ma);
118  ep.setReflective(cot, false, "reflective");
119 }
120 
121 void EffectsExporter::set_reflectivity(COLLADASW::EffectProfile &ep, Material *ma)
122 {
123  double reflectivity = bc_get_reflectivity(ma);
124  if (reflectivity > 0.0) {
125  ep.setReflectivity(reflectivity, false, "specular");
126  }
127 }
128 
129 void EffectsExporter::set_emission(COLLADASW::EffectProfile &ep, Material *ma)
130 {
131  COLLADASW::ColorOrTexture cot = bc_get_emission(ma);
132  ep.setEmission(cot, false, "emission");
133 }
134 
135 void EffectsExporter::set_ior(COLLADASW::EffectProfile &ep, Material *ma)
136 {
137  double alpha = bc_get_ior(ma);
138  ep.setIndexOfRefraction(alpha, false, "ior");
139 }
140 
141 void EffectsExporter::set_shininess(COLLADASW::EffectProfile &ep, Material *ma)
142 {
143  double shininess = bc_get_shininess(ma);
144  ep.setShininess(shininess, false, "shininess");
145 }
146 
147 void EffectsExporter::get_images(Material *ma, KeyImageMap &material_image_map)
148 {
149  if (!ma->use_nodes) {
150  return;
151  }
152 
153  MaterialNode material = MaterialNode(mContext, ma, key_image_map);
154  Image *image = material.get_diffuse_image();
155  if (image == nullptr) {
156  return;
157  }
158 
159  std::string uid(id_name(image));
160  std::string key = translate_id(uid);
161 
162  if (material_image_map.find(key) == material_image_map.end()) {
163  material_image_map[key] = image;
164  key_image_map[key] = image;
165  }
166 }
167 
168 void EffectsExporter::create_image_samplers(COLLADASW::EffectProfile &ep,
169  KeyImageMap &material_image_map,
170  std::string &active_uv)
171 {
172  KeyImageMap::iterator iter;
173 
174  for (iter = material_image_map.begin(); iter != material_image_map.end(); iter++) {
175 
176  Image *image = iter->second;
177  std::string uid(id_name(image));
178  std::string key = translate_id(uid);
179 
180  COLLADASW::Sampler *sampler = new COLLADASW::Sampler(
181  COLLADASW::Sampler::SAMPLER_TYPE_2D,
182  key + COLLADASW::Sampler::SAMPLER_SID_SUFFIX,
183  key + COLLADASW::Sampler::SURFACE_SID_SUFFIX);
184 
185  sampler->setImageId(key);
186 
187  ep.setDiffuse(createTexture(image, active_uv, sampler), false, "diffuse");
188  }
189 }
190 
192 {
193  KeyImageMap material_image_map;
194 
195  openEffect(get_effect_id(ma));
196 
197  COLLADASW::EffectProfile ep(mSW);
198  ep.setProfileType(COLLADASW::EffectProfile::COMMON);
199  ep.openProfile();
200  set_shader_type(ep, ma); /* creates a Lambert Shader for now */
201 
202  COLLADASW::ColorOrTexture cot;
203 
204  set_diffuse_color(ep, ma);
205  set_emission(ep, ma);
206  set_ior(ep, ma);
207  set_reflectivity(ep, ma);
208  set_transparency(ep, ma);
209 
210  /* TODO: */
211  // set_shininess(ep, ma); shininess not supported for lambert
212  // set_ambient(ep, ma);
213  // set_specular(ep, ma);
214 
215  get_images(ma, material_image_map);
216  std::string active_uv(getActiveUVLayerName(ob));
217  create_image_samplers(ep, material_image_map, active_uv);
218 
219 #if 0
220  unsigned int a, b;
221  for (a = 0, b = 0; a < tex_indices.size(); a++) {
222  MTex *t = ma->mtex[tex_indices[a]];
223  Image *ima = t->tex->ima;
224 
225  /* Image not set for texture */
226  if (!ima) {
227  continue;
228  }
229 
230  std::string key(id_name(ima));
231  key = translate_id(key);
232 
233  /* create only one <sampler>/<surface> pair for each unique image */
234  if (im_samp_map.find(key) == im_samp_map.end()) {
235  /* <newparam> <sampler> <source> */
236  COLLADASW::Sampler sampler(COLLADASW::Sampler::SAMPLER_TYPE_2D,
237  key + COLLADASW::Sampler::SAMPLER_SID_SUFFIX,
238  key + COLLADASW::Sampler::SURFACE_SID_SUFFIX);
239  sampler.setImageId(key);
240  /* copy values to arrays since they will live longer */
241  samplers[a] = sampler;
242 
243  /* store pointers so they can be used later when we create <texture>s */
244  samp_surf[b] = &samplers[a];
245  //samp_surf[b][1] = &surfaces[a];
246 
247  im_samp_map[key] = b;
248  b++;
249  }
250  }
251 
252  for (a = 0; a < tex_indices.size(); a++) {
253  MTex *t = ma->mtex[tex_indices[a]];
254  Image *ima = t->tex->ima;
255 
256  if (!ima) {
257  continue;
258  }
259 
260  std::string key(id_name(ima));
261  key = translate_id(key);
262  int i = im_samp_map[key];
263  std::string uvname = strlen(t->uvname) ? t->uvname : active_uv;
264  COLLADASW::Sampler *sampler = (COLLADASW::Sampler *)
265  samp_surf[i]; /* possibly uninitialized memory ... */
266  writeTextures(ep, key, sampler, t, ima, uvname);
267  }
268 #endif
269 
270  /* performs the actual writing */
271  ep.addProfileElements();
272  ep.addExtraTechniques(mSW);
273 
274  ep.closeProfile();
275  closeEffect();
276 }
277 
278 COLLADASW::ColorOrTexture EffectsExporter::createTexture(Image *ima,
279  std::string &uv_layer_name,
280  COLLADASW::Sampler *sampler
281  /*COLLADASW::Surface *surface*/)
282 {
283 
284  COLLADASW::Texture texture(translate_id(id_name(ima)));
285  texture.setTexcoord(uv_layer_name);
286  // texture.setSurface(*surface);
287  texture.setSampler(*sampler);
288 
289  COLLADASW::ColorOrTexture cot(texture);
290  return cot;
291 }
292 
293 COLLADASW::ColorOrTexture EffectsExporter::getcol(float r, float g, float b, float a)
294 {
295  COLLADASW::Color color(r, g, b, a);
296  COLLADASW::ColorOrTexture cot(color);
297  return cot;
298 }
#define FOREACH_SCENE_OBJECT_END
#define FOREACH_SCENE_OBJECT_BEGIN(scene, _instance)
CustomData interface, see also DNA_customdata_types.h.
int CustomData_number_of_layers(const struct CustomData *data, int type)
General operations, lookup, etc. for materials.
struct Material * BKE_object_material_get(struct Object *ob, short act)
Definition: material.c:687
@ CD_MLOOPUV
static std::string getActiveUVLayerName(Object *ob)
_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 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 t
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 and Z components Generates normals with round corners and may slow down renders Vector Displace the surface along an arbitrary direction White Return a random value or color based on an input seed Float Map an input float to a curve and outputs a float value Separate Color
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 Texture
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
#define C
Definition: RandGen.cpp:25
EffectsExporter(COLLADASW::StreamWriter *sw, BCExportSettings &export_settings, KeyImageMap &key_image_map)
COLLADASW::ColorOrTexture createTexture(Image *ima, std::string &uv_layer_name, COLLADASW::Sampler *sampler)
COLLADASW::ColorOrTexture getcol(float r, float g, float b, float a)
void operator()(Material *ma, Object *ob)
void exportEffects(bContext *C, Scene *sce)
std::string translate_id(const char *idString)
std::string get_effect_id(Material *mat)
std::string id_name(void *id)
COLLADASW::ColorOrTexture bc_get_specular(Material *ma)
COLLADASW::ColorOrTexture bc_get_ambient(Material *ma)
double bc_get_alpha(Material *ma)
COLLADASW::ColorOrTexture bc_get_cot(float r, float g, float b, float a)
COLLADASW::ColorOrTexture bc_get_emission(Material *ma)
COLLADASW::ColorOrTexture bc_get_reflective(Material *ma)
double bc_get_reflectivity(Material *ma)
double bc_get_shininess(Material *ma)
COLLADASW::ColorOrTexture bc_get_base_color(Material *ma)
double bc_get_ior(Material *ma)
char * bc_CustomData_get_active_layer_name(const CustomData *data, int type)
std::map< std::string, Image * > KeyImageMap
Definition: collada_utils.h:56
Material material
depth_tx sampler(1, ImageType::FLOAT_2D, "combined_tx") .sampler(2
depth_tx normal_tx diffuse_light_tx specular_light_tx volume_light_tx environment_tx ambient_occlusion_tx aov_value_tx in_weight_img image(1, GPU_R32F, Qualifier::WRITE, ImageType::FLOAT_2D_ARRAY, "out_weight_img") .image(3
ccl_gpu_kernel_postfix ccl_global float int int int sw
static unsigned a[3]
Definition: RandGen.cpp:78
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
static const pxr::TfToken g("g", pxr::TfToken::Immortal)
void forEachMaterialInExportSet(Scene *sce, Functor &f, LinkNode *export_set)
CustomData ldata
void * data