| 536 | //////////////////////////////////////////////////////////////////////////////// |
| 537 | |
| 538 | void OBJMaterial__preprocess(ISPCOBJMaterial* material, BRDF& brdf, const Vec3fa& wo, const DifferentialGeometry& dg, const Medium& medium) |
| 539 | { |
| 540 | float d = material->d; |
| 541 | if (material->map_d) d *= getTextureTexel1f(material->map_d,dg.u,dg.v); |
| 542 | brdf.Ka = Vec3fa(material->Ka); |
| 543 | //if (material->map_Ka) { brdf.Ka *= material->map_Ka->get(dg.st); } |
| 544 | brdf.Kd = d * Vec3fa(material->Kd); |
| 545 | if (material->map_Kd) brdf.Kd = brdf.Kd * getTextureTexel3f(material->map_Kd,dg.u,dg.v); |
| 546 | brdf.Ks = d * Vec3fa(material->Ks); |
| 547 | //if (material->map_Ks) brdf.Ks *= material->map_Ks->get(dg.st); |
| 548 | brdf.Ns = material->Ns; |
| 549 | //if (material->map_Ns) { brdf.Ns *= material->map_Ns.get(dg.st); } |
| 550 | brdf.Kt = (1.0f-d)*Vec3fa(material->Kt); |
| 551 | brdf.Ni = material->Ni; |
| 552 | } |
| 553 | |
| 554 | Vec3fa OBJMaterial__eval(ISPCOBJMaterial* material, const BRDF& brdf, const Vec3fa& wo, const DifferentialGeometry& dg, const Vec3fa& wi) |
| 555 | { |
no test coverage detected