mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0028218: Visualization, Path Tracing - Redesign path tracing materials to support two-layered model
Existing OCCT path tracing engine used very simple additive material (BSDF) model, so it was possible to reproduce behavior only of very basic materials such as metal, glass, or plastic. However, some important in CAD industry materials like car paint or ceramic could not be modeled well. In this patch, OCCT BSDF was significantly improved by replacing additive model with two-layered scattering model. Therefore, we have base diffuse, glossy, or transmissive layer, covered by one glossy/specular coat. The layers themselves have no thickness; they can simply reflect light or transmits it to the layer under it. Balancing different combinations of layer properties can produce a wide range of different effects. At the same time, disabling the first (coat) layer allows to keep full compatibility with previously supported scattering model. All new parameters are available via 'vbsdf' command. Location of new sample for few material examples: samples\tcl\pathtrace_materials.tcl Fix shader compilation issue. Fix test case sample_ball_alpha. Shaders_PathtraceBase_fs.pxx - regenerate resource from origin
This commit is contained in:
@@ -356,16 +356,16 @@ static const char Shaders_RaytraceBase_fs[] =
|
||||
" ivec4 SubData;\n"
|
||||
"};\n"
|
||||
"\n"
|
||||
"#define MATERIAL_AMBN(index) (18 * index + 0)\n"
|
||||
"#define MATERIAL_DIFF(index) (18 * index + 1)\n"
|
||||
"#define MATERIAL_SPEC(index) (18 * index + 2)\n"
|
||||
"#define MATERIAL_EMIS(index) (18 * index + 3)\n"
|
||||
"#define MATERIAL_REFL(index) (18 * index + 4)\n"
|
||||
"#define MATERIAL_REFR(index) (18 * index + 5)\n"
|
||||
"#define MATERIAL_TRAN(index) (18 * index + 6)\n"
|
||||
"#define MATERIAL_TRS1(index) (18 * index + 7)\n"
|
||||
"#define MATERIAL_TRS2(index) (18 * index + 8)\n"
|
||||
"#define MATERIAL_TRS3(index) (18 * index + 9)\n"
|
||||
"#define MATERIAL_AMBN(index) (19 * index + 0)\n"
|
||||
"#define MATERIAL_DIFF(index) (19 * index + 1)\n"
|
||||
"#define MATERIAL_SPEC(index) (19 * index + 2)\n"
|
||||
"#define MATERIAL_EMIS(index) (19 * index + 3)\n"
|
||||
"#define MATERIAL_REFL(index) (19 * index + 4)\n"
|
||||
"#define MATERIAL_REFR(index) (19 * index + 5)\n"
|
||||
"#define MATERIAL_TRAN(index) (19 * index + 6)\n"
|
||||
"#define MATERIAL_TRS1(index) (19 * index + 7)\n"
|
||||
"#define MATERIAL_TRS2(index) (19 * index + 8)\n"
|
||||
"#define MATERIAL_TRS3(index) (19 * index + 9)\n"
|
||||
"\n"
|
||||
"#define TRS_OFFSET(treelet) treelet.SubData.x\n"
|
||||
"#define BVH_OFFSET(treelet) treelet.SubData.y\n"
|
||||
|
Reference in New Issue
Block a user