View Issue Details

IDProjectCategoryView StatusLast Update
0029366Open CASCADEOCCT:Visualizationpublic2019-09-18 10:08
Reporterkgv Assigned Tobugmaster  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version5.2.2 
Target Version7.3.0Fixed in Version7.3.0 
Summary0029366: Visualization, OpenGl_Text - artifacts when using Aspect_TODT_SHADOW/Aspect_TODT_DEKALE at different zoom level
DescriptionArtifacts occur when using Aspect_TODT_SHADOW or Aspect_TODT_DEKALE at different zoom levels - the shadow/decal changes its position.

The reason is the fixed Z shift 0.00001f specified in world coordinate system, intended to ensure that decal/shadow will be drawn behind text (avoid Z-fighting):
    case Aspect_TODT_DEKALE:
    {
      theCtx->SetColor4fv (theColorSubs);
      setupMatrix (theCtx, theTextAspect, OpenGl_Vec3 (+1.0f, +1.0f, 0.00001f));
      drawText    (theCtx, theTextAspect);
      setupMatrix (theCtx, theTextAspect, OpenGl_Vec3 (-1.0f, -1.0f, 0.00001f));
      drawText    (theCtx, theTextAspect);
      setupMatrix (theCtx, theTextAspect, OpenGl_Vec3 (-1.0f, +1.0f, 0.00001f));
      drawText    (theCtx, theTextAspect);
      setupMatrix (theCtx, theTextAspect, OpenGl_Vec3 (+1.0f, -1.0f, 0.00001f));
      drawText    (theCtx, theTextAspect);
      break;
    }
    case Aspect_TODT_SHADOW:
    {
      theCtx->SetColor4fv (theColorSubs);
      setupMatrix (theCtx, theTextAspect, OpenGl_Vec3 (+1.0f, -1.0f, 0.00001f));
      drawText    (theCtx, theTextAspect);
      break;
    }
Steps To ReproduceN/A

pload MODELING VISUALIZATION
box b 1 2 3
vclear
vinit View1
vsetdispmode 1
vdisplay b
vcamera -persp
vfit
vdrawtext t "Text"  -2d -persPos -1 1 -subColor BLUE1 -pos 0 -100 0 -color 0 1 1 -height 20 -font Times -dispType decal
vzoom 2
vzoom 2
TagsNo tags attached.
Test case numberNot required

Attached Files

  • occ_text_shadow_KO.png (85,518 bytes)
  • occ_text_shadow_OK.png (94,442 bytes)

Relationships

related to 0029346 closedbugmaster Visualization, TKOpenGl - collect frame statistics 
parent of 0030978 closedbugmaster Visualization - stack-use-after-scope reported by Clang address sanitizer in OpenGl_Text.cxx 

Activities

kgv

2017-12-04 15:25

developer  

occ_text_shadow_KO.png (85,518 bytes)

kgv

2017-12-04 15:26

developer  

occ_text_shadow_OK.png (94,442 bytes)

git

2017-12-04 16:31

administrator   ~0072690

Branch CR29366 has been created by kgv.

SHA-1: d94c97627b6ba2c82079ecc30d44a641abea87e9


Detailed log of new commits:

Author: kgv
Date: Mon Dec 4 16:29:43 2017 +0300

    0029366: Visualization, OpenGl_Text - artifacts when using Aspect_TODT_SHADOW/Aspect_TODT_DEKALE at different zoom level
    
    OpenGl_Text now applies Polygon Offset instead of Z-shift in world coordinates for drawing background.
    OpenGl_Context::SetPolygonOffset() - polygon offset state has been moved from OpenGl_Workspace to OpenGl_Context.

git

2017-12-04 19:44

administrator   ~0072701

Branch CR29366_1 has been created by kgv.

SHA-1: 1c3696c6edcf092a6457aec8824e0015348c3b6b


Detailed log of new commits:

Author: kgv
Date: Mon Dec 4 16:29:43 2017 +0300

    0029366: Visualization, OpenGl_Text - artifacts when using Aspect_TODT_SHADOW/Aspect_TODT_DEKALE at different zoom level
    
    OpenGl_Text now applies Polygon Offset instead of Z-shift in world coordinates for drawing background.
    OpenGl_Context::SetPolygonOffset() - polygon offset state has been moved from OpenGl_Workspace to OpenGl_Context.

kgv

2017-12-04 19:48

developer   ~0072703

Last edited: 2017-12-05 10:58

Patch is ready for review.
http://jenkins-test-10.nnov.opencascade.com/view/CR29366_1-master-KGV

