View Issue Details

IDProjectCategoryView StatusLast Update
0025017Open CASCADEOCCT:Visualizationpublic2014-11-11 12:59
Reporterkgv Assigned Tobugmaster  
PrioritynormalSeveritymajor 
Status closedResolutionfixed 
PlatformWindowsOSVC++ 2013 
Target Version6.8.0Fixed in Version6.8.0 
Summary0025017: Visualization - materials in Raytracing are messed up
DescriptionCustom colors are not worked correctly in Raytracing mode - them randomly messed up.
Steps To Reproduce
pload MODELING VISUALIZATION
box b  0 0 0 1 2 3
box bb 3 0 0 2 3 1

vinit View1
vclear
vrenderparams -raster
vsetdispmode 1
vaxo
vdisplay b bb
vfit

explode b V
vaspects b -subshapes b_1      -setcolor GREEN
explode b E
vaspects b -subshapes b_6 b_12 -setcolor RED     -setwidth 6
explode b W
vaspects b -subshapes b_2      -setcolor HOTPINK -setwidth 4
explode b F
vaspects b -subshapes b_3      -setcolor GRAY

explode bb F
vaspects bb -setcolor GREEN -subshapes bb_6 -setcolor RED
vdump dump1.png
vrenderparams -raytrace
vdump dump2.png
vrenderparams -raster
vdump dump3.png
vrenderparams -raytrace
vdump dump4.png
vrenderparams -raster
vdump dump5.png
vrenderparams -raytrace
vdump dump6.png
Additional information
and documentation updates
This patch fixes incorrect ray-tracing behaviour for connected OpenGL structures. The error resulted in wrong representation of the geometry in ray-tracing mode (some structures can be hidden, and materials can be messed up).
TagsNo tags attached.
Test case numberNot needed

Attached Files

  • colors_rast.png (10,237 bytes)
  • colors_rt1.png (8,997 bytes)
  • colors_rt2.png (8,037 bytes)

Activities

kgv

2014-06-17 19:22

developer  

colors_rast.png (10,237 bytes)

kgv

2014-06-17 19:23

developer  

colors_rt1.png (8,997 bytes)

kgv

2014-06-17 19:23

developer  

colors_rt2.png (8,037 bytes)

dbp

2014-07-07 10:46

developer   ~0029977

Dear duv,

please check scene update procedure implemented in your patch on selective BVH updates.

duv

2014-07-09 17:27

developer   ~0030039

Dear kgv,

Problem should be fixed, please look at the patch.

kgv

2014-07-10 10:12

developer   ~0030048

Dear Danila,

in general, patch looks like a workaround, not a complete solution.
Please consider revising it.

-        std::map<const OpenGl_PrimitiveArray*, OpenGl_TriangleSet*>::iterator aSetIter = myArrayToTrianglesMap.find (aPrimArray);
+        std::map<Standard_Integer, OpenGl_TriangleSet*>::iterator aSetIter = myArrayToTrianglesMap.find (aPrimArray->GetUID());
 
         if (aPrimArray != NULL)
         {

NULL check is now make no sense - due to earlier pointer dereference.

+  const Standard_Integer GetUID() const { return myUID; }
+
 private:
 
+  static Standard_Integer NextUID();
+

methods have no description.

+Standard_Integer OpenGl_PrimitiveArray::NextUID()
+{
+  static Standard_Integer Counter = 0;
+
+  return Counter++;
+}

this method is not thread-safe and has no overflow protection (since signed integer is in use).

+  myUID       (NextUID())

why UID is global-wise? It seems it should belong to OpenGl_GraphicDriver instance.

+  Standard_Integer                      myUID;
+

why this field is a property of OpenGl_PrimitiveArray?
This ray-tracer limitation and design issue should be removed in future.

duv

2014-07-11 12:00

developer   ~0030069

Dear kgv,

Please look at current implementation.

kgv

2014-07-11 16:42

developer   ~0030085

Please test the patch.

mkv

2014-07-15 11:57

tester   ~0030153

Dear BugMaster,

Branch CR25017 from occt git-repository (and master from products git-repository) was compiled on Linux and Windows platforms and tested.
SHA-1: 1f2de2f12b6bb4ea9dac5baf5944fa12abece93f

Number of compiler warnings:

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

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

Regressions/Differences:
No regressions/differences

Testing cases:
Not needed

Testing on Linux:
Total MEMORY difference: 352873880 / 352298144
Total CPU difference: 53578.56999999989 / 54524.60999999987

Testing on Windows:
Total MEMORY difference: 377849712 / 378606660
Total CPU difference: 41446.5625 / 46820.203125

There are no differences in images found by testdiff.

git

2014-07-22 16:02

administrator   ~0030319

Branch CR25017 has been deleted by inv.

SHA-1: 1f2de2f12b6bb4ea9dac5baf5944fa12abece93f

Related Changesets

occt: master 8d3f219f

2014-07-11 12:39:29

duv


Committer: bugmaster Details Diff
0025017: Visualization - materials in Raytracing are messed up Affected Issues
0025017
mod - src/OpenGl/OpenGl_GraphicDriver.hxx Diff File
mod - src/OpenGl/OpenGl_Group.cxx Diff File
mod - src/OpenGl/OpenGl_PrimitiveArray.cxx Diff File
mod - src/OpenGl/OpenGl_PrimitiveArray.hxx Diff File
mod - src/OpenGl/OpenGl_SceneGeometry.hxx Diff File
mod - src/OpenGl/OpenGl_Workspace.hxx Diff File
mod - src/OpenGl/OpenGl_Workspace_Raytrace.cxx Diff File

Issue History

Date Modified Username Field Change
2014-06-17 19:18 kgv New Issue
2014-06-17 19:18 kgv Assigned To => san
2014-06-17 19:22 kgv File Added: colors_rast.png
2014-06-17 19:23 kgv File Added: colors_rt1.png
2014-06-17 19:23 kgv File Added: colors_rt2.png
2014-06-17 19:24 kgv Assigned To san => duv
2014-06-17 19:24 kgv Assigned To duv => dbp
2014-06-17 19:24 kgv Severity minor => major
2014-06-17 19:24 kgv Target Version => 6.8.0
2014-07-07 10:46 dbp Note Added: 0029977
2014-07-07 10:46 dbp Assigned To dbp => duv
2014-07-07 10:46 dbp Status new => assigned
2014-07-09 17:27 duv Note Added: 0030039
2014-07-09 17:27 duv Assigned To duv => kgv
2014-07-09 17:27 duv Status assigned => resolved
2014-07-10 10:12 kgv Note Added: 0030048
2014-07-10 10:12 kgv Assigned To kgv => duv
2014-07-10 10:12 kgv Status resolved => assigned
2014-07-11 12:00 duv Note Added: 0030069
2014-07-11 12:00 duv Assigned To duv => kgv
2014-07-11 12:00 duv Status assigned => resolved
2014-07-11 16:42 kgv Note Added: 0030085
2014-07-11 16:42 kgv Assigned To kgv => bugmaster
2014-07-11 16:42 kgv Status resolved => reviewed
2014-07-11 17:48 mkv Assigned To bugmaster => mkv
2014-07-15 11:57 mkv Note Added: 0030153
2014-07-15 11:58 mkv Test case number => Not needed
2014-07-15 11:58 mkv Assigned To mkv => bugmaster
2014-07-15 11:58 mkv Status reviewed => tested
2014-07-22 15:13 bugmaster Changeset attached => occt master 8d3f219f
2014-07-22 15:13 bugmaster Status tested => verified
2014-07-22 15:13 bugmaster Resolution open => fixed
2014-07-22 16:02 git Note Added: 0030319
2014-10-03 11:56 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