MantisBT - Open CASCADE
View Issue Details
0029366Open CASCADE[OCCT] OCCT:Visualizationpublic2017-12-04 15:252019-09-18 10:08
kgv 
bugmaster 
normalminor 
closedfixed 
[OCCT] 5.2.2 
[OCCT] 7.3.0[OCCT] 7.3.0 
Not required
0029366: Visualization, OpenGl_Text - artifacts when using Aspect_TODT_SHADOW/Aspect_TODT_DEKALE at different zoom level
Artifacts 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;
    }
N/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
No tags attached.
related to 0029346closed bugmaster Visualization, TKOpenGl - collect frame statistics 
parent of 0030978closed bugmaster Visualization - stack-use-after-scope reported by Clang address sanitizer in OpenGl_Text.cxx 
png occ_text_shadow_KO.png (85,518) 2017-12-04 15:25
https://tracker.dev.opencascade.org/
png occ_text_shadow_OK.png (94,442) 2017-12-04 15:26
https://tracker.dev.opencascade.org/
Issue History
2017-12-04 15:25kgvNew Issue
2017-12-04 15:25kgvAssigned To => kgv
2017-12-04 15:25kgvFile Added: occ_text_shadow_KO.png
2017-12-04 15:26kgvFile Added: occ_text_shadow_OK.png
2017-12-04 15:26kgvRelationship addedrelated to 0029346
2017-12-04 16:31gitNote Added: 0072690
2017-12-04 19:44gitNote Added: 0072701
2017-12-04 19:48kgvNote Added: 0072703
2017-12-04 19:48kgvAssigned Tokgv => san
2017-12-04 19:48kgvStatusnew => resolved
2017-12-04 20:05gitNote Added: 0072705
2017-12-05 09:53kgvSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=18294#r18294
2017-12-05 10:10kgvProduct Version7.4.0 => 5.2.2
2017-12-05 10:58kgvNote Edited: 0072703bug_revision_view_page.php?bugnote_id=72703#r18296
2017-12-05 19:14sanNote Added: 0072729
2017-12-05 19:14sanAssigned Tosan => bugmaster
2017-12-05 19:14sanStatusresolved => reviewed
2017-12-05 19:38bugmasterNote Added: 0072730
2017-12-05 19:38bugmasterStatusreviewed => tested
2017-12-05 19:39bugmasterTest case number => Not required
2017-12-08 23:00bugmasterChangeset attached => occt master 8d1a539c
2017-12-08 23:00bugmasterStatustested => verified
2017-12-08 23:00bugmasterResolutionopen => fixed
2017-12-11 12:00gitNote Added: 0072899
2017-12-11 12:00gitNote Added: 0072900
2018-02-20 12:58aivTarget Version7.4.0 => 7.3.0
2018-06-29 21:15aivFixed in Version => 7.3.0
2018-06-29 21:19aivStatusverified => closed
2019-09-18 10:08kgvRelationship addedparent of 0030978

Notes
(0072690)
git   
2017-12-04 16:31   
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.
(0072701)
git   
2017-12-04 19:44   
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.
(0072703)
kgv   
2017-12-04 19:48   
(edited on: 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.

(0072705)
git   
2017-12-04 20:05   
Branch CR29366_1 has been updated forcibly by kgv.

SHA-1: 51e76065cacd3c05d387d86b48917c5431e4f117
(0072729)
san   
2017-12-05 19:14   
Branch CR29366_1 reviewed without remarks, ready for testing.
(0072730)
bugmaster   
2017-12-05 19:38   
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
(0072899)
git   
2017-12-11 12:00   
Branch CR29366 has been deleted by kgv.

SHA-1: d94c97627b6ba2c82079ecc30d44a641abea87e9
(0072900)
git   
2017-12-11 12:00   
Branch CR29366_1 has been deleted by kgv.

SHA-1: 51e76065cacd3c05d387d86b48917c5431e4f117