View Issue Details

IDProjectCategoryView StatusLast Update
0028218Open CASCADEOCCT:Visualizationpublic2017-09-29 16:24
ReporterdbpAssigned Tobugmaster  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Target Version7.2.0Fixed in Version7.2.0 
Summary0028218: Visualization, Path Tracing - Redesign path tracing materials to support two-layered model
DescriptionCurrently, 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 ReproducePlease check new sample:
samples\tcl\pathtrace_materials.tcl
TagsNo tags attached.
Test case numberv3d raytrace sample_materials

Attached Files

  • test.png (186,913 bytes)
  • bmw_1.png (4,913,501 bytes)
  • bmw_2.png (4,878,460 bytes)

Activities

git

2016-12-13 21:17

administrator   ~0061639

Branch CR28218 has been created by dbp.

SHA-1: 6dea9b6c933c870a8b090e20f274e51aab2fb9d4


Detailed log of new commits:

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

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

git

2016-12-26 22:11

administrator   ~0062150

Branch CR28218_1 has been created by duv.

SHA-1: 5178055cda63cf11fa1c6f9f7b015a4f96cf96a5


Detailed log of new commits:

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

    Fixes for cadrays

git

2017-01-17 23:01

administrator   ~0062718

Branch CR28218_2 has been created by dbp.

SHA-1: cb33178e445275d150d9c932b6cca3c3f88f918d


Detailed log of new commits:

Author: dbp
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

dbp

2017-01-17 23:02

developer   ~0062719

Dear kgv,

Could you please review the path in branch CR28218_2?

git

2017-01-17 23:03

administrator   ~0062720

Branch CR28218_2 has been updated forcibly by dbp.

SHA-1: d752086d8e69d80507e75fa28e7151c514b83581

dbp

2017-01-17 23:07

developer   ~0062721

New test case was added:
test v3d raytrace sample_materials

(Reference image attached)

kgv

2017-01-17 23:08

developer   ~0062722

> (Reference image attached)
nope...

dbp

2017-01-17 23:10

developer  

test.png (186,913 bytes)

dbp

2017-01-17 23:10

developer  

bmw_1.png (4,913,501 bytes)

dbp

2017-01-17 23:11

developer  

bmw_2.png (4,878,460 bytes)

dbp

2017-01-17 23:14

developer   ~0062723

An example of real-life material usage is given in images bmw_1.png and bmw_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

abv

2017-01-18 10:12

manager   ~0062727

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.

dbp

2017-01-18 10:25

developer   ~0062728

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.

git

2017-01-18 10:54

administrator   ~0062733

Branch CR28218_2 has been updated forcibly by dbp.

SHA-1: a20b6fd2015949f8825d1ca9720b4fe4a3e33829

git

2017-01-18 15:45

administrator   ~0062759

Branch CR28218_2 has been updated forcibly by dbp.

SHA-1: 4e706b5f182f470b61e58fd1c9fab880d51fee3a

git

2017-01-18 17:16

administrator   ~0062768

Branch CR28218_cadrays has been created by dbp.

SHA-1: 9bddc3a11dcc65eec56bec7c4b39e869a9e1cc37


Detailed log of new commits:

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

    Cosmetics.

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

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

Author: dbp
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: dbp
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>

git

2017-01-18 17:53

administrator   ~0062770

Branch CR28218_cadrays has been updated by dbp.

SHA-1: 489adedec4a80d69a1a7ef3e50224178b44fc316


Detailed log of new commits:

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

    Shader fix.

git

2017-01-19 14:04

administrator   ~0062798

Branch CR28218_cadrays has been updated by dbp.

SHA-1: 4fddba634f9ea4bb3e2d1bffa99de6e44df4c9b2


Detailed log of new commits:

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

    Fix for ISS.

kgv

2017-01-25 12:04

developer   ~0062995

Last edited: 2017-01-27 15:55

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

git

2017-02-12 18:38

administrator   ~0063763

Branch CR28218_3 has been created by dbp.

SHA-1: 288b0a585e13c2fab1d04ca57ad5855b1562a6aa


Detailed log of new commits:

Author: dbp
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

dbp

2017-02-12 18:39

developer   ~0063764

Dear kgv,

Please find rebased patch in branch CR28218_3.

kgv

2017-02-13 10:34

developer   ~0063769

Please test the patch.

apv

2017-02-15 15:32

tester   ~0063821

Dear BugMaster,

Branch CR28218_3 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested.
SHA-1: 288b0a585e13c2fab1d04ca57ad5855b1562a6aa

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

apv

2017-02-15 15:34

tester   ~0063822

Dear Denis,

Branch CR28218_3 has been rejected due to:
- regressions/differences/improvements
- differences in images

