View Issue Details

IDProjectCategoryView StatusLast Update
0027943Open CASCADEOCCT:Visualizationpublic2016-12-09 16:38
Reporterkgv Assigned Toapn  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
PlatformWindowsOSVC++ 2015 
Product Version6.7.0 
Target Version7.1.0Fixed in Version7.1.0 
Summary0027943: Visualization - fix broken shading by positional light for object with local transformation
DescriptionFor some reason, the shape having local transformation applied is shaded by non-head lights in not the same way as shape with pre-applied transformation.
Steps To ReproduceTest case 1:
set anX 0.001
pload MODELING VISUALIZATION
circle c 0 0 0 0.001
mkedge e c
wire   w e
plane  s
mkface f1 s w
mkface f2 s w
ttranslate f1 $anX -0.001 0
#ttranslate f2 $anX  0.001 0
vclear
vinit View1
vtop
vdisplay -dispMode 1 f1 f2
vsetlocation f2 $anX 0.001 0
vpoint vl $anX 0 0.001
vfit
vlight clear
vlight add positional pos $anX 0 0.001 color RED1
#vlight change 2 pos $anX 0 0.001 color RED1
#vrenderparams -shadingModel phong
vshaderprog phong


Test case 2:
pload MODELING VISUALIZATION
circle c 0 0 0 0.001
mkedge e c
wire   w e
plane  s
mkface f0  s w
mkface f10 s w
ttranslate f10 10 -0.001 0
vclear
vinit View1
vaxo
vdisplay -dispMode 1 f0 f10
vsetlocation f0 10 0.001 0
vfit
vrotate 1 0 0
vpoint v10 10 0 0.001
vlight add positional pos 10 0 0.001 color RED1
vlight change 2 pos 10 0 0.001 color RED1

# OK
vraytrace 1

# about OK
vcaps -ffp 1

# KO
vcaps -ffp 0

#vrenderparams -shadingModel phong
TagsNo tags attached.
Test case numberv3d glsl gouraud_pos1, gouraud_spot1, phong_pos1, phong_spot1

Attached Files

  • poslight_ffp_OK.png (2,113 bytes)
  • poslight_raytrace_OK.png (5,381 bytes)
  • poslight_glsl_KO.png (2,427 bytes)
  • poslight_phong_OK.png (13,732 bytes)
  • poslight_phong_KO.png (13,416 bytes)

Relationships

related to 0027955 newvpozdyayev Visualization - handle positional lights within transformation persistent objects 
child of 0024838 closedbugmaster Visualization, TKOpenGl - make general rendering path compatible with OpenGL 3.1+ core profiles 

Activities

kgv

2016-10-09 16:15

developer  

poslight_ffp_OK.png (2,113 bytes)

kgv

2016-10-09 16:15

developer  

poslight_raytrace_OK.png (5,381 bytes)

kgv

2016-10-09 16:15

developer  

poslight_glsl_KO.png (2,427 bytes)

kgv

2016-10-09 19:20

developer  

poslight_phong_OK.png (13,732 bytes)

kgv

2016-10-09 19:20

developer  

poslight_phong_KO.png (13,416 bytes)

git

2016-10-09 20:48

administrator   ~0058507

Branch CR27943 has been created by kgv.

SHA-1: 0852d1c61bca8ba59727b7e74232a52adfe881cb


Detailed log of new commits:

Author: kgv
Date: Sun Oct 9 20:48:16 2016 +0300

    0027943: Visualization - fix broken shading by positional light for object with local transformation
    
    OpenGl_ShaderManager, per-vertex shading and per-fragment shading
    - do not apply model-world matrix on the light sources
    which are expected to be defined in world-space.

kgv

2016-10-09 20:50

developer   ~0058508

Patch is ready for review.

san

2016-10-10 14:11

developer   ~0058521

Branch CR27943 reviewed without remarks, ready for testing.

mkv

2016-10-11 13:44

tester   ~0058570

Dear BugMaster,
Branch CR27943 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: 0852d1c61bca8ba59727b7e74232a52adfe881cb

Number of compiler warnings:

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

products component :
Linux: 64 (64 on master)
Windows: 0 (0 on master)
MacOS : 1128

Regressions/Differences/Improvements:
No regressions/differences

Testing cases:
http://occt-tests/CR27943-master-OCCT/Debian70-64/v3d/glsl/gouraud_pos1.html
http://occt-tests/CR27943-master-OCCT/Windows-64-VC10/v3d/glsl/gouraud_pos1.html
v3d glsl gouraud_pos1: OK
http://occt-tests/CR27943-master-OCCT/Debian70-64/v3d/glsl/gouraud_spot1.html
http://occt-tests/CR27943-master-OCCT/Windows-64-VC10/v3d/glsl/gouraud_spot1.html
v3d glsl gouraud_spot1: OK
http://occt-tests/CR27943-master-OCCT/Debian70-64/v3d/glsl/phong_pos1.html
http://occt-tests/CR27943-master-OCCT/Windows-64-VC10/v3d/glsl/phong_pos1.html
v3d glsl phong_pos1: OK
http://occt-tests/CR27943-master-OCCT/Debian70-64/v3d/glsl/phong_spot1.html
http://occt-tests/CR27943-master-OCCT/Windows-64-VC10/v3d/glsl/phong_spot1.html
v3d glsl phong_spot1: OK

