View Issue Details

IDProjectCategoryView StatusLast Update
0024887Open CASCADEOCCT:Visualizationpublic2014-11-11 12:59
Reporterkgv Assigned Toapn  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version6.7.0 
Target Version6.8.0Fixed in Version6.8.0 
Summary0024887: Visualization - revise and extend Raytracing controls
DescriptionCurrent API in V3d_View looks not flexible/extensible and there is no even method to look-up which mode (raytracing or rasterization) is active by moment.
Steps To Reproduce
  //! enables OpenCL-based ray-tracing mode 
  Standard_EXPORT     void SetRaytracingMode() ;
  //! enables OpenGL-based rasterization mode 
  Standard_EXPORT     void SetRasterizationMode() ;
  //! enables sharp shadows in OpenCL-based ray-tracing mode 
  Standard_EXPORT     void EnableRaytracedShadows() ;
  //! enables specular reflections in OpenCL-based ray-tracing mode 
  Standard_EXPORT     void EnableRaytracedReflections() ;
  //! enables antialiasing in OpenCL-based ray-tracing mode 
  Standard_EXPORT     void EnableRaytracedAntialiasing() ;
  //! disables sharp shadows in OpenCL-based ray-tracing mode 
  Standard_EXPORT     void DisableRaytracedShadows() ;
  //! disables specular reflections in OpenCL-based ray-tracing mode 
  Standard_EXPORT     void DisableRaytracedReflections() ;
  //! disables antialiasing in OpenCL-based ray-tracing mode 
  Standard_EXPORT     void DisableRaytracedAntialiasing() ;
Additional information
and documentation updates
This patch revises and extends API for controlling rendering options (including features specific for ray-tracing). Now all rendering options are represented by Graphic3d_RenderingParams structure which is available from V3d_View object:

Graphic3d_RenderingParams& V3d_View::RenderingParams()

By using this structure it is possible to switch between rasterization and ray-tracing mode and to enable/disable such effects as shadows, reflections and antialiasing. Two new options were provided: ray-tracing depth (controls number of ray bounces) and "transparent" shadows (computing light propagation according to transparency of the objects). The above options are available from the DRAW using new 'vrenderparams' command. Please check the command help for more details.


TagsNo tags attached.
Test case numberNot needed

Relationships

related to 0024864 closedapn Open CASCADE Visualization - Implementing refractions in ray-tracing 

Activities

dbp

2014-05-14 17:50

developer   ~0029332

Last edited: 2014-05-16 17:28

Dear kgv,

please review the patch in branch CR24887_3.

dbp

2014-05-14 17:52

developer   ~0029333

Dear duv,

please review the changes and post your comments here.

kgv

2014-05-19 12:58

developer   ~0029386

Minor corrections have been pushed into branch CR24887_3.
Please consider following remarks:

