MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0028069Open CASCADE[OCCT] OCCT:Visualizationpublic2016-11-08 10:302018-09-12 17:22
Reporterkgv 
Assigned Tobugmaster 
PrioritynormalSeverityminor 
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version[OCCT] 7.1.0 
Target Version[OCCT] 7.3.0Fixed in Version[OCCT] 7.3.0 
Summary0028069: Visualization, TKOpenGl - handle flat shading model within GLSL programs
DescriptionThe following shading models are not supported by built-in GLSL programs (in contrast to deprecated FFP):
- V3d_COLOR
- V3d_FLAT

The first one is almost useless and can be safely removed (the same effect can be achieved by removing all non-ambient light sources).

The second one can be achieved by application by duplicating vertices for each triangle with unique normal, requires more memory and recomputation of presentation. Therefore, support from GLSL programs can be useful here.

Unfortunately, the behavior similar to V3d_FLAT is not trivial to achieve - it requires Geometry Shader (also fake flat model can be simulated by flat normal interpolation - which will give the single normal for entire triangle, but this normal will be taken from one of the vertices, not for triangle itself).

Anyway, current mechanism of global shading model should be also revised / completed with per-object options, since it is rarely desired to use only Flat or only Phong shading model for all objects in the scene. This, however, might be implemented in dedicated patch.

Steps To Reproduce
pload MODELING VISUALIZATION
psphere s 10
vclear
vinit View1
vdisplay -dispMode 1 s
vfit

puts "Deprecated FFP"
vcaps -ffp 1
# OK
vrenderparams -shadingModel color
# OK
vrenderparams -shadingModel flat
# OK (default)
vrenderparams -shadingModel vert
# KO (expected)
vrenderparams -shadingModel phong

puts "GLSL programs"
vcaps -ffp 0
# KO (unsupported)
vrenderparams -shadingModel color
# KO (unsupported)
vrenderparams -shadingModel flat
# OK (default)
vrenderparams -shadingModel vert
# OK
vrenderparams -shadingModel phong
TagsNo tags attached.
Test case numberv3d glsl flat_fuse1
Attached Filespng file icon flat_fuse1.png (21,594 bytes) 2017-09-10 17:12

- Relationships
related to 0028062closedabv Samples - Shading model functionality does not work in mfc Viewer3d 
related to 0027715closedbugmaster Visualization - turn off deprecated OpenGL fixed-function pipeline by default 
parent of 0030102verifiedbugmaster Visualization, TKOpenGl - Graphic3d_TOSM_FACET shading is incorrect in some cases 
parent of 0030136verifiedbugmaster Visualization, TKOpenGl - Graphic3d_TOSM_FACET does not work on mobile devices 
related to 0029074closedbugmaster Visualization, TKOpenGl - support Geometry Shader definition 
related to 0029097closedbugmaster Visualization - allow picking Graphic3d_TypeOfShadingModel per-object 

-  Notes
(0070408)
git (administrator)
2017-09-10 17:14

Branch CR28069 has been created by kgv.

SHA-1: 6442d2a3b0a376c6e5719f63a3479834f2638a95


Detailed log of new commits:

Author: kgv
Date: Sun Sep 10 17:06:19 2017 +0300

    0028069: Visualization, TKOpenGl - handle flat shading model within GLSL programs
(0070409)
git (administrator)
2017-09-10 17:43

Branch CR28069 has been updated forcibly by kgv.

SHA-1: 411a29049cc443e743bc9f1bdae2eab023493d48
(0070410)
kgv (developer)
2017-09-10 17:43

Patch is ready for review.
(0070721)
san (developer)
2017-09-20 19:36

Branch CR28069 reviewed without remarks, ready for testing.
(0070734)
bugmaster (administrator)
2017-09-21 12:36

it is suggested to test it after new master for OCCT and Products has been ready.
And fix has been rebased on latter
(0070761)
git (administrator)
2017-09-21 21:49

Branch CR28069 has been updated forcibly by inv.

SHA-1: b95b6a568c6a8cc2889c2269141ab522ffb39071
(0070778)
bugmaster (administrator)
2017-09-22 12:19

Combination -
OCCT branch : CR28069 SHA-1: b95b6a568c6a8cc2889c2269141ab522ffb39071
Products branch : master
was compiled on Linux, MacOS and Windows platforms and tested on optimize mode.

http://jenkins-test-10.nnov.opencascade.com/view/CR28069-master-KGV/ [^]

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
No differences that require special attention

Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention

New test cases are OK
(0070996)
git (administrator)
2017-09-29 17:11

Branch CR28069 has been deleted by kgv.

SHA-1: b95b6a568c6a8cc2889c2269141ab522ffb39071

- Related Changesets
occt: master 8c3237d4
Timestamp: 2017-09-10 14:06:19
Author: kgv
Committer: bugmaster
Details ] Diff ]
0028069: Visualization, TKOpenGl - handle flat shading model within GLSL programs
mod - src/OpenGl/OpenGl_Context.cxx Diff ] File ]
mod - src/OpenGl/OpenGl_Context.hxx Diff ] File ]
mod - src/OpenGl/OpenGl_ShaderManager.cxx Diff ] File ]
mod - src/OpenGl/OpenGl_ShaderManager.hxx Diff ] File ]
add - tests/v3d/glsl/flat_fuse1 Diff ] File ]

- Issue History
Date Modified Username Field Change
2016-11-08 10:30 kgv New Issue
2016-11-08 10:30 kgv Assigned To => kgv
2016-11-08 10:30 kgv Relationship added related to 0028062
2016-11-08 10:30 kgv Relationship added related to 0027715
2017-07-20 11:34 kgv Target Version 7.2.0 => 7.3.0
2017-09-01 17:51 kgv Relationship added related to 0029074
2017-09-10 17:05 kgv Summary Visualization - remove or support flat shading model within GLSL programs => Visualization, TKOpenGl - handle flat shading model within GLSL programs
2017-09-10 17:12 kgv File Added: flat_fuse1.png
2017-09-10 17:14 git Note Added: 0070408
2017-09-10 17:43 git Note Added: 0070409
2017-09-10 17:43 kgv Note Added: 0070410
2017-09-10 17:43 kgv Assigned To kgv => san
2017-09-10 17:43 kgv Status new => resolved
2017-09-10 17:56 kgv Relationship added related to 0029097
2017-09-20 19:36 san Note Added: 0070721
2017-09-20 19:36 san Assigned To san => bugmaster
2017-09-20 19:36 san Status resolved => reviewed
2017-09-21 12:36 bugmaster Note Added: 0070734
2017-09-21 21:49 git Note Added: 0070761
2017-09-22 12:19 bugmaster Note Added: 0070778
2017-09-22 12:19 bugmaster Status reviewed => tested
2017-09-22 12:19 bugmaster Test case number => v3d glsl flat_fuse1
2017-09-29 13:26 bugmaster Changeset attached => occt master 8c3237d4
2017-09-29 13:26 bugmaster Status tested => verified
2017-09-29 13:26 bugmaster Resolution open => fixed
2017-09-29 17:11 git Note Added: 0070996
2018-06-29 21:15 user533 Fixed in Version => 7.3.0
2018-06-29 21:19 user533 Status verified => closed
2018-09-03 10:14 kgv Relationship added parent of 0030102
2018-09-12 17:22 kgv Relationship added parent of 0030136


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker