View Issue Details

IDProjectCategoryView StatusLast Update
0025282Open CASCADEOCCT:Visualizationpublic2019-04-17 14:11
Reporterkgv Assigned Tobugmaster  
PrioritynormalSeverityfeature 
Status closedResolutionfixed 
Target Version6.8.0Fixed in Version6.8.0 
Summary0025282: Visualization, OpenGl_PrimitiveArray - provide built-in GLSL programs as alternative to FFP
DescriptionSome systems do not provide complete compatibility with old FFP (fixed-function pipeline) in their OpenGL implementations. TKOpenGl provides API for user-provided GLSL programs, however there are no built-in replacement for standard functionality.
TagsNo tags attached.
Test case numberNot needed

Relationships

parent of 0025304 closedbugmaster Open CASCADE Visualization, TKOpenGl - support texturing within built-in GLSL programs 
parent of 0025305 closedbugmaster Open CASCADE Visualization, TKOpenGl - support stipple line aspects within built-in GLSL programs 
parent of 0025303 closedbugmaster Open CASCADE Visualization, TKOpenGl - dynamically disable unused light sources in generated GLSL program 
parent of 0025474 closedbugmaster Open CASCADE Visualization, TKOpenGl - support lighting + colored vertices within built-in GLSL programs 
parent of 0025539 closedbugmaster Open CASCADE Visualization, TKOpenGl - support environmental texture within built-in GLSL programs 
parent of 0025328 closedbugmaster Open CASCADE Visualization, TKOpenGl - support text rendering within built-in GLSL programs 
parent of 0026012 closedbugmaster Open CASCADE Visualization, TKOpenGl - fix misprints in detection of high precision floats within OpenGL ES 2.0 
parent of 0026122 closedbugmaster Community Visualization, TKOpenGl - clipping and capping is broken when ffp is disabled on Linux 
parent of 0030126 assignedngavrilo Open CASCADE Visualization, Graphic3d_ShaderManager - define standard Lighting & Clipping within custom GLSL programs as template functions 
related to 0025301 closedbugmaster Open CASCADE Visualization, TKOpenGl - transpose matrix manually before glUniformMatrix4fv() 
related to 0025822 closedbugmaster Open CASCADE Visualization, TKOpenGl - front material should be used instead of back material in GLSL when distinguish mode is turned off 
related to 0030631 newvpozdyayev Open CASCADE Visualization - Vulkan graphic driver prototype 
child of 0025146 closedbugmaster Open CASCADE Porting to Android 
child of 0024838 closedbugmaster Open CASCADE Visualization, TKOpenGl - make general rendering path compatible with OpenGL 3.1+ core profiles 
Not all the children of this issue are yet resolved or closed.

Activities

git

2014-09-28 22:19

administrator   ~0032276

Branch CR25282 has been created by kgv.

SHA-1: 1353e5ea1a8e566241f2eb096e0099202c29de1d


Detailed log of new commits:

Author: kgv
Date: Sun Sep 28 22:18:08 2014 +0300

    0025282: Visualization, OpenGl_PrimitiveArray - provide built-in GLSL programs as alternative to FFP
    
    Enumerations Visual3d_TypeOfModel, V3d_TypeOfShadingModel.
    - Remove unused values V3d_MULTICOLOR, V3d_HIDDEN, Visual3d_TOM_INTERP_COLOR.
    - Add per-pixel shading mode - V3d_PHONG, Visual3d_TOM_FRAGMENT.
    
    Draw Harness command vrenderparams.
    Add option -shadingModel to setup Shading Model.
    
    OpenGl_Caps::ffpEnable - new option to switch FFP/built-in GLSL programs.
    OpenGl_ShaderManager - add built-in GLSL programs.
    
    Draw Harness command vcaps.
    - Fix command syntax to meet coding rules.
    - Add option -ffp to activate/disable built-in GLSL programs.
    
    GLSL API changes.
    - Rename vertex attribute occColor -> occVertColor.
    - Introduce vec4 occColor uniform variable for light-less shaders.
    - Introduce float occPointSize uniform variable for marker programs.
    
    OpenGl_VertexBuffer::bindAttribute() - activate normalization for non-GL_FLOAT types,
    since color attribute is defined as 32-bit vector of 4 unsigned byte values.
    
    OpenGl_Context - add methods SetColor4fv() and SetPointSize()
    for parameters redirection to active GLSL program
    (as alternative to glColor4fv() and glPointSize()).
    
    OpenGl_ShaderProgram - define default precision for float types
    in Fragment Shader within OpenGL ES 2.0+ context.