+  //! Compile-time ray-tracing parameters.
+  struct RaytracingParams
+  {

+    //! Actual ray-tracing depth (number of ray bounces).
+    Standard_Integer TraceDepth;

The field TraceDepth is not initialized within constructor.

+      vec3 aNodeMinLft = texelFetch (uObjectMinPointTexture, aData.y).xyz;
+      vec3 aNodeMaxLft = texelFetch (uObjectMaxPointTexture, aData.y).xyz;
+      vec3 aNodeMinRgh = texelFetch (uObjectMinPointTexture, aData.z).xyz;
+      vec3 aNodeMaxRgh = texelFetch (uObjectMaxPointTexture, aData.z).xyz;

Wouldn't be it more clear using aNodeMaxLft = aNodeMinLft;?

+    RenderingParams (me : mutable) returns RenderingParams from Graphic3d is static;
+    ---C++: return &

Since structure is managed without handle, two methods should be introduced - constant getter "RenderingParams() const" and non-constant changer "ChangeRenderingParams()".

+    RenderingMode (me : mutable) returns RenderingMode from Graphic3d is static;
+    ---Level: Public
+    ---Purpose: Returns active rendering mode.

These methods look redundant.

+  //! Enables/disables hard/soft shadows.
+  Standard_Boolean IsShadowsEnabled;
...
+    "\n      '{shad}ows 0|1'   Enables/disables hard/soft shadows"

What for "hard/soft" are mentioned here? This looks redundant.
How to switch between hard/soft shadows by the way?

dbp

2014-05-19 15:30

developer   ~0029392

Dear kgv,

please check the patch in branch CR24887_3.

dbp

2014-05-20 10:13

developer   ~0029405

Dear kgv,

rebased patch is in CR24887 branch.

kgv

2014-05-20 10:19

developer   ~0029406

Last edited: 2014-05-20 10:19

Please test the branch CR24887 (note that it is based on 0024864).

apv

2014-05-22 16:19

tester   ~0029472

Last edited: 2014-05-22 16:25

Dear BugMaster,

Branch CR24887 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
SHA-1: edb8d4fa2b1302c188eb6fdd0c1e7d1cd5491657

Number of compiler warnings:

Linux: 17 (17 on master)
Windows: 0 (0 on master)

products component :
Linux: 11 (11 on master)
Windows: 2 (2 on master)

Regressions/Differences:
Not detected

Testing cases:
Absent

Testing on Linux:
Total MEMORY difference: 356232192 / 357304428
Total CPU difference: 57592.81999999974 / 56362.889999999934

Testing on Windows:
Total MEMORY difference: 379365468 / 379599948
Total CPU difference: 41136.203125 / 35503.109375

There are differences in images found by testdiff:
http://occt-tests/CR24887-master-occt/Debian60-64/diff-Debian60-64.html
http://occt-tests/CR24887-master-occt/Windows-32-VC9/diff-Windows-32-VC9.html

kgv

2014-05-22 16:33

developer   ~0029473

Last edited: 2014-05-22 16:36

The order of snapshots of test case v3d/raytrace/bug24130 has been accidentally changed (off on -> on off):
-for { set aAAMode 0 } { $aAAMode <= 1 } { incr aAAMode } {
-  for { set aReflMode 0 } { $aReflMode <= 1 } { incr aReflMode } {
-    for { set aShadMode 0 } { $aShadMode <= 1 } { incr aShadMode } {
-      vsetraytracemode shad=$aShadMode refl=$aReflMode aa=$aAAMode
+foreach aFSAAMode {on off} {
+  foreach aReflMode {on off} {
+    foreach aShadMode {on off} {

Original order makes more sense since options are eventually enabled one by one (rather than disabled one by one), although meaningful snapshot names would be better...

dbp

2014-05-22 18:25

developer   ~0029477

Dear apn,

material test case (bug24855) was fixed. Please re-test.

apn

2014-05-22 18:36

administrator   ~0029478

Now images are OK.

Related Changesets

occt: master bc8c79bb

2014-05-22 14:57:34

dbp


Committer: apn Details Diff
0024887: Visualization - revise and extend Raytracing controls

Fix material test case.
Fix ray-tracing test case and sample.
Affected Issues
0024887
mod - samples/tcl/raytrace.tcl Diff File
mod - src/Graphic3d/FILES Diff File
mod - src/Graphic3d/Graphic3d.cdl Diff File
mod - src/Graphic3d/Graphic3d_CView.hxx Diff File
add - src/Graphic3d/Graphic3d_RenderingParams.hxx Diff File
mod - src/OpenGl/OpenGl_GraphicDriver_7.cxx Diff File
mod - src/OpenGl/OpenGl_Workspace.cxx Diff File
mod - src/OpenGl/OpenGl_Workspace.hxx Diff File
mod - src/OpenGl/OpenGl_Workspace_Raytrace.cxx Diff File
mod - src/Shaders/RaytraceBase.fs Diff File
mod - src/V3d/V3d_View.cdl Diff File
mod - src/V3d/V3d_View_5.cxx Diff File
mod - src/ViewerTest/ViewerTest_ViewerCommands.cxx Diff File
mod - tests/v3d/materials/bug24855 Diff File
mod - tests/v3d/raytrace/bug24130 Diff File
mod - tests/v3d/raytrace/connected Diff File
mod - tests/v3d/raytrace/plastic Diff File
mod - tests/v3d/raytrace/refraction Diff File

Issue History

Date Modified Username Field Change
2014-04-30 15:52 kgv New Issue
2014-04-30 15:52 kgv Assigned To => san
2014-04-30 15:52 kgv Assigned To san => dbp
2014-05-14 17:49 dbp Summary Visualization - revise Raytracing controls => Visualization - revise and extend Raytracing controls
2014-05-14 17:50 dbp Note Added: 0029332
2014-05-14 17:50 dbp Assigned To dbp => kgv
2014-05-14 17:50 dbp Status new => resolved
2014-05-14 17:52 dbp Note Added: 0029333
2014-05-16 17:28 dbp Note Edited: 0029332
2014-05-19 12:58 kgv Note Added: 0029386
2014-05-19 12:58 kgv Assigned To kgv => dbp
2014-05-19 12:58 kgv Status resolved => assigned
2014-05-19 15:30 dbp Note Added: 0029392
2014-05-19 15:30 dbp Assigned To dbp => kgv
2014-05-19 15:30 dbp Status assigned => resolved
2014-05-20 10:13 dbp Note Added: 0029405
2014-05-20 10:18 kgv Relationship added related to 0024864
2014-05-20 10:19 kgv Note Added: 0029406
2014-05-20 10:19 kgv Assigned To kgv => bugmaster
2014-05-20 10:19 kgv Status resolved => reviewed
2014-05-20 10:19 kgv Note Edited: 0029406
2014-05-21 16:54 apn Assigned To bugmaster => apn
2014-05-22 16:19 apv Note Added: 0029472
2014-05-22 16:20 apn Note Edited: 0029472
2014-05-22 16:20 apn Test case number => Not needed
2014-05-22 16:25 apv Note Edited: 0029472
2014-05-22 16:33 kgv Note Added: 0029473
2014-05-22 16:34 kgv Note Edited: 0029473
2014-05-22 16:36 kgv Note Edited: 0029473
2014-05-22 16:41 apv Assigned To apn => dbp
2014-05-22 16:41 apv Status reviewed => assigned
2014-05-22 18:25 dbp Note Added: 0029477
2014-05-22 18:25 dbp Assigned To dbp => apn
2014-05-22 18:25 dbp Status assigned => feedback
2014-05-22 18:36 apn Note Added: 0029478
2014-05-22 19:02 apn Assigned To apn => bugmaster
2014-05-22 19:02 apn Status feedback => tested
2014-05-23 14:25 apn Changeset attached => occt master bc8c79bb
2014-05-23 14:25 apn Assigned To bugmaster => apn
2014-05-23 14:25 apn Status tested => verified
2014-05-23 14:25 apn Resolution open => fixed
2014-10-03 12:12 dbp Additional Information Updated
2014-10-03 12:14 dbp Additional Information Updated
2014-11-11 12:44 aiv Fixed in Version => 6.8.0
2014-11-11 12:59 aiv Status verified => closed