View Issue Details

IDProjectCategoryView StatusLast Update
0032752Open CASCADEOCCT:Visualizationpublic2024-07-17 12:55
Reporterkgv Assigned Tobugmaster  
PrioritynormalSeverityfeature 
Status verifiedResolutionfixed 
Product Version7.8.1 
Target Version7.9.0Fixed in Version7.9.0 
Summary0032752: Visualization, TKOpenGl - extend V3d_View::ToPixMap() options with Z-layer
DescriptionCurrently `V3d_View::ToPixMap()` performs dump of complete frame with all Layers drawn.

This might be undesirable in some cases:
- Elements draw within `Graphic3d_ZLayerId_TopOSD` layer are usually not part of scene but rather transient information / auxiliary objects like View Cube, OSD.
- Dumping `Graphic3d_BT_Depth` is useless currently, as depth buffer filled by the main scene is cleared before drawing auxiliary OSD information.

Therefore, it is proposed extending parameters with `Graphic3d_ZLayerId`, which would define the latest Layer to be drawn before image dump.
This might also help debugging drawing procedures of specific Layers.

In addition, `V3d_View::ToPixMap()` could be also extended to allow dumping Shadow Map buffers (as extension of `Graphic3d_BufferType` enumeration).
TagsNo tags attached.
Test case numberv3d/bugs/bug32752

Attached Files

  • image.png (23,067 bytes)
  • OK_only_b1_depth.png (2,077 bytes)
  • Ok_only_b2.png (1,097 bytes)
  • OK_only_b2_depth.png (2,246 bytes)
  • OK_only_b3.png (853 bytes)
  • OK_only_b3_depth.png (1,537 bytes)
  • OK_only_b4.png (854 bytes)
  • OK_only_b4_depth.png (1,515 bytes)
  • OK_only_b5.png (752 bytes)
  • OK_only_b5_depth.png (1,312 bytes)
  • OK_only_b6.png (968 bytes)
  • OK_only_b6_depth.png (1,027 bytes)
  • OK_only_b7.png (766 bytes)
  • OK_only_b7_depth.png (1,027 bytes)
  • OK_upto_b1.png (1,591 bytes)
  • OK_upto_b1_depth.png (3,155 bytes)
  • OK_upto_b2.png (1,097 bytes)
  • OK_upto_b2_depth.png (2,246 bytes)
  • OK_upto_b3.png (1,745 bytes)
  • OK_upto_b3_depth.png (3,618 bytes)
  • OK_upto_b4.png (1,873 bytes)

Activities

git

2023-11-03 13:50

administrator   ~0114476

Branch CR32752 has been created by drochalo.

SHA-1: 60db7e24c92a04378ae2d895730f9e4affc93797


Detailed log of new commits:

Author: drochalo
Date: Fri Nov 3 10:48:11 2023 +0000

    0032752: Visualization, TKOpenGl - extend V3d_View::ToPixMap() options with Z-layer
    
    Added option to dump only a selection of zlayer's content.
    Changed zlayers redraw and render method for selection of layers to render.
    Added filters for layer parsing.
    Modified vdump command.
    Added test with multiple dumps for comparison.

git

2023-11-14 13:25

administrator   ~0114589

Branch CR32752 has been updated by drochalo.

SHA-1: 8b8a93123f425fbe85219b06aeabc9cac37bcd20


Detailed log of new commits:

Author: drochalo
Date: Tue Nov 14 10:23:36 2023 +0000

     0032752: Visualization, TKOpenGl - extend V3d_View::ToPixMap() options with Z-layer
    
    Added option to dump shadow maps.
    The dumping is made for each light that cast shadows.

git

2023-11-15 14:40

administrator   ~0114592

Branch CR32752 has been updated by drochalo.

SHA-1: d320f6bc5e59aba9ac005db37120b0f43a2918a4


Detailed log of new commits:

Author: drochalo
Date: Wed Nov 15 11:39:16 2023 +0000

    0032752: Visualization, TKOpenGl - extend V3d_View::ToPixMap() options with Z-layer
    
    Fixed logical test on OpenGl_FrameBuffer::BufferDump method.

git

2023-11-16 15:03

administrator   ~0114593

Branch CR32752 has been updated by drochalo.

SHA-1: 37e72c0a92c09ad15c799a7d73e51ad2b612260a


Detailed log of new commits:

Author: drochalo
Date: Thu Nov 16 12:01:28 2023 +0000

    0032752: Visualization, TKOpenGl - extend V3d_View::ToPixMap() options with Z-layer
    
    Moved test from opengl folder to v3d.
    Found incompatibility with opengles features.