Note that using Polygon Offset impacts text rendering performance negatively (in case of affected text styles), which is expected due to extra OpenGL calls.

git

2017-12-04 20:05

administrator   ~0072705

Branch CR29366_1 has been updated forcibly by kgv.

SHA-1: 51e76065cacd3c05d387d86b48917c5431e4f117

san

2017-12-05 19:14

developer   ~0072729

Branch CR29366_1 reviewed without remarks, ready for testing.

bugmaster

2017-12-05 19:38

administrator   ~0072730

Combination -
OCCT branch : CR29366_1 SHA - 51e76065cacd3c05d387d86b48917c5431e4f117
Products branch : master SHA - 415c5096b9b013d1fad1454581bcdbe1e6090b5d
was compiled on Linux, MacOS and Windows platforms and tested on optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian70-64:
OCCT
Total CPU difference: 18374.739999999685 / 18469.379999999688 [-0.51%]
Products
Total CPU difference: 7467.210000000008 / 7457.550000000003 [+0.13%]
Windows-64-VC10:
OCCT
Total CPU difference: 17961.26873559861 / 17828.96428749855 [+0.74%]
Products
Total CPU difference: 8014.161372499974 / 8009.6685436999705 [+0.06%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention

git

2017-12-11 12:00

administrator   ~0072899

Branch CR29366 has been deleted by kgv.

SHA-1: d94c97627b6ba2c82079ecc30d44a641abea87e9

git

2017-12-11 12:00

administrator   ~0072900

Branch CR29366_1 has been deleted by kgv.

SHA-1: 51e76065cacd3c05d387d86b48917c5431e4f117

Related Changesets

occt: master 8d1a539c

2017-12-04 13:29:43

kgv


Committer: bugmaster Details Diff
0029366: Visualization, OpenGl_Text - artifacts when using Aspect_TODT_SHADOW/Aspect_TODT_DEKALE at different zoom level

OpenGl_Text now applies Polygon Offset instead of Z-shift in world coordinates for drawing background.
OpenGl_Context::SetPolygonOffset() - polygon offset state has been moved from OpenGl_Workspace to OpenGl_Context.
Affected Issues
0029366
mod - src/OpenGl/OpenGl_Context.cxx Diff File
mod - src/OpenGl/OpenGl_Context.hxx Diff File
mod - src/OpenGl/OpenGl_Layer.cxx Diff File
mod - src/OpenGl/OpenGl_Text.cxx Diff File
mod - src/OpenGl/OpenGl_Workspace.cxx Diff File
mod - src/OpenGl/OpenGl_Workspace.hxx Diff File

Issue History

Date Modified Username Field Change
2017-12-04 15:25 kgv New Issue
2017-12-04 15:25 kgv Assigned To => kgv
2017-12-04 15:25 kgv File Added: occ_text_shadow_KO.png
2017-12-04 15:26 kgv File Added: occ_text_shadow_OK.png
2017-12-04 15:26 kgv Relationship added related to 0029346
2017-12-04 16:31 git Note Added: 0072690
2017-12-04 19:44 git Note Added: 0072701
2017-12-04 19:48 kgv Note Added: 0072703
2017-12-04 19:48 kgv Assigned To kgv => san
2017-12-04 19:48 kgv Status new => resolved
2017-12-04 20:05 git Note Added: 0072705
2017-12-05 09:53 kgv Steps to Reproduce Updated
2017-12-05 10:10 kgv Product Version 7.4.0 => 5.2.2
2017-12-05 10:58 kgv Note Edited: 0072703
2017-12-05 19:14 san Note Added: 0072729
2017-12-05 19:14 san Assigned To san => bugmaster
2017-12-05 19:14 san Status resolved => reviewed
2017-12-05 19:38 bugmaster Note Added: 0072730
2017-12-05 19:38 bugmaster Status reviewed => tested
2017-12-05 19:39 bugmaster Test case number => Not required
2017-12-08 23:00 bugmaster Changeset attached => occt master 8d1a539c
2017-12-08 23:00 bugmaster Status tested => verified
2017-12-08 23:00 bugmaster Resolution open => fixed
2017-12-11 12:00 git Note Added: 0072899
2017-12-11 12:00 git Note Added: 0072900
2018-02-20 12:58 aiv Target Version 7.4.0 => 7.3.0
2018-06-29 21:15 aiv Fixed in Version => 7.3.0
2018-06-29 21:19 aiv Status verified => closed
2019-09-18 10:08 kgv Relationship added parent of 0030978