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

Function Material__preprocess

tutorials/pathtracer/pathtracer_device.cpp:822–845  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

820////////////////////////////////////////////////////////////////////////////////
821
822inline void Material__preprocess(ISPCMaterial** materials, unsigned int materialID, unsigned int numMaterials, BRDF& brdf, const Vec3fa& wo, const DifferentialGeometry& dg, const Medium& medium)
823{
824 auto id = materialID;
825 {
826 if (id < numMaterials) // FIXME: workaround for ISPC bug, location reached with empty execution mask
827 {
828 ISPCMaterial* material = materials[id];
829
830 switch (material->type) {
831 case MATERIAL_OBJ : OBJMaterial__preprocess ((ISPCOBJMaterial*) material,brdf,wo,dg,medium); break;
832 case MATERIAL_METAL: MetalMaterial__preprocess((ISPCMetalMaterial*)material,brdf,wo,dg,medium); break;
833 case MATERIAL_REFLECTIVE_METAL: ReflectiveMetalMaterial__preprocess((ISPCReflectiveMetalMaterial*)material,brdf,wo,dg,medium); break;
834 case MATERIAL_VELVET: VelvetMaterial__preprocess((ISPCVelvetMaterial*)material,brdf,wo,dg,medium); break;
835 case MATERIAL_DIELECTRIC: DielectricMaterial__preprocess((ISPCDielectricMaterial*)material,brdf,wo,dg,medium); break;
836 case MATERIAL_METALLIC_PAINT: MetallicPaintMaterial__preprocess((ISPCMetallicPaintMaterial*)material,brdf,wo,dg,medium); break;
837 case MATERIAL_MATTE: MatteMaterial__preprocess((ISPCMatteMaterial*)material,brdf,wo,dg,medium); break;
838 case MATERIAL_MIRROR: MirrorMaterial__preprocess((ISPCMirrorMaterial*)material,brdf,wo,dg,medium); break;
839 case MATERIAL_THIN_DIELECTRIC: ThinDielectricMaterial__preprocess((ISPCThinDielectricMaterial*)material,brdf,wo,dg,medium); break;
840 case MATERIAL_HAIR: HairMaterial__preprocess((ISPCHairMaterial*)material,brdf,wo,dg,medium); break;
841 default: break;
842 }
843 }
844 }
845}
846
847inline Vec3fa Material__eval(ISPCMaterial** materials, unsigned int materialID, unsigned int numMaterials, const BRDF& brdf, const Vec3fa& wo, const DifferentialGeometry& dg, const Vec3fa& wi)
848{

Callers 1

renderPixelFunctionFunction · 0.85

Tested by

no test coverage detected