DiscussionsIssue archiveOCCT:Visualization

Archived issue #0028218

Visualization, Path Tracing - Redesign path tracing materials to support two-layered model

Open CASCADEOCCT:Visualizationclosed38 public notes

Search issues

Description

Currently, OCCT path tracing engine uses very simple additive material (BSDF) model, so it is 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. OCCT BSDF can be 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 currently supported scattering model.

Steps to reproduce

Please check new sample:
samples\tcl\pathtrace_materials.tcl

Public activity

38 archived notes

Participants are labeled by their role within this record.

01Commenter 2
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Fri Nov 18 17:53:10 2016 +0300

    0028218: Visualization, Path Tracing - Redesign path tracing materials to support two-layered model
02Commenter 2
Branch [archived branch] has been created by Participant.

[revision removed]


Detailed log of new commits:

Author: duv
Date: Mon Dec 26 22:10:50 2016 +0300

    Fixes for cadrays
03Commenter 2
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Fri Nov 18 17:53:10 2016 +0300

    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.
    
    Please check new sample for few material examples:
    samples\tcl\pathtrace_materials.tcl
04Commenter 4
Dear kgv,

Could you please review the path in branch CR28218_2?
05Commenter 2
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
06Commenter 6
New test case was added:
test v3d raytrace sample_materials

(Reference image attached)
07Commenter 3
> (Reference image attached)
nope...
08Commenter 8
An example of real-life material usage is given in images Attachment 1 (PNG) and Attachment 2 (PNG). The model was taken from:
https://github.com/GPUOpen-LibrariesAndSDKs/RadeonRays_SDK/tree/master/Resources/bmw

License:
https://github.com/GPUOpen-LibrariesAndSDKs/RadeonRays_SDK/blob/master/LICENSE.txt
09Commenter 9
I still believe that support of bump textures would allow providing more realistic display of materials in many more situations than fine-tuned scattering model of material.
10Commenter 10
Dear abv,

You are absolutely right, support of bump mapping is important and will be added in next patches. But, it is just an additional feature not affecting actual material model. In frames of this patch, the fundamental scattering model was improved to support wide range of materials.

As for bump mapping, it should be considered in frames of multi-texturing support. In this way, we will be able to assign several textures for each object: diffuse map, specular map, normal map (for bum mapping), etc.
11Commenter 2
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
12Commenter 2
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
13Commenter 2
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Wed Jan 18 17:13:43 2017 +0300

    Cosmetics.

Author: Author
Date: Fri Nov 18 17:53:10 2016 +0300

    0028129: Visualization, Path Tracing - Improve interactivity in "steady" rendering mode

Author: Author
Date: Fri Nov 18 17:53:10 2016 +0300

    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.
    
    Please check new sample for few material examples:
    samples\tcl\pathtrace_materials.tcl

Author: Author
Date: Wed Jan 18 14:24:13 2017 +0300

    0028369: Visualization, Path Tracing - Expose radiance clamping setting in path tracing mode
    
    New parameter was added in the vrenderparams command:
    vrenderparams -maxrad <value>
14Commenter 2
Branch [archived branch] has been updated by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Wed Jan 18 17:53:18 2017 +0300

    Shader fix.

15Commenter 2
Branch [archived branch] has been updated by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Thu Jan 19 14:03:55 2017 +0300

    Fix for ISS.

16Commenter 3
Could you please re-base patch on top of current master?

17Commenter 2
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Fri Nov 18 17:53:10 2016 +0300

    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.
    
    Please check new sample for few material examples:
    samples\tcl\pathtrace_materials.tcl
18Commenter 18
Dear kgv,

Please find rebased patch in branch CR28218_3.
19Commenter 3
Please test the patch.
20Commenter 20
Dear Commenter 1,

Branch CR28218_3 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested.
[revision removed]

Number of compiler warnings:
occt component:
   Linux: 0 (0 on master)
   Windows: 0 (0 on master)
   MasOS: 0 (0 on master)
products component:
   Linux: 64
   Windows: 0
   MacOS: 1192

Regressions/Differences:
http://occt-tests/CR28218_3-master-OCCT/Debian70-64/summary.html
http://occt-tests/CR28218_3-master-OCCT/Windows-64-VC10/summary.html
v3d raytrace sample_ball_alpha

Testing cases:
v3d raytrace sample_materials - OK
http://occt-tests/CR28218_3-master-OCCT/Debian70-64/v3d/raytrace/sample_materials.html
http://occt-tests/CR28218_3-master-OCCT/Windows-64-VC10/v3d/raytrace/sample_materials.html

Testing on Linux:
Total MEMORY difference: 92678837 / 93176052 [-0.53%]
Total CPU difference: 20035.64000000014 / 19783.280000000217 [+1.28%]

Testing on Windows:
Total MEMORY difference: 57831867 / 57829936 [+0.00%]
Total CPU difference: 18418.24246489846 / 18793.846072598604 [-2.00%]

There are differences in images found by testdiff:
http://occt-tests/CR28218_3-master-OCCT/Debian70-64/diff-Debian70-64.html
http://occt-tests/CR28218_3-master-OCCT/Windows-64-VC10/diff-Windows-64-VC10-image.html
v3d raytrace sample_ball
v3d raytrace sample_ball_alpha
21Commenter 21
Dear Denis,

Branch [archived branch] has been rejected due to:
- regressions/differences/improvements
- differences in images
22Commenter 2
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Fri Nov 18 17:53:10 2016 +0300

    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.
    
    Please check new sample for few material examples:
    samples\tcl\pathtrace_materials.tcl
23Commenter 23
Dear Commenter 1,

All changes except of sample_ball_alpha are OK. The regression was fixed in branch CR28218_4. Please retest the patch.

24Commenter 2
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Thu Feb 16 15:50:26 2017 +0300

    Fix shader compilation issue.
25Commenter 2
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
26Commenter 2
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
27Commenter 27
Dear Commenter 1,

Branch CR28218_4 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested.
[revision removed]

Number of compiler warnings:
occt component:
   Linux: 0 (0 on master)
   Windows: 0 (0 on master)
   MasOS: 0 (0 on master)
products component:
   Linux: 64
   Windows: 0
   MacOS: 1202

Regressions/Differences:
http://occt-tests/CR28218_4-master-OCCT/Debian70-64/summary.html
http://occt-tests/CR28218_4-master-OCCT/Windows-64-VC10/summary.html
v3d raytrace sample_ball_alpha

Testing cases:
v3d raytrace sample_materials - OK
http://occt-tests/CR28218_4-master-OCCT/Debian70-64/v3d/raytrace/sample_materials.html
http://occt-tests/CR28218_4-master-OCCT/Windows-64-VC10/v3d/raytrace/sample_materials.html

Testing on Linux:
Total MEMORY difference: 92994090 / 93164309 [-0.18%]
Total CPU difference: 20050.330000000165 / 19783.010000000217 [+1.35%]

Testing on Windows:
Total MEMORY difference: 57831922 / 57829936 [+0.00%]
Total CPU difference: 18313.487793398555 / 18793.846072598604 [-2.56%]
28Commenter 28
Dear Denis,

Branch [archived branch] has been rejected due to:
- regressions/differences/improvements
29Commenter 2
Branch [archived branch] has been updated by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Fri Feb 17 13:23:03 2017 +0300

    Fix test case sample_ball_alpha.

30Commenter 30
Dear apv,

Please find fix for test case in the separate commit in branch CR28218_4.
31Commenter 31
32Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]
33Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]
34Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]
35Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]
36Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]
37Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]
38Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]