MantisBT - Community
View Issue Details
0030744Community[OCCT] OCCT:Visualizationpublic2019-05-25 15:592019-07-29 09:59
Vico Liang 
bugmaster 
normalminor 
verifiedfixed 
 
[OCCT] 7.4.0 
Not required
0030744: Visualization, TKOpenGl - stipple line does not work on OpenGL ES 2.0
Get the code from git master and build it with QTANGLE GLES2. The line with Aspect_TOL_DASH displayed as solid line.

The QTANGLE is from QT5.12.3, use build provided with QT installation.
Inlucde Path: Qt5.12.3\5.12.3\winrt_x64_msvc2017\include\QtANGLE
Lib path: Qt5.12.3\5.12.3\winrt_x64_msvc2017\lib
Bin path: Qt5.12.3\5.12.3\winrt_x64_msvc2017\bin
pload MODELING VISUALIZATION
box b 1 2 3
vclear
vinit View1
vglinfo
vdisplay -dispMode 0 b
vaxo
vfit
vaspects b -setLineType DASH
No tags attached.
related to 0030745verified bugmaster Open CASCADE Visualization, TKOpenGl - fix initialization of GLES3 context 
Issue History
2019-05-25 15:59Vico LiangNew Issue
2019-05-25 15:59Vico LiangAssigned To => kgv
2019-05-25 19:08kgvRelationship addedrelated to 0030745
2019-05-25 19:39kgvSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=21260#r21260
2019-05-25 20:33kgvNote Added: 0084619
2019-05-25 20:33kgvAssigned Tokgv => Vico Liang
2019-05-25 20:33kgvStatusnew => feedback
2019-05-26 06:28Vico LiangNote Added: 0084620
2019-05-26 06:42Vico LiangAssigned ToVico Liang => kgv
2019-05-26 06:43Vico LiangStatusfeedback => assigned
2019-05-26 09:02kgvNote Added: 0084621
2019-05-26 09:02kgvAssigned Tokgv => Vico Liang
2019-05-26 09:02kgvStatusassigned => feedback
2019-05-26 09:06kgvNote Edited: 0084621bug_revision_view_page.php?bugnote_id=84621#r21267
2019-05-26 09:43kgvNote Edited: 0084621bug_revision_view_page.php?bugnote_id=84621#r21268
2019-05-26 11:12Vico LiangNote Edited: 0084620bug_revision_view_page.php?bugnote_id=84620#r21270
2019-05-26 11:42Vico LiangNote Added: 0084642
2019-05-26 11:45Vico LiangAssigned ToVico Liang => kgv
2019-05-26 11:45Vico LiangStatusfeedback => assigned
2019-05-26 13:33kgvNote Added: 0084645
2019-05-26 14:32Vico LiangNote Added: 0084649
2019-05-26 14:51kgvNote Added: 0084650
2019-05-26 17:15Vico LiangNote Added: 0084651
2019-05-27 10:27kgvNote Added: 0084653
2019-05-27 11:41Vico LiangNote Added: 0084657
2019-05-27 11:44Vico LiangNote Edited: 0084657bug_revision_view_page.php?bugnote_id=84657#r21274
2019-06-21 17:41Vico LiangNote Added: 0085208
2019-06-21 18:28Vico LiangNote Edited: 0085208bug_revision_view_page.php?bugnote_id=85208#r21409
2019-07-09 06:22Vico LiangNote Added: 0085505
2019-07-19 16:34kgvSummaryVisualization - GLES display dot line as solid line on UWP => Visualization, TKOpenGl - stipple line does not work on OpenGL ES 2.0
2019-07-19 16:37gitNote Added: 0085798
2019-07-19 17:12gitNote Added: 0085805
2019-07-19 17:14kgvNote Added: 0085806
2019-07-19 17:14kgvAssigned Tokgv => osa
2019-07-19 17:14kgvStatusassigned => resolved
2019-07-19 17:25gitNote Added: 0085807
2019-07-23 10:10Vico LiangNote Added: 0085859
2019-07-23 10:22osaNote Added: 0085860
2019-07-23 10:22osaAssigned Toosa => bugmaster
2019-07-23 10:22osaStatusresolved => reviewed
2019-07-24 19:17bugmasterTest case number => Not required
2019-07-24 19:18bugmasterNote Added: 0085872
2019-07-24 19:18bugmasterStatusreviewed => tested
2019-07-26 06:14gitNote Added: 0085878
2019-07-26 06:22gitNote Added: 0085879
2019-07-26 06:23gitNote Added: 0085880
2019-07-26 08:59kgvNote Added: 0085881
2019-07-28 11:02bugmasterChangeset attached => occt master 59515ca6
2019-07-28 11:02bugmasterStatustested => verified
2019-07-28 11:02bugmasterResolutionopen => fixed
2019-07-29 09:59gitNote Added: 0085928
2019-07-29 09:59gitNote Added: 0085929

