| 1332 | } |
| 1333 | |
| 1334 | static void InitMaterial(material_t *material) { |
| 1335 | InitTexOpt(&material->ambient_texopt, /* is_bump */ false); |
| 1336 | InitTexOpt(&material->diffuse_texopt, /* is_bump */ false); |
| 1337 | InitTexOpt(&material->specular_texopt, /* is_bump */ false); |
| 1338 | InitTexOpt(&material->specular_highlight_texopt, /* is_bump */ false); |
| 1339 | InitTexOpt(&material->bump_texopt, /* is_bump */ true); |
| 1340 | InitTexOpt(&material->displacement_texopt, /* is_bump */ false); |
| 1341 | InitTexOpt(&material->alpha_texopt, /* is_bump */ false); |
| 1342 | InitTexOpt(&material->reflection_texopt, /* is_bump */ false); |
| 1343 | InitTexOpt(&material->roughness_texopt, /* is_bump */ false); |
| 1344 | InitTexOpt(&material->metallic_texopt, /* is_bump */ false); |
| 1345 | InitTexOpt(&material->sheen_texopt, /* is_bump */ false); |
| 1346 | InitTexOpt(&material->emissive_texopt, /* is_bump */ false); |
| 1347 | InitTexOpt(&material->normal_texopt, |
| 1348 | /* is_bump */ false); // @fixme { is_bump will be true? } |
| 1349 | material->name = ""; |
| 1350 | material->ambient_texname = ""; |
| 1351 | material->diffuse_texname = ""; |
| 1352 | material->specular_texname = ""; |
| 1353 | material->specular_highlight_texname = ""; |
| 1354 | material->bump_texname = ""; |
| 1355 | material->displacement_texname = ""; |
| 1356 | material->reflection_texname = ""; |
| 1357 | material->alpha_texname = ""; |
| 1358 | for (int i = 0; i < 3; i++) { |
| 1359 | material->ambient[i] = static_cast<real_t>(0.0); |
| 1360 | material->diffuse[i] = static_cast<real_t>(0.0); |
| 1361 | material->specular[i] = static_cast<real_t>(0.0); |
| 1362 | material->transmittance[i] = static_cast<real_t>(0.0); |
| 1363 | material->emission[i] = static_cast<real_t>(0.0); |
| 1364 | } |
| 1365 | material->illum = 0; |
| 1366 | material->dissolve = static_cast<real_t>(1.0); |
| 1367 | material->shininess = static_cast<real_t>(1.0); |
| 1368 | material->ior = static_cast<real_t>(1.0); |
| 1369 | |
| 1370 | material->roughness = static_cast<real_t>(0.0); |
| 1371 | material->metallic = static_cast<real_t>(0.0); |
| 1372 | material->sheen = static_cast<real_t>(0.0); |
| 1373 | material->clearcoat_thickness = static_cast<real_t>(0.0); |
| 1374 | material->clearcoat_roughness = static_cast<real_t>(0.0); |
| 1375 | material->anisotropy_rotation = static_cast<real_t>(0.0); |
| 1376 | material->anisotropy = static_cast<real_t>(0.0); |
| 1377 | material->roughness_texname = ""; |
| 1378 | material->metallic_texname = ""; |
| 1379 | material->sheen_texname = ""; |
| 1380 | material->emissive_texname = ""; |
| 1381 | material->normal_texname = ""; |
| 1382 | |
| 1383 | material->unknown_parameter.clear(); |
| 1384 | } |
| 1385 | |
| 1386 | // code from https://wrf.ecse.rpi.edu//Research/Short_Notes/pnpoly.html |
| 1387 | template <typename T> |
no test coverage detected