kgv

2014-09-28 22:33

developer   ~0032277

Dear colleagues,

I would appreciate you remarks for the first patch draft based on Phong shader in OCCT.
Current limitations:
- No texture support (save the markers). Requires texture matrix uploading (at least for environment map).
- No textured font support. Requires proper matrices management without GLU in OpenGl_Text.
- No optimizations for different lights configuration. Lights loop can be generated for different combinations, and such combinations can be cached into map with keys like "ds" (0 - directional light, 1 - spot light) and automatically switched on view change (e.g. within OpenGl_ShaderManager::UpdateLightSourceStateTo()). It is suggested to provide this improvements in dedicated patches.
- Lighting does not work properly with points - to be investigated.
- Not yet tested on OpenGL ES 2.0 devices.

git

2014-09-29 09:46

administrator   ~0032279

Branch CR25282 has been updated by kgv.

SHA-1: 3802fcfdc3e7b33a3ffb185f5dd3e52daa07bb55


Detailed log of new commits:

Author: kgv
Date: Mon Sep 29 09:46:03 2014 +0300

    OpenGl_ShaderManager, support RGB markers.
    
    OpenGl_AspectMarker, initialize Aspect_TOM_O_POINT display list
    in the same way as sprite texture.
    
    OpenGl_Texture, do not use sized internal formats on OpenGL ES.

dbp

2014-09-29 12:34

developer   ~0032291

Dear kgv,