mzernova

2023-11-16 21:17

developer   ~0114595

Please remove all functionality related to using the path and save the result in 'theImage'

// draw shadow maps
    TCollection_AsciiString aFilePath = ShadowMapFilePath();
    Standard_Boolean isShadowDumped = dumpShadowMaps (aFilePath);

mzernova

2023-11-16 21:39

developer   ~0114596

I don't think that we need so many flags here
Try to use "Standard_Boolean IsSingleLayer" instead.

 
 Standard_Integer      DumpMode;       //<! dump mode where [-1] calls default method, [0] renders up to targetZLaierId, [1] renders single zlayer (-1 by default)

mzernova

2023-11-16 21:47

developer   ~0114597

Last edited: 2023-11-16 21:53

Sorry, I don't understand the logic at this point
If you want to render specific ZLayer, then this condition is not fulfilled.
However, you pass the number of ZLayer to Render() function.
//to render a group or a single zlayer
  Standard_Boolean toRenderGroupOrSingle = myZLayerRedrawMode == -1 ? Standard_False : Standard_True;

  if (!toRenderGL && !toRenderGroupOrSingle)
  {
        ...
        myZLayers.Render (myWorkspace, theToDrawImmediate, OpenGl_LF_Bottom, myZLayerTarget, theReadDrawFbo, theOitAccumFbo);
        ...
  }

mzernova

2023-11-16 22:09

developer   ~0114598

Looks like you don't need "toRenderGroupOrSingle" here

git

2023-12-21 13:23

administrator   ~0114831

Branch CR32752 has been updated forcibly by drochalo.

SHA-1: 5669a89138e71c488d80dc4b8ab6322d35eed395

git

2023-12-22 12:49

administrator   ~0114836

Branch CR32752 has been updated by drochalo.

SHA-1: 17e63a03862ef5b9c726c04ccf20d103a73b771c


Detailed log of new commits:

Author: drochalo
Date: Fri Dec 22 09:49:09 2023 +0000

    0032752: Visualization, TKOpenGl - extend V3d_View::ToPixMap() options with Z-layer
    
    Code cleanup.

git

2023-12-22 14:29

administrator   ~0114837

Branch CR32752 has been updated forcibly by drochalo.

SHA-1: d1904a22bc9366bd7d0c7b26d06789a2cabd01dc

drochalo

2024-01-02 19:04

developer   ~0114847

Dear Marina,

please review.
Tests on Jenkins appear to be fine apart from a bug with a test that was removed and then placed in another place:
http://jenkins-test-10.nnov.opencascade.com/view/CR32752-master-drochalo/view/COMPARE/.

mzernova

2024-01-05 17:47

developer   ~0114864

Is there a need to add a new buffer type? It seems that all its characteristics are duplicated in Graphic3d_BT_Depth.
Graphic3d_BT_ShadowMap,           //!< buffer with shadow map


Extra spaces. Check the data type for ZLayerRedrawMode.
  //! Returns ZLayerId target
  Graphic3d_ZLayerId ZLayerTarget () const { return myZLayerTarget; }

  //! Sets ZLayerId target.
  void SetZLayerTarget (const Graphic3d_ZLayerId theTarget) { myZLayerTarget = theTarget; }

  //! Returns ZLayerId redraw mode
  Standard_Integer ZLayerRedrawMode () const { return myZLayerRedrawMode; }

  //! Sets ZLayerId redraw mode.
  void SetZLayerRedrawMode (const Standard_Integer theMode) { myZLayerRedrawMode = theMode; }


Why did you remove this check?
  if (theGlCtx->GraphicsLibrary() != Aspect_GraphicsLibrary_OpenGLES
   && theBufferType == Graphic3d_BT_Depth
   && aFormat != GL_DEPTH_COMPONENT)
  {
    return Standard_False;
  }


Check that this is necessary
aFormat.SetImageFormat (Image_Format_GrayF);

git

2024-01-05 19:51

administrator   ~0114869

Branch CR32752 has been updated by drochalo.

SHA-1: 192b1bcc41e00c74b1e3a6d3b528c9011398a170


Detailed log of new commits:

Author: drochalo
Date: Fri Jan 5 16:12:29 2024 +0000

    0032752: Visualization, TKOpenGl - extend V3d_View::ToPixMap() options with Z-layer
    
    Code cleanup.

git

2024-01-09 12:28

administrator   ~0114881

Branch CR32752 has been updated by drochalo.

SHA-1: f63eba508b9ac7fb6e38fcbe59f83f671b1c4eaa


Detailed log of new commits:

Author: drochalo
Date: Tue Jan 9 09:22:33 2024 +0000

    0032752: Visualization, TKOpenGl - extend V3d_View::ToPixMap() options with Z-layer
    
    Code cleanup.

drochalo

2024-01-11 12:16

developer   ~0114896

Dear Marina,

please review.
New tests after changes show no major issues (tests that failed relate to a tests that was added and removed but somehow is still being tested):
http://jenkins-test-10.nnov.opencascade.com/view/CR32752-master-drochalo/view/COMPARE/

mzernova

2024-04-02 14:15

developer   ~0115540

Dear Diogo,

Please provide expected results for test.
For example, here, as far as I understand, we expect to see 7 boxes in the depth dump image.
The same for bug32752_upto_b6_depth.png, bug32752_upto_b5_depth.png, bug32752_only_b7_depth.png, bug32752_only_b6_depth.png.

Correct me if I'm wrong.
image.png (23,067 bytes)

drochalo

2024-04-10 13:48

developer   ~0115675

Dear Marina, the expected results for the tests are in annex.

Due to the multi pass render on occt, where each zlayer has different properties the results present in http://jenkins-test-10.nnov.opencascade.com/view/CR32752-master-drochalo/view/COMPARE/ are correct.

Boxes b1 to b4 are in layers with depth test were the values of depth are kept from pass to pass.
b5 is on Graphic3d_ZLayerId_Topmost, and before render the values of the depth buffer are cleared and that's why only one box is shown in depth.
The other boxes b6 and b7 are on Graphic3d_ZLayerId_TopOSD and Graphic3d_ZLayerId_BotOSD respectively (layers for 2D presentations), and these layers do not have the depth test enabled. So the results for OK_upto_b5_depth, OK_upto_b6_depth and OK_upto_b7_depth are the same (only depth of b5 box is shown).
OK_only_b1_depth.png (2,077 bytes)
Ok_only_b2.png (1,097 bytes)
OK_only_b2_depth.png (2,246 bytes)
OK_only_b3.png (853 bytes)
OK_only_b3_depth.png (1,537 bytes)
OK_only_b4.png (854 bytes)
OK_only_b4_depth.png (1,515 bytes)
OK_only_b5.png (752 bytes)
OK_only_b5_depth.png (1,312 bytes)
OK_only_b6.png (968 bytes)
OK_only_b6_depth.png (1,027 bytes)
OK_only_b7.png (766 bytes)
OK_only_b7_depth.png (1,027 bytes)
OK_upto_b1.png (1,591 bytes)
OK_upto_b1_depth.png (3,155 bytes)
OK_upto_b2.png (1,097 bytes)
OK_upto_b2_depth.png (2,246 bytes)
OK_upto_b3.png (1,745 bytes)
OK_upto_b3_depth.png (3,618 bytes)
OK_upto_b4.png (1,873 bytes)

git

2024-04-16 01:24

administrator   ~0115712

Branch CR32752_1 has been created by mzernova.

SHA-1: db147e87421ef8dd71fde0666cc17062f7a8bba2


Detailed log of new commits:

Author: drochalo
Date: Fri Nov 3 10:48:11 2023 +0000

    0032752: Visualization, TKOpenGl - extend V3d_View::ToPixMap() options with Z-layer
    
    Added option to dump only a selection of zlayer's content.
    Changed zlayers redraw and render method for selection of layers to render.
    Added filters for layer parsing.
    Modified vdump command.
    Added test with multiple dumps for comparison.
    Added option to dump shadow maps.

mzernova

2024-04-16 01:38

developer   ~0115713

Dear bugmaster, please integrate

Test reports:
http://jenkins-test-10.nnov.opencascade.com/view/CR32752-master-mzernova/view/ALL/

For integration:
OCCT: CR32752_1
PROD: none

git

2024-07-17 12:55

administrator   ~0116201

Branch CR32752 has been deleted by vglukhik.

SHA-1: f63eba508b9ac7fb6e38fcbe59f83f671b1c4eaa

git

2024-07-17 12:55

administrator   ~0116202

Branch CR32752_1 has been deleted by vglukhik.

SHA-1: db147e87421ef8dd71fde0666cc17062f7a8bba2

Issue History

