| 1395 | } |
| 1396 | |
| 1397 | static void InitMaterial(material_t *material) { |
| 1398 | InitTexOpt(&material->ambient_texopt, /* is_bump */ false); |
| 1399 | InitTexOpt(&material->diffuse_texopt, /* is_bump */ false); |
| 1400 | InitTexOpt(&material->specular_texopt, /* is_bump */ false); |
| 1401 | InitTexOpt(&material->specular_highlight_texopt, /* is_bump */ false); |
| 1402 | InitTexOpt(&material->bump_texopt, /* is_bump */ true); |
| 1403 | InitTexOpt(&material->displacement_texopt, /* is_bump */ false); |
| 1404 | InitTexOpt(&material->alpha_texopt, /* is_bump */ false); |
| 1405 | InitTexOpt(&material->reflection_texopt, /* is_bump */ false); |
| 1406 | InitTexOpt(&material->roughness_texopt, /* is_bump */ false); |
| 1407 | InitTexOpt(&material->metallic_texopt, /* is_bump */ false); |
| 1408 | InitTexOpt(&material->sheen_texopt, /* is_bump */ false); |
| 1409 | InitTexOpt(&material->emissive_texopt, /* is_bump */ false); |
| 1410 | InitTexOpt(&material->normal_texopt, |
| 1411 | /* is_bump */ false); // @fixme { is_bump will be true? } |
| 1412 | material->name = ""; |
| 1413 | material->ambient_texname = ""; |
| 1414 | material->diffuse_texname = ""; |
| 1415 | material->specular_texname = ""; |
| 1416 | material->specular_highlight_texname = ""; |
| 1417 | material->bump_texname = ""; |
| 1418 | material->displacement_texname = ""; |
| 1419 | material->reflection_texname = ""; |
| 1420 | material->alpha_texname = ""; |
| 1421 | for (int i = 0; i < 3; i++) { |
| 1422 | material->ambient[i] = static_cast<real_t>(0.0); |
| 1423 | material->diffuse[i] = static_cast<real_t>(0.0); |
| 1424 | material->specular[i] = static_cast<real_t>(0.0); |
| 1425 | material->transmittance[i] = static_cast<real_t>(0.0); |
| 1426 | material->emission[i] = static_cast<real_t>(0.0); |
| 1427 | } |
| 1428 | material->illum = 0; |
| 1429 | material->dissolve = static_cast<real_t>(1.0); |
| 1430 | material->shininess = static_cast<real_t>(1.0); |
| 1431 | material->ior = static_cast<real_t>(1.0); |
| 1432 | |
| 1433 | material->roughness = static_cast<real_t>(0.0); |
| 1434 | material->metallic = static_cast<real_t>(0.0); |
| 1435 | material->sheen = static_cast<real_t>(0.0); |
| 1436 | material->clearcoat_thickness = static_cast<real_t>(0.0); |
| 1437 | material->clearcoat_roughness = static_cast<real_t>(0.0); |
| 1438 | material->anisotropy_rotation = static_cast<real_t>(0.0); |
| 1439 | material->anisotropy = static_cast<real_t>(0.0); |
| 1440 | material->roughness_texname = ""; |
| 1441 | material->metallic_texname = ""; |
| 1442 | material->sheen_texname = ""; |
| 1443 | material->emissive_texname = ""; |
| 1444 | material->normal_texname = ""; |
| 1445 | |
| 1446 | material->unknown_parameter.clear(); |
| 1447 | } |
| 1448 | |
| 1449 | // code from https://wrf.ecse.rpi.edu//Research/Short_Notes/pnpoly.html |
| 1450 | template <typename T> |
no test coverage detected