MantisBT - Open CASCADE
View Issue Details
0032524Open CASCADE[OCCT] OCCT:Data Exchangepublic2021-08-10 17:172021-08-14 14:01
kgv 
bugmaster 
normalminor 
verifiedfixed 
[OCCT] 7.5.0 
[OCCT] 7.6.0* 
Not required
0032524: Data Exchange, RWGltf_CafWriter - avoid writing translucent metallic materials
RWGltf_GltfMaterialMap::DefineMaterial() by default creates a material with 100% metallic factor and sets transparency from XCAFPrs_Style.
It is desired to reset metallic factor in case of translucent material.
pload OCAF XDE VISUALIZATION MODELING
NewDocument D1 BinXCAF
box b 1 1 1
explode b e
explode b f
XAddShape D1 b
XSetColor D1 b_1 RED s
XSetColor D1 b_2 YELLOW 0.3 s
XSetColor D1 b_11 WHITE 0.2 c
XSetColor D1 b_10 CYAN c
XAddColor D1 0.5 0.5 1 0.1

vinit v1/v1
vrenderparams -shadingModel PBR
XDisplay -dispMode 1 D1
vfit
# OK - transparency preserved

WriteGltf D1 test.glb
ReadGltf D2 test.glb
vinit v2/v1
vrenderparams -shadingModel PBR
XDisplay -dispMode 1 D2
vfit
# KO - transparency is lost due to metallic=1.0


Existing case:
test de_mesh obj_read ship_boat 1

Result: windows are not transparent in PBR view.
No tags attached.
Issue History
2021-08-10 17:17kgvNew Issue
2021-08-10 17:17kgvAssigned To => kgv
2021-08-10 17:24gitNote Added: 0103114
2021-08-10 17:33kgvSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=25601#r25601
2021-08-10 19:26kgvNote Added: 0103116
2021-08-10 19:26kgvAssigned Tokgv => osa
2021-08-10 19:26kgvStatusnew => resolved
2021-08-10 19:26kgvSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=25602#r25602
2021-08-11 10:13osaNote Added: 0103126
2021-08-11 10:13osaAssigned Toosa => bugmaster
2021-08-11 10:13osaStatusresolved => reviewed
2021-08-14 13:22bugmasterNote Added: 0103199
2021-08-14 13:22bugmasterStatusreviewed => tested
2021-08-14 13:25bugmasterTest case number => Not required
2021-08-14 13:31bugmasterChangeset attached => occt master aeef9e2c
2021-08-14 13:31bugmasterStatustested => verified
2021-08-14 13:31bugmasterResolutionopen => fixed
2021-08-14 14:01gitNote Added: 0103214

Notes
(0103114)
git   
2021-08-10 17:24   
Branch CR32524 has been created by kgv.

SHA-1: 6e28335c866c2f598918488bf9a80c03dd28ae7d


Detailed log of new commits:

Author: kgv
Date: Tue Aug 10 17:23:44 2021 +0300

    0032524: Data Exchange, RWGltf_CafWriter - avoid writing translucent metallic materials
    
    RWGltf_GltfMaterialMap::DefineMaterial() and XCAFDoc_VisMaterial::ConvertToPbrMaterial()
    now reset matallic factor to 0.0f in case of transparent color.
(0103116)
kgv   
2021-08-10 19:26   
Patch is ready for review.
- OCCT: branch CR32524.

http://jenkins-test-12.nnov.opencascade.com:8080/view/CR32524-master-KGV/ [^]
(0103126)
osa   
2021-08-11 10:13   
The patch was reviewed
(0103199)
bugmaster   
2021-08-14 13:22   
Combination -
OCCT branch : IR-2021-08-13
master SHA - 7b5f784419eb9fd9a1d3dc69eff89d3e720d6e97
a87b7ddc8cb44606b91e3f37113847c3f5f50fdc
Products branch : IR-2021-08-13 SHA - 8dc957c07e49e8db2f1330ec126160fe1c7eb89d
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: 17368.20000000041 / 17370.70000000038 [-0.01%]
Products
Total CPU difference: 11492.330000000085 / 11466.840000000084 [+0.22%]
Windows-64-VC14:
OCCT
Total CPU difference: 19143.8125 / 19180.875 [-0.19%]
Products
Total CPU difference: 12803.65625 / 12837.4375 [-0.26%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
(0103214)
git   
2021-08-14 14:01   
Branch CR32524 has been deleted by mnt.

SHA-1: 6e28335c866c2f598918488bf9a80c03dd28ae7d