git

2017-02-16 13:29

administrator   ~0063838

Branch CR28218_5 has been created by dbp.

SHA-1: 673176116c6bc895c1733e457dc34e325ec83c4a


Detailed log of new commits:

Author: dbp
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

dbp

2017-02-16 13:31

developer   ~0063839

Last edited: 2017-02-16 15:53

Dear bugmaster,

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

git

2017-02-16 15:52

administrator   ~0063846

Branch CR28218_4 has been created by dbp.

SHA-1: 6b36050814002ea4b3d409efcd20b2a3c61a1dd7


Detailed log of new commits:

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

    Fix shader compilation issue.

git

2017-02-16 16:32

administrator   ~0063851

Branch CR28218_4 has been updated forcibly by dbp.

SHA-1: d5bb144a3089b4afa70c1d987eedc6fb617012c2

git

2017-02-16 16:35

administrator   ~0063852

Branch CR28218_4 has been updated forcibly by dbp.

SHA-1: de27504878fa6fc1b052b6379a29bf62ecd16f23

apv

2017-02-17 12:55

tester   ~0063876

Dear BugMaster,

Branch CR28218_4 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested.
SHA-1: de27504878fa6fc1b052b6379a29bf62ecd16f23

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%]

apv

2017-02-17 12:56

tester   ~0063877

Dear Denis,

Branch CR28218_4 has been rejected due to:
- regressions/differences/improvements

git

2017-02-17 13:23

administrator   ~0063881

Branch CR28218_4 has been updated by dbp.

SHA-1: 2b794805074e64a3d74632ee843c878c0c38650a


Detailed log of new commits:

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

    Fix test case sample_ball_alpha.

dbp

2017-02-17 13:24

developer   ~0063882

Dear apv,

Please find fix for test case in the separate commit in branch CR28218_4.

apv

2017-02-17 15:56

tester   ~0063890

Test case v3d raytrace sample_ball_alpha has been verified:
http://occt-tests/CR28218_4-master-OCCT/Debian70-64/v3d/raytrace/sample_ball_alpha.html
http://occt-tests/CR28218_4-master-OCCT/Windows-64-VC10/v3d/raytrace/sample_ball_alpha.html

git

2017-03-20 14:34

administrator   ~0064478

Branch CR28218_4 has been deleted by inv.

SHA-1: 2b794805074e64a3d74632ee843c878c0c38650a

git

2017-03-20 14:34

administrator   ~0064484

Branch CR28218_5 has been deleted by inv.

SHA-1: 673176116c6bc895c1733e457dc34e325ec83c4a

git

2017-03-20 14:35

administrator   ~0064491

Branch CR28218_3 has been deleted by inv.

SHA-1: 288b0a585e13c2fab1d04ca57ad5855b1562a6aa

git

2017-03-20 14:36

administrator   ~0064516

Branch CR28218_cadrays has been deleted by inv.

SHA-1: 4fddba634f9ea4bb3e2d1bffa99de6e44df4c9b2

git

2017-03-20 14:36

administrator   ~0064517

Branch CR28218_2 has been deleted by inv.

SHA-1: 4e706b5f182f470b61e58fd1c9fab880d51fee3a

git

2017-03-20 14:37

administrator   ~0064525

Branch CR28218_1 has been deleted by inv.

SHA-1: 5178055cda63cf11fa1c6f9f7b015a4f96cf96a5

git

2017-03-20 14:37

administrator   ~0064527

Branch CR28218 has been deleted by inv.

SHA-1: 6dea9b6c933c870a8b090e20f274e51aab2fb9d4

Related Changesets

occt: master 05aa616d

2016-11-18 14:53:10

dbp


Committer: bugmaster Details Diff
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
Affected Issues
0028218
mod - .gitattributes Diff File
mod - samples/tcl/pathtrace_cube.tcl Diff File
add - samples/tcl/pathtrace_materials.tcl Diff File
mod - src/Graphic3d/Graphic3d_BSDF.cxx Diff File
mod - src/Graphic3d/Graphic3d_BSDF.hxx Diff File
mod - src/Graphic3d/Graphic3d_MaterialAspect.cxx Diff File
mod - src/OpenGl/OpenGl_SceneGeometry.hxx Diff File
mod - src/OpenGl/OpenGl_View_Raytrace.cxx Diff File
mod - src/Shaders/PathtraceBase.fs Diff File
mod - src/Shaders/RaytraceBase.fs Diff File
mod - src/Shaders/Shaders_PathtraceBase_fs.pxx Diff File
mod - src/Shaders/Shaders_RaytraceBase_fs.pxx Diff File
mod - src/ViewerTest/ViewerTest.cxx Diff File
mod - tests/v3d/raytrace/sample_ball_alpha Diff File
add - tests/v3d/raytrace/sample_materials Diff File

Issue History

Date Modified Username Field Change
2016-12-13 21:04 dbp New Issue
2016-12-13 21:04 dbp Assigned To => dbp
2016-12-13 21:17 git Note Added: 0061639
2016-12-26 22:11 git Note Added: 0062150
2017-01-17 23:01 git Note Added: 0062718
2017-01-17 23:02 dbp Note Added: 0062719
2017-01-17 23:02 dbp Assigned To dbp => kgv
2017-01-17 23:02 dbp Status new => resolved
2017-01-17 23:02 dbp Steps to Reproduce Updated
2017-01-17 23:03 git Note Added: 0062720
2017-01-17 23:07 dbp Note Added: 0062721
2017-01-17 23:08 kgv Note Added: 0062722
2017-01-17 23:10 dbp File Added: test.png
2017-01-17 23:10 dbp File Added: bmw_1.png
2017-01-17 23:11 dbp File Added: bmw_2.png
2017-01-17 23:14 dbp Note Added: 0062723
2017-01-18 10:12 abv Note Added: 0062727
2017-01-18 10:25 dbp Note Added: 0062728
2017-01-18 10:54 git Note Added: 0062733
2017-01-18 15:45 git Note Added: 0062759
2017-01-18 17:16 git Note Added: 0062768
2017-01-18 17:53 git Note Added: 0062770
2017-01-19 14:04 git Note Added: 0062798
2017-01-25 12:04 kgv Note Added: 0062995
2017-01-25 12:04 kgv Assigned To kgv => dbp
2017-01-25 12:04 kgv Status resolved => assigned
2017-01-27 15:55 kgv Note Edited: 0062995
2017-02-12 18:38 git Note Added: 0063763
2017-02-12 18:39 dbp Note Added: 0063764
2017-02-12 18:39 dbp Assigned To dbp => kgv
2017-02-12 18:39 dbp Status assigned => resolved
2017-02-13 10:34 kgv Note Added: 0063769
2017-02-13 10:34 kgv Assigned To kgv => bugmaster
2017-02-13 10:34 kgv Status resolved => reviewed
2017-02-13 11:49 apv Assigned To bugmaster => apv
2017-02-15 15:32 apv Note Added: 0063821
2017-02-15 15:32 apv Assigned To apv => dbp
2017-02-15 15:32 apv Status reviewed => assigned
2017-02-15 15:34 apv Note Added: 0063822
2017-02-15 15:34 apv Test case number => v3d raytrace sample_materials
2017-02-16 13:29 git Note Added: 0063838
2017-02-16 13:31 dbp Note Added: 0063839
2017-02-16 13:31 dbp Assigned To dbp => bugmaster
2017-02-16 13:31 dbp Status assigned => resolved
2017-02-16 13:32 dbp Status resolved => reviewed
2017-02-16 15:52 git Note Added: 0063846
2017-02-16 15:53 dbp Note Edited: 0063839
2017-02-16 16:32 git Note Added: 0063851
2017-02-16 16:35 git Note Added: 0063852
2017-02-16 19:20 apv Assigned To bugmaster => apv
2017-02-17 12:55 apv Note Added: 0063876
2017-02-17 12:55 apv Assigned To apv => dbp
2017-02-17 12:55 apv Status reviewed => assigned
2017-02-17 12:56 apv Note Added: 0063877
2017-02-17 13:23 git Note Added: 0063881
2017-02-17 13:23 dbp Status assigned => resolved
2017-02-17 13:24 dbp Note Added: 0063882
2017-02-17 13:24 dbp Assigned To dbp => apv
2017-02-17 13:24 dbp Status resolved => reviewed
2017-02-17 15:56 apv Note Added: 0063890
2017-02-17 15:56 apv Assigned To apv => bugmaster
2017-02-17 15:56 apv Status reviewed => tested
2017-03-03 16:25 bugmaster Changeset attached => occt master 05aa616d
2017-03-03 16:25 bugmaster Status tested => verified
2017-03-03 16:25 bugmaster Resolution open => fixed
2017-03-20 14:34 git Note Added: 0064478
2017-03-20 14:34 git Note Added: 0064484
2017-03-20 14:35 git Note Added: 0064491
2017-03-20 14:36 git Note Added: 0064516
2017-03-20 14:36 git Note Added: 0064517
2017-03-20 14:37 git Note Added: 0064525
2017-03-20 14:37 git Note Added: 0064527
2017-09-29 16:20 aiv Fixed in Version => 7.2.0
2017-09-29 16:24 aiv Status verified => closed