We probably should optimize shaders for efficient rendering on mobile devices. The simplest way to do this is using free GLSL Optimizer (https://www.openhub.net/p/glsl-optimizer). It perform various optimizations of shader code and increaes performance up to 2x.

Also it is possible to use precision qualifiers (4.5.2 Precision Qualifiers in OpenGL ES spec) for some variables. It may significantly increase the rendering performance.

git

2014-09-29 16:36

administrator   ~0032315

Branch CR25282 has been updated by kgv.

SHA-1: d6bd9802a7b2daf2d298e1e8436cdecc74566f0d


Detailed log of new commits:

Author: ibs
Date: Mon Sep 29 15:21:00 2014 +0400

    some typos fixed

git

2014-09-29 16:38

administrator   ~0032316

Branch CR25282_1 has been created by kgv.

SHA-1: 7fefaf2d26eedf91767fc962489d0f014d4dd23a


Detailed log of new commits:

Author: kgv
Date: Mon Sep 29 16:38:36 2014 +0400

    0025282: Visualization, OpenGl_PrimitiveArray - provide built-in GLSL programs as alternative to FFP
    
    Enumerations Visual3d_TypeOfModel, V3d_TypeOfShadingModel.
    - Remove unused values V3d_MULTICOLOR, V3d_HIDDEN, Visual3d_TOM_INTERP_COLOR.
    - Add per-pixel shading mode - V3d_PHONG, Visual3d_TOM_FRAGMENT.
    
    Draw Harness command vrenderparams.
    Add option -shadingModel to setup Shading Model.
    
    OpenGl_Caps::ffpEnable - new option to switch FFP/built-in GLSL programs.
    OpenGl_ShaderManager - add built-in GLSL programs.
    
    Draw Harness command vcaps.
    - Fix command syntax to meet coding rules.
    - Add option -ffp to activate/disable built-in GLSL programs.
    
    GLSL API changes.
    - Rename vertex attribute occColor -> occVertColor.
    - Introduce vec4 occColor uniform variable for light-less shaders.
    - Introduce float occPointSize uniform variable for marker programs.
    
    OpenGl_VertexBuffer::bindAttribute() - activate normalization for non-GL_FLOAT types,
    since color attribute is defined as 32-bit vector of 4 unsigned byte values.
    
    OpenGl_Context - add methods SetColor4fv() and SetPointSize()
    for parameters redirection to active GLSL program
    (as alternative to glColor4fv() and glPointSize()).
    
    OpenGl_ShaderProgram - define default precision for float types
    in Fragment Shader within OpenGL ES 2.0+ context.
    
    OpenGl_AspectMarker, initialize Aspect_TOM_O_POINT display list
    in the same way as sprite texture.
    
    OpenGl_Texture, do not use sized internal formats on OpenGL ES.

kgv

2014-09-29 16:45

developer   ~0032317

Dear bugmaster,

please test branch CR25282_1.

mkv

2014-09-30 17:40

tester   ~0032468

Dear BugMaster,
Branch CR25282_1 from occt git-repository (and master from products git-repository) was compiled on Linux and Windows platforms and tested on Release mode.
SHA-1: 7fefaf2d26eedf91767fc962489d0f014d4dd23a

Number of compiler warnings:

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

There is new additional compilation warning on Linux platform:
http://jenkins-test-03.nnov.opencascade.com:8080/user/mnt/my-views/view/A_mnt_warnings/job/mnt-CR25282_1-master_build_occt_linux/1/warnings16Result/package.-133837126/
OpenGl_ShaderManager.cxx:1013, GNU C Compiler 4 (gcc), Priority: Normal
statement has no effect

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

Regressions/Differences:
No regressions/differences

Testing cases:
Not needed

Testing on Linux:
occt component :
Total MEMORY difference: 396618740 / 396931464
Total CPU difference: 44521.260000000046 / 46584.790000000045
products component :
Total MEMORY difference: 124760808 / 124645448
Total CPU difference: 14857.269999999982 / 14771.669999999953

Testing on Windows:
occt component :
Total MEMORY difference: 253834528 / 279236240
Total CPU difference: 33022.734375 / 39387.8125
products component :
Total MEMORY difference: 67257604 / 67249232
Total CPU difference: 11606.1875 / 11300.046875

There are no differences in images found by testdiff.

git

2014-09-30 18:26

administrator   ~0032472

Branch CR25282_1 has been updated by kgv.

SHA-1: 2f713f0707173d37a4a9b0ece73c0eb4bbba1751


Detailed log of new commits:

Author: kgv
Date: Tue Sep 30 18:26:48 2014 +0400

    fix misprint in OpenGl_ShaderManager::prepareStdProgramFont()

kgv

2014-09-30 18:28

developer   ~0032473

The warning has been fixed in updated branch CR25282_1.
Please switch to tested (change does not affect any tests).

mkv

2014-10-01 11:24

tester   ~0032495

Dear BugMaster,
Branch CR25282_1 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
SHA-1: 2f713f0707173d37a4a9b0ece73c0eb4bbba1751

Number of compiler warnings:

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

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

Regressions/Differences:
No regressions/differences

Testing cases:
Not needed

Testing on Linux:
occt component :
Total MEMORY difference: 396801420 / 396920756
Total CPU difference: 45379.37999999995 / 46584.63000000004
products component :
Total MEMORY difference: 124723560 / 124607824
Total CPU difference: 14762.299999999988 / 14765.679999999953

Testing on Windows:
occt component :
Total MEMORY difference: 277713700 / 279229128
Total CPU difference: 32941.859375 / 39387.640625
products component :
Total MEMORY difference: 70530248 / 66603556
Total CPU difference: 10457.71875 / 11151.0625

There are no differences in images found by testdiff.

kgv

2014-10-02 13:48

developer   ~0032572

Please use branch CR25147_25282 for IR, rebased on 0025147 (resolving trivial merge conflict).

git

2014-10-10 11:10

administrator   ~0032953

Branch CR25282_mfc_fix has been created by kgv.

SHA-1: df6f7643bd1ba835e9c067d7c830a47516365621


Detailed log of new commits:

Author: kgv
Date: Fri Oct 10 11:10:44 2014 +0400

    Sync res/resource.h from src/resource.h

git

2014-10-21 16:40

administrator   ~0033408

Branch CR25282_mfc_fix has been deleted by inv.

SHA-1: df6f7643bd1ba835e9c067d7c830a47516365621

git

2014-10-21 16:44

administrator   ~0033459

Branch CR25282_1 has been deleted by inv.

SHA-1: 2f713f0707173d37a4a9b0ece73c0eb4bbba1751

git

2014-10-21 16:44

administrator   ~0033466

Branch CR25282 has been deleted by inv.

SHA-1: d6bd9802a7b2daf2d298e1e8436cdecc74566f0d

Related Changesets

occt: master 8625ef7e

2014-10-02 09:46:27

kgv


Committer: bugmaster Details Diff
0025282: Visualization, OpenGl_PrimitiveArray - provide built-in GLSL programs as alternative to FFP

Enumerations Visual3d_TypeOfModel, V3d_TypeOfShadingModel.
- Remove unused values V3d_MULTICOLOR, V3d_HIDDEN, Visual3d_TOM_INTERP_COLOR.
- Add per-pixel shading mode - V3d_PHONG, Visual3d_TOM_FRAGMENT.

Draw Harness command vrenderparams.
Add option -shadingModel to setup Shading Model.

OpenGl_Caps::ffpEnable - new option to switch FFP/built-in GLSL programs.
OpenGl_ShaderManager - add built-in GLSL programs.

Draw Harness command vcaps.
- Fix command syntax to meet coding rules.
- Add option -ffp to activate/disable built-in GLSL programs.

GLSL API changes.
- Rename vertex attribute occColor -> occVertColor.
- Introduce vec4 occColor uniform variable for light-less shaders.
- Introduce float occPointSize uniform variable for marker programs.

OpenGl_VertexBuffer::bindAttribute() - activate normalization for non-GL_FLOAT types,
since color attribute is defined as 32-bit vector of 4 unsigned byte values.

OpenGl_Context - add methods SetColor4fv() and SetPointSize()
for parameters redirection to active GLSL program
(as alternative to glColor4fv() and glPointSize()).

OpenGl_ShaderProgram - define default precision for float types
in Fragment Shader within OpenGL ES 2.0+ context.

OpenGl_AspectMarker, initialize Aspect_TOM_O_POINT display list
in the same way as sprite texture.

OpenGl_Texture, do not use sized internal formats on OpenGL ES.
Affected Issues
0025282
mod - samples/mfc/standard/04_Viewer3d/src/resource.h Diff File
mod - samples/mfc/standard/04_Viewer3d/src/ShadingModelDlg.cpp Diff File
mod - samples/mfc/standard/04_Viewer3d/src/ShadingModelDlg.h Diff File
mod - samples/mfc/standard/04_Viewer3d/src/Viewer3d.rc Diff File
mod - src/InterfaceGraphic/InterfaceGraphic_telem.hxx Diff File
mod - src/OpenGl/OpenGl_AspectFace.cxx Diff File
mod - src/OpenGl/OpenGl_AspectFace.hxx Diff File
mod - src/OpenGl/OpenGl_AspectLine.cxx Diff File
mod - src/OpenGl/OpenGl_AspectLine.hxx Diff File
mod - src/OpenGl/OpenGl_AspectMarker.cxx Diff File
mod - src/OpenGl/OpenGl_AspectMarker.hxx Diff File
mod - src/OpenGl/OpenGl_AspectText.cxx Diff File
mod - src/OpenGl/OpenGl_AspectText.hxx Diff File
mod - src/OpenGl/OpenGl_Caps.cxx Diff File
mod - src/OpenGl/OpenGl_Caps.hxx Diff File
mod - src/OpenGl/OpenGl_Context.cxx Diff File
mod - src/OpenGl/OpenGl_Context.hxx Diff File
mod - src/OpenGl/OpenGl_PrimitiveArray.cxx Diff File
mod - src/OpenGl/OpenGl_PrimitiveArray.hxx Diff File
mod - src/OpenGl/OpenGl_ShaderManager.cxx Diff File
mod - src/OpenGl/OpenGl_ShaderManager.hxx Diff File
mod - src/OpenGl/OpenGl_ShaderProgram.cxx Diff File
mod - src/OpenGl/OpenGl_ShaderProgram.hxx Diff File
mod - src/OpenGl/OpenGl_Text.cxx Diff File
mod - src/OpenGl/OpenGl_Texture.cxx Diff File
mod - src/OpenGl/OpenGl_Texture.hxx Diff File
mod - src/OpenGl/OpenGl_VertexBuffer.lxx Diff File
mod - src/OpenGl/OpenGl_View.cxx Diff File
mod - src/OpenGl/OpenGl_View.hxx Diff File
mod - src/OpenGl/OpenGl_View_2.cxx Diff File
mod - src/OpenGl/OpenGl_Workspace.hxx Diff File
mod - src/OpenGl/OpenGl_Workspace_5.cxx Diff File
mod - src/Shaders/Declarations.glsl Diff File
mod - src/V3d/V3d.cdl Diff File
mod - src/ViewerTest/ViewerTest_ViewerCommands.cxx Diff File
mod - src/Visual3d/Visual3d.cdl Diff File
mod - src/Visual3d/Visual3d_ContextView.cdl Diff File
mod - tests/bugs/vis/bug23654_MarkersRecompute Diff File
mod - tests/bugs/vis/bug24131_markers Diff File
mod - tests/bugs/vis/bug24728 Diff File

Issue History

Date Modified Username Field Change
2014-09-28 20:55 kgv New Issue
2014-09-28 20:55 kgv Assigned To => kgv
2014-09-28 20:55 kgv Relationship added child of 0025146
2014-09-28 20:55 kgv Status new => assigned
2014-09-28 22:19 git Note Added: 0032276
2014-09-28 22:33 kgv Note Added: 0032277
2014-09-28 22:33 kgv Assigned To kgv => san
2014-09-28 22:33 kgv Status assigned => feedback
2014-09-29 09:46 git Note Added: 0032279
2014-09-29 12:34 dbp Note Added: 0032291
2014-09-29 16:36 git Note Added: 0032315
2014-09-29 16:38 git Note Added: 0032316
2014-09-29 16:45 kgv Note Added: 0032317
2014-09-29 16:45 kgv Assigned To san => bugmaster
2014-09-29 16:45 kgv Status feedback => reviewed
2014-09-29 16:54 mkv Assigned To bugmaster => mkv
2014-09-29 21:53 kgv Relationship added child of 0024838
2014-09-30 17:40 mkv Note Added: 0032468
2014-09-30 17:40 mkv Assigned To mkv => kgv
2014-09-30 17:40 mkv Status reviewed => assigned
2014-09-30 17:40 mkv Test case number => Not needed
2014-09-30 18:26 git Note Added: 0032472
2014-09-30 18:28 kgv Note Added: 0032473
2014-09-30 18:28 kgv Assigned To kgv => bugmaster
2014-09-30 18:28 kgv Status assigned => resolved
2014-09-30 18:29 kgv Status resolved => reviewed
2014-09-30 20:07 mkv Assigned To bugmaster => mkv
2014-09-30 21:54 kgv Relationship added related to 0025301
2014-10-01 11:24 mkv Note Added: 0032495
2014-10-01 11:24 mkv Assigned To mkv => bugmaster
2014-10-01 11:24 mkv Status reviewed => tested
2014-10-01 11:37 kgv Relationship added related to 0023540
2014-10-01 11:39 kgv Relationship added related to 0025304
2014-10-01 11:41 kgv Relationship added parent of 0025305
2014-10-01 11:42 kgv Relationship replaced parent of 0025304
2014-10-01 11:42 kgv Relationship deleted related to 0023540
2014-10-01 11:44 kgv Relationship added parent of 0025303
2014-10-02 13:48 kgv Note Added: 0032572
2014-10-03 14:07 bugmaster Changeset attached => occt master 8625ef7e
2014-10-03 14:07 bugmaster Status tested => verified
2014-10-03 14:07 bugmaster Resolution open => fixed
2014-10-10 11:10 git Note Added: 0032953
2014-10-21 16:40 git Note Added: 0033408
2014-10-21 16:44 git Note Added: 0033459
2014-10-21 16:44 git Note Added: 0033466
2014-11-11 12:43 aiv Fixed in Version => 6.8.0
2014-11-11 13:02 aiv Status verified => closed
2014-11-13 09:02 kgv Relationship added parent of 0025474
2014-12-01 09:52 kgv Relationship added parent of 0025539
2014-12-01 09:55 kgv Relationship added parent of 0025328
2015-02-12 17:19 kgv Relationship added related to 0025822
2015-04-02 19:04 kgv Relationship added parent of 0026012
2015-10-15 11:46 kgv Relationship added parent of 0026122
2018-09-11 14:15 kgv Relationship added parent of 0030126
2019-04-17 14:11 kgv Relationship added related to 0030631