| 659 | } |
| 660 | |
| 661 | Vec3fa MetalMaterial__sample(ISPCMetalMaterial* This, const BRDF& brdf, const Vec3fa& Lw, const Vec3fa& wo, const DifferentialGeometry& dg, Sample3f& wi_o, Medium& medium, const Vec2f& s) |
| 662 | { |
| 663 | const PowerCosineDistribution distribution = make_PowerCosineDistribution(rcp(This->roughness)); |
| 664 | |
| 665 | if (dot(wo,dg.Ns) <= 0.0f) { wi_o = make_Sample3f(Vec3fa(0.0f),0.0f); return Vec3fa(0.f); } |
| 666 | sample(distribution,wo,dg.Ns,wi_o,s); |
| 667 | if (dot(wi_o.v,dg.Ns) <= 0.0f) { wi_o = make_Sample3f(Vec3fa(0.0f),0.0f); return Vec3fa(0.f); } |
| 668 | return MetalMaterial__eval(This,brdf,wo,dg,wi_o.v); |
| 669 | } |
| 670 | |
| 671 | //////////////////////////////////////////////////////////////////////////////// |
| 672 | // ReflectiveMetal Material // |
no test coverage detected