DiscussionsIssue archiveOCCT:Visualization

Archived issue #0026070

Ray tracing with reflections is poor on rotated presentation

Open CASCADEOCCT:Visualizationclosed11 public notes

Search issues

Description

The problem is discovered in Windows version of CAD Assistant, on sample model cad.brep: if ray tracing and reflections is enabled, it is shown with artifacts, looking like reflections of non-existent objects.

Note that the model consists of solid and set of wires, and uses location assigned to these in order to have faces forming "CAD" letters visible when the model is opened with default view settings.

Use script in Steps to Reproduce to see the problem (reflections are present on outer surfaces of the shape) in DRAW

Steps to reproduce

source samples/tcl/cad.tcl
vrenderparams -rayTrace -reflections
vlocrotate res 0 0 0 0 0 1 180
vfit

Additional information

Generation of secondary rays was incorrect in case of non-identity viewer transformation applied to AIS shape. As a result, global illumination effects (like shadows, reflections, and refractions) were also incorrect. This patch fixes the above problems by handling such transformations in ray-tracing shaders.

Public activity

11 archived notes

Participants are labeled by their role within this record.

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

[revision removed]


Detailed log of new commits:

Author: dbp
Date: Mon Apr 13 17:48:35 2015 +0300

    0026070: Ray tracing with reflections is poor on rotated presentation

02Commenter 2
Dear kgv,

please review the patch in branch CR26070.
03Commenter 3
Please test the patch.
04Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
05Commenter 5
I confirm that the patch fixes the original problem in CAD Assistant
06Commenter 6
Dear Commenter 1,
Branch CR26070 was rebased on current master of occt git-repository.
07Commenter 7
Dear Commenter 1,
Branch CR26070 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
[revision removed]

Number of compiler warnings:

occt component :
Linux: 18 (18 on master)
Windows: 0 (0 on master)

products component :
Linux: 4 (4 on master)
Windows: 0 (0 on master)

Regressions/Differences:
No regressions/differences

Testing cases:
http://occt-tests/CR26070-master-occt-64/Debian60-64/v3d/raytrace/bug26070.html
http://occt-tests/CR26070-master-occt-64/Windows-64-VC10/v3d/raytrace/bug26070.html
v3d raytrace(014) bug26070: - There is not shape in the photo

Testing on Linux:
occt component :
Total MEMORY difference: 94048774 / 94235751 [-0.20%]
Total CPU difference: 53510.17999999944 / 56193.089999999705 [-4.77%]
products component :
Total MEMORY difference: 23682825 / 23699797 [-0.07%]
Total CPU difference: 16611.549999999985 / 19056.55999999996 [-12.83%]

Testing on Windows:
occt component :
Total MEMORY difference: 57126996 / 57127513 [-0.00%]
Total CPU difference: 15847.564386298953 / 15976.561613198899 [-0.81%]
products component :
Total MEMORY difference: 15477006 / 15478724 [-0.01%]
Total CPU difference: 6315.544483999951 / 6217.388654799964 [+1.58%]

There are no differences in images found by testdiff.
08Commenter 2
Branch [archived branch] has been updated by Participant.

[revision removed]


Detailed log of new commits:

Author: mkv
Date: Tue Apr 14 17:48:39 2015 +0300

    Test case for issue CR26070

09Commenter 2
Branch [archived branch] has been updated by Participant.

[revision removed]


Detailed log of new commits:

Author: mkv
Date: Tue Apr 14 18:08:06 2015 +0300

    Small correction of test case for issue CR26070

10Commenter 10
Dear Commenter 1,

Following draw-command was commented:
vshowfaceboundary res 1 255 255 255

Now
v3d raytrace(014) bug26070
test case is OK.
Branch CR26070 is TESTED.
11Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]