Testing on Linux:
occt component :
Total MEMORY difference: 91077388 / 91109095 [-0.03%]
Total CPU difference: 19419.31999999986 / 19439.81000000002 [-0.11%]
products component :
Total MEMORY difference: 30054908 / 30012726 [+0.14%]
Total CPU difference: 5222.599999999969 / 5239.289999999958 [-0.32%]

Testing on Windows:
occt component :
Total MEMORY difference: 57231102 / 57241724 [-0.02%]
Total CPU difference: 19150.495558798677 / 18173.586096598698 [+5.38%]
products component :
Total MEMORY difference: 21277716 / 21240754 [+0.17%]
Total CPU difference: 5000.2688527999435 / 5008.287304199943 [-0.16%]

There are no differences in images found by testdiff.

mkv

2016-10-11 13:44

tester   ~0058571

Dear BugMaster,
Branch CR27943 is TESTED.

git

2016-10-28 21:42

administrator   ~0059467

Branch CR27943 has been deleted by kgv.

SHA-1: 0852d1c61bca8ba59727b7e74232a52adfe881cb

Related Changesets

occt: master 5f4bd4d4

2016-10-09 17:48:16

kgv


Committer: apn Details Diff
0027943: Visualization - fix broken shading by positional light for object with local transformation

OpenGl_ShaderManager, per-vertex shading and per-fragment shading
- do not apply model-world matrix on the light sources
which are expected to be defined in world-space.
Affected Issues
0027943
mod - src/OpenGl/OpenGl_ShaderManager.cxx Diff File
mod - src/Shaders/PhongShading.fs Diff File
add - tests/v3d/glsl/gouraud_pos1 Diff File
add - tests/v3d/glsl/gouraud_spot1 Diff File
add - tests/v3d/glsl/phong_pos1 Diff File
add - tests/v3d/glsl/phong_spot1 Diff File

Issue History

Date Modified Username Field Change
2016-10-09 16:13 kgv New Issue
2016-10-09 16:13 kgv Assigned To => kgv
2016-10-09 16:15 kgv File Added: poslight_ffp_OK.png
2016-10-09 16:15 kgv File Added: poslight_raytrace_OK.png
2016-10-09 16:15 kgv File Added: poslight_glsl_KO.png
2016-10-09 16:20 kgv Product Version 7.0.0 => 6.7.0
2016-10-09 19:19 kgv Steps to Reproduce Updated
2016-10-09 19:20 kgv File Added: poslight_phong_OK.png
2016-10-09 19:20 kgv File Added: poslight_phong_KO.png
2016-10-09 20:45 kgv Summary Visualization - positional light is not the same for shape with local translation => Visualization - fix broken broken shading by positional light for object with local transformation
2016-10-09 20:45 kgv Description Updated
2016-10-09 20:48 kgv Summary Visualization - fix broken broken shading by positional light for object with local transformation => Visualization - fix broken shading by positional light for object with local transformation
2016-10-09 20:48 git Note Added: 0058507
2016-10-09 20:50 kgv Note Added: 0058508
2016-10-09 20:50 kgv Assigned To kgv => apl
2016-10-09 20:50 kgv Status new => resolved
2016-10-09 20:51 kgv Relationship added child of 0024838
2016-10-10 14:11 san Note Added: 0058521
2016-10-10 14:11 san Assigned To apl => bugmaster
2016-10-10 14:11 san Status resolved => reviewed
2016-10-10 16:40 mkv Assigned To bugmaster => mkv
2016-10-11 13:44 mkv Note Added: 0058570
2016-10-11 13:44 mkv Note Added: 0058571
2016-10-11 13:44 mkv Assigned To mkv => bugmaster
2016-10-11 13:44 mkv Status reviewed => tested
2016-10-11 13:44 mkv Test case number => v3d glsl gouraud_pos1, gouraud_spot1, phong_pos1, phong_spot1
2016-10-12 21:46 kgv Relationship added related to 0027955
2016-10-20 15:13 apn Changeset attached => occt master 5f4bd4d4
2016-10-20 15:13 apn Assigned To bugmaster => apn
2016-10-20 15:13 apn Status tested => verified
2016-10-20 15:13 apn Resolution open => fixed
2016-10-28 21:42 git Note Added: 0059467
2016-12-09 16:30 aiv Status verified => closed
2016-12-09 16:38 aiv Fixed in Version => 7.1.0