1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-04 18:06:22 +03:00

0030102: Visualization, TKOpenGl - Graphic3d_TOSM_FACET shading is incorrect in some casesn

gl_FrontFacing is now considered within Normal computation.
This commit is contained in:
mnv 2018-08-31 15:14:49 +03:00 committed by bugmaster
parent 93808a4a9c
commit 1ad3bc4c00
2 changed files with 14 additions and 0 deletions

View File

@ -2192,6 +2192,7 @@ Standard_Boolean OpenGl_ShaderManager::prepareStdProgramPhong (Handle(OpenGl_Sha
+ aSrcFragExtraMain
+ (isFlatNormal
? EOL" Normal = normalize (cross (dFdx (Position.xyz / Position.w), dFdy (Position.xyz / Position.w)));"
EOL" if (!gl_FrontFacing) { Normal = -Normal; }"
: "")
+ EOL" occSetFragColor (getColor());"
+ aSrcFragWriteOit

13
tests/bugs/vis/bug30102 Normal file
View File

@ -0,0 +1,13 @@
puts "============="
puts "0030102: Visualization, TKOpenGl - Graphic3d_TOSM_FACET shading is incorrect in some casesn"
puts "============="
pload MODELING VISUALIZATION
vclear
vinit View1
vaxo
vdrawparray b triangles v 0 55 0 v 0 75 0 v 20 55 0 v 0 55 0 v 0 75 0 v 0 55 20 v 0 55 0 v 0 55 20 v 20 55 0 v 0 75 0 v 0 55 20 v 20 55 0
vrotate 0.3 0.0 0.0
vfit
vdump ${imagedir}/${casename}.png