Notes
(0084619)
kgv   
2019-05-25 20:33   
Try patch in branch CR30745.
(0084620)
Vico Liang   
2019-05-26 06:28   
(edited on: 2019-05-26 11:12)
Dear kgv, I tried the patch CR30745, the lines with dash style are still presented as solid. I'm using UWP, QTANGLE from QT5.12.3. The issue can be reproduced on Device Microsoft Surface and simulator of VS2017.

(0084621)
kgv   
2019-05-26 09:02   
(edited on: 2019-05-26 09:43)
Please provide sample reproducing the issue and diagnostic output about OpenGL ES version reported by application.
QTANGLE should support OpenGL ES 3.0 on Direct3D 11 capable devices.
Maybe this problem is specific to Simulator only?

(0084642)
Vico Liang   
2019-05-26 11:42   
There is no sample to reproducing the issue since we're developing a complex product, it's not easy to make it a sample to reproduce the issue. Neither on device nor simulator works. The diagnostic output on simulator as below:

EGLVersion : 1.4 (ANGLE 2.1.0.57ea533f79a7)

EGLVendor : Google Inc. (adapter LUID: 000000000001720c)

EGLClientAPIs : OpenGL_ES

EGLExtensions : EGL_EXT_create_context_robustness EGL_ANGLE_d3d_share_handle_client_buffer EGL_ANGLE_d3d_texture_client_buffer EGL_ANGLE_surface_d3d_texture_2d_share_handle EGL_ANGLE_query_surface_pointer EGL_ANGLE_window_fixed_size EGL_ANGLE_keyed_mutex EGL_ANGLE_surface_orientation EGL_NV_post_sub_buffer EGL_KHR_create_context EGL_EXT_device_query EGL_KHR_image EGL_KHR_image_base EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_KHR_get_all_proc_addresses EGL_KHR_stream EGL_KHR_stream_consumer_gltexture EGL_NV_stream_consumer_gltexture_yuv EGL_ANGLE_flexible_surface_compatibility EGL_ANGLE_stream_producer_d3d_texture_nv12 EGL_ANGLE_create_context_webgl_compatibility EGL_CHROMIUM_create_context_bind_generates_resource EGL_EXT_pixel_format_float EGL_KHR_surfaceless_context EGL_ANGLE_display_texture_share_group EGL_ANGLE_create_context_client_arrays EGL_ANGLE_program_cache_control EGL_ANGLE_robust_resource_initialization

GLvendor : Google Inc.

GLdevice : ANGLE (Intel(R) HD Graphics 630 Direct3D11 vs_5_0 ps_5_0)

GLversion : OpenGL ES 2.0 (ANGLE 2.1.0.57ea533f79a7)

GLSLversion : OpenGL ES GLSL ES 1.00 (ANGLE 2.1.0.57ea533f79a7)

Max texture size : 16384

Max FBO dump size : 16384x16384

Max combined texture units : 32

Max MSAA samples : 0

Viewport : 1280x960