Date Modified Username Field Change
2021-12-28 10:49 kgv New Issue
2021-12-28 10:49 kgv Assigned To => kgv
2021-12-28 10:50 kgv Assigned To kgv => CheskoArt
2021-12-28 10:50 kgv Status new => assigned
2022-08-17 11:55 kgv Target Version 7.7.0 => 7.8.0
2023-08-01 15:09 dpasukhi Target Version 7.8.0 => Unscheduled
2023-10-27 19:21 drochalo Assigned To CheskoArt => drochalo
2023-11-03 13:50 git Note Added: 0114476
2023-11-14 13:25 git Note Added: 0114589
2023-11-15 14:40 git Note Added: 0114592
2023-11-16 15:03 git Note Added: 0114593
2023-11-16 21:17 mzernova Note Added: 0114595
2023-11-16 21:39 mzernova Note Added: 0114596
2023-11-16 21:47 mzernova Note Added: 0114597
2023-11-16 21:49 mzernova Note Edited: 0114597
2023-11-16 21:53 mzernova Note Edited: 0114597
2023-11-16 22:09 mzernova Note Added: 0114598
2023-12-21 13:23 git Note Added: 0114831
2023-12-22 12:49 git Note Added: 0114836
2023-12-22 14:29 git Note Added: 0114837
2024-01-02 19:04 drochalo Note Added: 0114847
2024-01-02 19:05 drochalo Assigned To drochalo => mzernova
2024-01-02 19:05 drochalo Status assigned => resolved
2024-01-02 19:05 drochalo Test case number => v3d/bugs/bug32752
2024-01-05 17:47 mzernova Note Added: 0114864
2024-01-05 17:47 mzernova Assigned To mzernova => drochalo
2024-01-05 17:47 mzernova Status resolved => assigned
2024-01-05 19:51 git Note Added: 0114869
2024-01-09 12:28 git Note Added: 0114881
2024-01-11 12:16 drochalo Note Added: 0114896
2024-01-11 12:17 drochalo Assigned To drochalo => mzernova
2024-01-11 12:17 drochalo Status assigned => resolved
2024-03-25 12:54 dpasukhi Product Version => 7.8.1
2024-03-25 12:54 dpasukhi Target Version Unscheduled => 7.9.0
2024-04-02 14:15 mzernova Note Added: 0115540
2024-04-02 14:15 mzernova File Added: image.png
2024-04-02 14:15 mzernova Assigned To mzernova => drochalo
2024-04-02 14:15 mzernova Status resolved => assigned
2024-04-10 13:48 drochalo Note Added: 0115675
2024-04-10 13:48 drochalo File Added: OK_only_b1_depth.png
2024-04-10 13:48 drochalo File Added: Ok_only_b2.png
2024-04-10 13:48 drochalo File Added: OK_only_b2_depth.png
2024-04-10 13:48 drochalo File Added: OK_only_b3.png
2024-04-10 13:48 drochalo File Added: OK_only_b3_depth.png
2024-04-10 13:48 drochalo File Added: OK_only_b4.png
2024-04-10 13:48 drochalo File Added: OK_only_b4_depth.png
2024-04-10 13:48 drochalo File Added: OK_only_b5.png
2024-04-10 13:48 drochalo File Added: OK_only_b5_depth.png
2024-04-10 13:48 drochalo File Added: OK_only_b6.png
2024-04-10 13:48 drochalo File Added: OK_only_b6_depth.png
2024-04-10 13:48 drochalo File Added: OK_only_b7.png
2024-04-10 13:48 drochalo File Added: OK_only_b7_depth.png
2024-04-10 13:48 drochalo File Added: OK_upto_b1.png
2024-04-10 13:48 drochalo File Added: OK_upto_b1_depth.png
2024-04-10 13:48 drochalo File Added: OK_upto_b2.png
2024-04-10 13:48 drochalo File Added: OK_upto_b2_depth.png
2024-04-10 13:48 drochalo File Added: OK_upto_b3.png
2024-04-10 13:48 drochalo File Added: OK_upto_b3_depth.png
2024-04-10 13:48 drochalo File Added: OK_upto_b4.png
2024-04-10 13:49 drochalo Assigned To drochalo => mzernova
2024-04-10 13:49 drochalo Status assigned => resolved
2024-04-16 01:24 git Note Added: 0115712
2024-04-16 01:38 mzernova Assigned To mzernova => bugmaster
2024-04-16 01:38 mzernova Status resolved => reviewed
2024-04-16 01:38 mzernova Note Added: 0115713
2024-07-05 17:44 dpasukhi Status reviewed => verified
2024-07-05 17:44 dpasukhi Resolution open => fixed
2024-07-05 17:44 dpasukhi Fixed in Version => 7.9.0
2024-07-17 12:55 git Note Added: 0116201
2024-07-17 12:55 git Note Added: 0116202