MCPcopy Create free account
hub / github.com/RenderKit/embree / Material__sample

Function Material__sample

tutorials/pathtracer/pathtracer_device.cpp:873–897  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

871}
872
873inline Vec3fa Material__sample(ISPCMaterial** materials, unsigned int materialID, unsigned int numMaterials, const BRDF& brdf, const Vec3fa& Lw, const Vec3fa& wo, const DifferentialGeometry& dg, Sample3f& wi_o, Medium& medium, const Vec2f& s)
874{
875 Vec3fa c = Vec3fa(0.0f);
876 auto id = materialID;
877 {
878 if (id < numMaterials) // FIXME: workaround for ISPC bug, location reached with empty execution mask
879 {
880 ISPCMaterial* material = materials[id];
881 switch (material->type) {
882 case MATERIAL_OBJ : c = OBJMaterial__sample ((ISPCOBJMaterial*) material, brdf, Lw, wo, dg, wi_o, medium, s); break;
883 case MATERIAL_METAL: c = MetalMaterial__sample((ISPCMetalMaterial*)material, brdf, Lw, wo, dg, wi_o, medium, s); break;
884 case MATERIAL_REFLECTIVE_METAL: c = ReflectiveMetalMaterial__sample((ISPCReflectiveMetalMaterial*)material, brdf, Lw, wo, dg, wi_o, medium, s); break;
885 case MATERIAL_VELVET: c = VelvetMaterial__sample((ISPCVelvetMaterial*)material, brdf, Lw, wo, dg, wi_o, medium, s); break;
886 case MATERIAL_DIELECTRIC: c = DielectricMaterial__sample((ISPCDielectricMaterial*)material, brdf, Lw, wo, dg, wi_o, medium, s); break;
887 case MATERIAL_METALLIC_PAINT: c = MetallicPaintMaterial__sample((ISPCMetallicPaintMaterial*)material, brdf, Lw, wo, dg, wi_o, medium, s); break;
888 case MATERIAL_MATTE: c = MatteMaterial__sample((ISPCMatteMaterial*)material, brdf, Lw, wo, dg, wi_o, medium, s); break;
889 case MATERIAL_MIRROR: c = MirrorMaterial__sample((ISPCMirrorMaterial*)material, brdf, Lw, wo, dg, wi_o, medium, s); break;
890 case MATERIAL_THIN_DIELECTRIC: c = ThinDielectricMaterial__sample((ISPCThinDielectricMaterial*)material, brdf, Lw, wo, dg, wi_o, medium, s); break;
891 case MATERIAL_HAIR: c = HairMaterial__sample((ISPCHairMaterial*)material, brdf, Lw, wo, dg, wi_o, medium, s); break;
892 default: wi_o = make_Sample3f(Vec3fa(0.0f),0.0f); c = Vec3fa(0.0f); break;
893 }
894 }
895 }
896 return c;
897}
898
899
900////////////////////////////////////////////////////////////////////////////////

Callers 1

renderPixelFunctionFunction · 0.85

Calls 12

OBJMaterial__sampleFunction · 0.85
MetalMaterial__sampleFunction · 0.85
VelvetMaterial__sampleFunction · 0.85
MatteMaterial__sampleFunction · 0.85
MirrorMaterial__sampleFunction · 0.85
HairMaterial__sampleFunction · 0.85
make_Sample3fFunction · 0.85
Vec3faClass · 0.50

Tested by

no test coverage detected