GLextensions : GL_ANGLE_client_arrays GL_ANGLE_depth_texture GL_ANGLE_framebuffer_blit GL_ANGLE_framebuffer_multisample GL_ANGLE_instanced_arrays GL_ANGLE_lossy_etc_decode GL_ANGLE_pack_reverse_row_order GL_ANGLE_program_cache_control GL_ANGLE_request_extension GL_ANGLE_robust_client_memory GL_ANGLE_texture_compression_dxt3 GL_ANGLE_texture_compression_dxt5 GL_ANGLE_texture_usage GL_ANGLE_translated_shader_source GL_CHROMIUM_bind_generates_resource GL_CHROMIUM_bind_uniform_location GL_CHROMIUM_color_buffer_float_rgb GL_CHROMIUM_color_buffer_float_rgba GL_CHROMIUM_copy_compressed_texture GL_CHROMIUM_copy_texture GL_CHROMIUM_sync_query GL_EXT_blend_minmax GL_EXT_color_buffer_half_float GL_EXT_debug_marker GL_EXT_discard_framebuffer GL_EXT_disjoint_timer_query GL_EXT_draw_buffers GL_EXT_frag_depth GL_EXT_map_buffer_range GL_EXT_occlusion_query_boolean GL_EXT_read_format_bgra GL_EXT_robustness GL_EXT_sRGB GL_EXT_shader_texture_lod GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_s3tc_srgb GL_EXT_texture_filter_anisotropic GL_EXT_texture_format_BGRA8888 GL_EXT_texture_rg GL_EXT_texture_storage GL_EXT_unpack_subimage GL_KHR_debug GL_NV_EGL_stream_consumer_external GL_NV_fence GL_NV_pack_subimage GL_NV_pixel_buffer_object GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth32 GL_OES_element_index_uint GL_OES_get_program_binary GL_OES_mapbuffer GL_OES_packed_depth_stencil GL_OES_rgb8_rgba8 GL_OES_standard_derivatives GL_OES_surfaceless_context GL_OES_texture_float GL_OES_texture_float_linear GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_texture_npot GL_OES_vertex_array_object

ResolutionRatio : 1
(0084645)
kgv   
2019-05-26 13:33   
What is the code initializing OpenGL ES context then?
(0084649)
Vico Liang   
2019-05-26 14:32   
The code initialization OpenGL ES context is almost the same as QtAndroid sample.
(0084650)
kgv   
2019-05-26 14:51   
So this is Qt that initializes OpenGL ES?

In that case, it might be required playing with QSurfaceFormat in similar way as patch for 0030745 does:
void AndroidQt::handleWindowChanged (QQuickWindow* theWin)
{
  ...
  QSurfaceFormat aGlFormat;
  aGlFormat.setVersion (3, 0);
  theWin->setFormat (aGlFormat);
}
(0084651)
Vico Liang   
2019-05-26 17:15   
Dear kgv, It works after do it as your propose. we need to initialized OpenGL ES 3.0 explicitly. so What's the behavior if the driver don't support OpenGL 3.0? will it still work if the version lower than 3.0? Thanks for your help.
(0084653)
kgv   
2019-05-27 10:27   
> so What's the behavior if the driver don't support OpenGL 3.0?
That will do Qt depends on Qt, but I suppose that it will initialize an OpenGL ES 2.0 as fallback, because they don't have an advanced context selector interface and provide only "hints".

What will do OCCT 3D Viewer - it will work with OpenGL ES 2.0 with limitations (like unsupported stipple lines). Deciding upon it is a critical issue for application depends on how these stipple lines are using in application - so that you may consider disallowing starting an application on older devices or emitting a warning.

It should be technically possible implementing a fallback code for stipple lines for obsolete OpenGL ES 2.0 devices. OpenGL ES 3.0 has been released in '2012, that is - 7 years ago.
(0084657)
Vico Liang   
2019-05-27 11:41   
(edited on: 2019-05-27 11:44)
>It should be technically possible implementing a fallback code for stipple lines for obsolete OpenGL ES 2.0 devices. OpenGL ES 3.0 has been released in '2012, that is - 7 years ago.
It would be great if OCCT have such fallback. Most devices should support OpenGL ES 3.0, so this may not worth to maintain compatible with obsolete devices.

Thanks for your suggestion and help.

(0085208)
Vico Liang   
2019-06-21 17:41   
(edited on: 2019-06-21 18:28)
Dear kgv,

We do have such device with OpenGL ES 2.0, the details device as below:

Device: ZenFone 6 (A601CG) (ASUS_Z002)
Manufacturer: Asus
Device type: Phone
Device language: Portuguese
CPU make: Intel
CPU model: Z2560
Native platform: x86, armeabi-v7a, armeabi
RAM (MB): 2048
Screen size: 720 × 1280
Screen density (DPI): 320
OpenGL ES version: 2.0
OS: Android 5.0

Do you think it's possible to do support on OpenGL ES 2.0?

(0085505)
Vico Liang   
2019-07-09 06:22   
Though OpenGL ES 3.0 has been released in 2012, OpenGL ES 2.0 devices will still remain on the market for some time. The essential feature such as line type, line style should not rely on higher version than OpenGL ES 2.0.
(0085798)
git   
2019-07-19 16:37   
Branch CR30744 has been created by kgv.

SHA-1: 905a2a821e40720a4474ab792b21241cd64aa491


Detailed log of new commits:

Author: kgv
Date: Fri Jul 19 16:35:23 2019 +0300

    0030744: Visualization, TKOpenGl - stipple line does not work on OpenGL ES 2.0
    
    OpenGl_ShaderManager now provides fallback stipple lines GLSL code for obsolete OpenGL ES 2.0 devices.
    OpenGl_Caps has been extended by flags disallowing OpenGL extensions usage
    and restricting upper OpenGL version to be used by OCCT for testing purposes.
(0085805)
git   
2019-07-19 17:12   
Branch CR30744 has been updated forcibly by kgv.

SHA-1: 66b229052d560d253619f3d778f1235bd3aca61d
(0085806)
kgv   
2019-07-19 17:14   
Patch is ready for review.


Tested only on Angle OpenGL ES 2.0 implementation.
Dear Vico, please comment if you can test patch on another OpenGL ES 2.0 implementations.
(0085807)
git   
2019-07-19 17:25   
Branch CR30744 has been updated forcibly by kgv.

SHA-1: d3cf0649c8618641bc37280b0eb6cbb4934db171
(0085859)
Vico Liang   
2019-07-23 10:10   
Dear kgv, I got the patch, it works well on OpenGL ES 2.0 device. Thank you for the fix.
(0085860)
osa   
2019-07-23 10:22   
The patch was reviewed
(0085872)
bugmaster   
2019-07-24 19:18   
Issue was tested in framework of WEEK-30 branch

Combination -
OCCT branch : WEEK-30
master SHA - 5fb2bf558aed386d8816dae659ee11c6bf5ba0aa
5f5b1aed1c6e139bbd34314eca77ae7abcd8895c
Products branch : WEEK-30 SHA - d966496d8a7f2f30129bc3e7ddfb9e1703047d4c
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian80-64:
OCCT
Total CPU difference: 10212.6700000002 / 10194.520000000162 [+0.18%]
Products
Total CPU difference: 10480.190000000039 / 10488.820000000036 [-0.08%]
Windows-64-VC14:
OCCT
Total CPU difference: 17629.5 / 17670.21875 [-0.23%]
Products
Total CPU difference: 12066.203125 / 12174.703125 [-0.89%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
(0085878)
git   
2019-07-26 06:14   
Branch CR30744 has been updated by kgv.

SHA-1: 6ca93e7db9fc1bde68f5300fd9bd5f1fc7fd5ac9


Detailed log of new commits:

Author: kgv
Date: Fri Jul 26 06:12:45 2019 +0300

    # fetch uniform location beforehand

(0085879)
git   
2019-07-26 06:22   
Branch CR30744 has been updated by kgv.

SHA-1: d99a4276a872039b2766d77e7f1ba50218da4ba3


Detailed log of new commits:

Author: kgv
Date: Fri Jul 26 06:20:50 2019 +0300

    # cache line stipple uniforms locations

(0085880)
git   
2019-07-26 06:23   
Branch CR30744_1 has been created by kgv.

SHA-1: 4160a5424b4009504ecc2d700ef5d4f21144a940


Detailed log of new commits:

Author: kgv
Date: Fri Jul 19 16:35:23 2019 +0300

    0030744: Visualization, TKOpenGl - stipple line does not work on OpenGL ES 2.0
    
    OpenGl_ShaderManager now provides fallback stipple lines GLSL code for obsolete OpenGL ES 2.0 devices.
    OpenGl_Caps has been extended by flags disallowing OpenGL extensions usage
    and restricting upper OpenGL version to be used by OCCT for testing purposes.
(0085881)
kgv   
2019-07-26 08:59   
Please take updated patch into IR.
(0085928)
git   
2019-07-29 09:59   
Branch CR30744_1 has been deleted by inv.

SHA-1: 4160a5424b4009504ecc2d700ef5d4f21144a940
(0085929)
git   
2019-07-29 09:59   
Branch CR30744 has been deleted by inv.

SHA-1: d99a4276a872039b2766d77e7f1ba50218da4ba3