View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0029902 | Open CASCADE | OCCT:Data Exchange | public | 2018-06-28 11:58 | 2021-08-30 11:00 |
Reporter | kgv | Assigned To | apn | ||
Priority | normal | Severity | feature | ||
Status | closed | Resolution | fixed | ||
Target Version | 7.5.0 | Fixed in Version | 7.5.0 | ||
Summary | 0029902: Data Exchange, XCAF - provide extended Material definition for visualization purposes | ||||
Description | XCAF defines a structure XCAFPrs_Style accumulating visual properties: - Surface color and transparency, RGBA; - Curve color, RGB; - Hidden flag, Boolean. This structure is filled in by XCAFDoc_ColorTool from Color attributes on the Label (XCAFDoc_ColorGen, XCAFDoc_ColorSurf and XCAFDoc_ColorCurv). The following sources in XCAF document are actually considered by XCAFPrs::CollectStyleSettings for a given Label (in ascending order of priority, so that each next item in the list overrides previous one, when both defined): - Reference Label (Product Label for a given Instance Label); - Components (for a given Label to an Assembly); - Layer, where the Label is defined on, if any (using XCAFDoc_LayerTool); - SHUO structures; - Label itself; - Sub-shape Labels. XCAF structure also considers that sub-entity (Component) inherits a Style of a parent object (Assembly) in the Tree (if Style is not defined for sub-shape). So that XCAFPrs::CollectStyleSettings() will return an incomplete map when called for a Component without own Style (considering parent Assembly object defines a Style). In practice, this obscure behavior of XCAFPrs::CollectStyleSettings() may happen only for application-based XCAF document, because within STEP and IGES translators such definition is not possible (and therefore, it is preferred that application would not define such XCAF document to avoid problems with Data Exchange and make Style deduction straight-forward). There are, however, a context, where existing Style definition is not enough for defining visual properties. The following attributes are missing for preserving visual properties in 3D Viewer and for Data Exchange capabilities with formats like glTF and OBJ: 1) Common Material definition Obsolete material definition used for T&L (Transform and lighting) shading model coming from FFP (Fixed-Function Pipeline); but also implemented via GLSL programs. 2) Metallic-Roughness definition Commonly used by real-time Physically-Based Rendering (PBR) engines. 3) BSDF (bidirectional scattering distribution function) A PBR material definition for Path-Tracing engines (as used by OCCT itself). As a shared task across all Material definitions is introduction of Textures - references to external Image files or embedded into XCAF document. Although only one Material definition can be used at once by Rendering engine for specific object, and Common Material definition is already obsolete, it is still desired supporting several definitions for compatibility reasons (for rendering using faster Shading Model or for Data Exchange with formats supporting one or another Material definition). Note that extending Rendering capabilities of OCCT 3D Viewer is a dedicated task. It might be reasonable keeping Graphic3d_MaterialAspect definition independent from XCAF types, since they are following different tasks (Data Exchange and Visualization), though this would imply some code duplication. Relationship with XCAFPrs_Style, an auxiliary structure transferring visual properties from XCAF layer to OCCT 3D Viewer layer (XCAFPrs_AISObject) should be also examined during implementation; probably, XCAFPrs_Style should store a Handle pointing to Material definition, and existing Color attributes should behave like Graphic3d_MaterialAspect + Graphic3d_AspectFillArea3d::InteriorColor(). Materials are expected to be shared across components in the Assembly Tree, so that it makes sense splitting Materials definition and assignment in 2 parts: - Dedicated section in the document listing all Materials (probably with a map for a fast lookup, detection of unique materials and a tool to clean up duplicates / unused Materials). - Refer to a Material (not duplicate) at Component/Layer/Shape Label. 0) Extension to Material definition - enum: alphaMode - float: alphaCutoff - bool: closed primitive group of triangles (solid) - bool: backCulling, back face culling flag - texture: normalMap, RGB tangent space normal map. 1) Common Material definition - vec3: Ambient [Graphic3d_TOR_AMBIENT] - vec3: Diffuse (or vec4 considering Alpha) [Graphic3d_TOR_DIFFUSE] - vec3: Specular [Graphic3d_TOR_SPECULAR] - vec3: Emission [Graphic3d_TOR_EMISSION] - float: Shininess - float: Transparency/Alpha 2) Metallic-Roughness material - vec4: baseColor, base color of the material (or scale factor to the texture) - float: metallic, metalness of the material (or scale factor to the texture) - float: roughness, roughness of the material (or scale factor to the texture) - texture: baseColorTexture, sRGB texture for the base color - texture: metallicRoughnessTexture, RG texture packing the metallic and roughness properties together - vec3: emissiveFactor - texture: emissive, RGB emissive map controls the color and intensity of the light being emitted by the material. - texture: occlusion, R occlusion map indicating areas of indirect lighting. 3) BSDF definition [Graphic3d_BSDF] - vec4: Kc (Weight of coat specular/glossy BRDF) - vec3: Kd (Weight of base diffuse BRDF) - vec3: Ks (Weight of base specular/glossy BRDF) - vec3: Kt (Weight of base specular/glossy BTDF) - vec3: Le (Radiance emitted by the surface) - vec4: Absorption (Volume scattering color/density) - vec4: FresnelCoat (Parameters of Fresnel reflectance of coat layer) - vec4: FresnelBase (Parameters of Fresnel reflectance of base layer) - float RefractionIndex | ||||
Tags | No tags attached. | ||||
Test case number | Not needed | ||||
parent of | 0031139 | closed | bugmaster | Open CASCADE | Data Exchange - fix misprint in RWObj_CafReader |
parent of | 0032546 | closed | Open CASCADE | Data Exchange, XCAF - mark material as defined XCAFDoc_VisMaterialPBR::IsDefined=true within default constructor | |
related to | 0023037 | assigned | Community | Data Exchange - support different materials and transparency in XDE | |
related to | 0030691 | closed | bugmaster | Open CASCADE | Data Exchange - implement import of mesh data from files in glTF format |
related to | 0030700 | closed | apn | Open CASCADE | Visualization, TKOpenGl - support PBR Metallic-Roughness shading model |
|
Branch CR29902_0 has been created by kgv. SHA-1: 7eb29b2a1917995a4138872f595c7e88ec332329 Detailed log of new commits: Author: kgv Date: Wed Jul 3 11:28:26 2019 +0300 0029902: Data Exchange, XCAF - provide extended Material definition for visualization purposes |
|
Branch CR29902_0 has been updated forcibly by kgv. SHA-1: 51bc6e3113c9745be338ad83e11a7d6af6c9ddc0 |
|
Branch CR29902_0 has been updated by kgv. SHA-1: 5cdae2f875de2cdba6b2322ac21902cd9d26a851 Detailed log of new commits: Author: kgv Date: Wed Aug 21 16:17:29 2019 +0300 Introduced new attribute XCAFDoc_VisMaterial storing visualization material definition. Author: nds Date: Thu Aug 15 13:17:18 2019 +0300 0030901: Visualization - OSD_MemInfo moving memory computation out of the constructor |
|
Branch CR29902_0 has been updated forcibly by kgv. SHA-1: f4dac03e43701abc838a62be6b1151bfbd4ba391 |
|
Branch CR29902_0 has been updated forcibly by kgv. SHA-1: 6f332a357293db422ad770e4c709b4506c513b0d |
|
Branch CR29902_0 has been updated forcibly by kgv. SHA-1: 163f6a67bf1a4c627001d7d69e0d2c6bcf95b50b |
|
Branch CR29902_0 has been updated forcibly by kgv. SHA-1: a553e176efb12fd2153b60975f08aef65bc4513d |
|
Branch CR29902_0 has been updated forcibly by kgv. SHA-1: 058092bf77dfc2a37150bc66415b111b36425c67 |
|
Branch CR29902_0 has been updated forcibly by kgv. SHA-1: 3ed3d300128e0a74bcf575dd05df109605377b8f |
|
Branch CR29902_1 has been created by kgv. SHA-1: 2454e934ae6b5898103ab579f4623f985fd23721 Detailed log of new commits: Author: kgv Date: Wed Jul 3 11:28:26 2019 +0300 0029902: Data Exchange, XCAF - provide extended Material definition for visualization purposes Introduced new attribute XCAFDoc_VisMaterial storing visualization material definition. XCAFPrs_Style has been exteneded Material() property. XCAFPrs_AISObject::DispatchStyles() maps new XCAFPrs_Style::Material() property onto graphics aspects. RWGltf_GltfJsonParser and RWObj_CafReader now put Material definition into XCAF document instead of a color label. RWGltf_MaterialMetallicRoughness - added missing properties AlphaMode, AlphaCutOff and IsDoubleSided; fixed default values in constructor for Metallic and Roughness. Added commands XGetAllVisMaterials, XGetVisMaterial, XAddVisMaterial, XRemoveVisMaterial, XSetVisMaterial, XUnsetVisMaterial for working with new visualization materials table in the document. |
|
Branch CR29902_1 has been updated forcibly by kgv. SHA-1: f2ab47fe568276fa8cd59eb261ff99a1f2a5e12a |
|
Branch CR29902_1 has been updated forcibly by kgv. SHA-1: 9e91d7b0b23244f45699c2c6c5f69bb69a1dee90 |
|
Branch CR29902_2 has been created by kgv. SHA-1: 972728a09bf18f4b93c1fec288e4b514bf4596c0 Detailed log of new commits: Author: kgv Date: Wed Jul 3 11:28:26 2019 +0300 0029902: Data Exchange, XCAF - provide extended Material definition for visualization purposes Introduced new attribute XCAFDoc_VisMaterial storing visualization material definition. XCAFPrs_Style has been exteneded Material() property. XCAFPrs_AISObject::DispatchStyles() maps new XCAFPrs_Style::Material() property onto graphics aspects. RWGltf_GltfJsonParser and RWObj_CafReader now put Material definition into XCAF document instead of a color label. RWGltf_MaterialMetallicRoughness - added missing properties AlphaMode, AlphaCutOff and IsDoubleSided; fixed default values in constructor for Metallic and Roughness. Added commands XGetAllVisMaterials, XGetVisMaterial, XAddVisMaterial, XRemoveVisMaterial, XSetVisMaterial, XUnsetVisMaterial for working with new visualization materials table in the document. |
|
Branch CR29902_2 has been updated forcibly by kgv. SHA-1: 9e5ddc9edb1751362a84ec07678e1aa2e0501d96 |
|
Branch CR29902_2 has been updated forcibly by kgv. SHA-1: 988b2b6e1742044f9c3cf99f3f69c6126b0e87a8 |
|
Branch CR29902_2 has been updated forcibly by kgv. SHA-1: 7678f3a555442c6527513dcedb2c08731278afc0 |
|
Branch CR29902_2 has been updated forcibly by kgv. SHA-1: 8ca1c1c9933f99f7d7838d27f4afac9682cb432a |
|
Branch CR29902_2 has been updated forcibly by kgv. SHA-1: d88f2bfc404c036172df07d285d04444d230c1d3 |
|
Patch is ready for review. |
|
Branch CR29902_2 has been updated forcibly by kgv. SHA-1: b6e4388b62d5732d2fba663517fdb54ac8e33de9 |
|
Branch CR29902_2 has been updated forcibly by kgv. SHA-1: 5c253b40171404e86c5ff56394a59535a4b5f7bd |
|
Branch CR29902_2 has been updated forcibly by kgv. SHA-1: ad2e9ee57fe9a8e3a74647f1f2642fb5dd8fbccf |
|
Branch CR29902_2 has been updated forcibly by kgv. SHA-1: b942c6471a70de3a1ae8fca43708c71291aaef8f |
|
Branch CR29902_2 has been updated forcibly by kgv. SHA-1: 62d78b9c48e65296d826823b7cda5820b417e0fa |
|
Branch CR29902_2 has been updated forcibly by kgv. SHA-1: 5336d2b7a38e310c964e95f0ffe38ed9fbb4cc6e |
|
Branches CR29902_2 OCCT Internal repository and CR29902_2 in the OCCT Products Internal repository were reviewed. |
|
Branch CR29902_0 has been deleted by kgv. SHA-1: 3ed3d300128e0a74bcf575dd05df109605377b8f |
|
Branch CR29902_1 has been deleted by kgv. SHA-1: 9e91d7b0b23244f45699c2c6c5f69bb69a1dee90 |
|
Branch CR29902_2 has been deleted by kgv. SHA-1: 5336d2b7a38e310c964e95f0ffe38ed9fbb4cc6e |
occt: master a4815d55 2019-07-03 08:28:26 Committer: apn Details Diff |
0029902: Data Exchange, XCAF - provide extended Material definition for visualization purposes Introduced new attribute XCAFDoc_VisMaterial storing visualization material definition. XCAFPrs_Style has been exteneded Material() property. XCAFPrs_AISObject::DispatchStyles() maps new XCAFPrs_Style::Material() property onto graphics aspects. RWGltf_GltfJsonParser and RWObj_CafReader now put Material definition into XCAF document instead of a color label. RWGltf_MaterialMetallicRoughness - added missing properties AlphaMode, AlphaCutOff and IsDoubleSided; fixed default values in constructor for Metallic and Roughness. Added commands XGetAllVisMaterials, XGetVisMaterial, XAddVisMaterial, XRemoveVisMaterial, XSetVisMaterial, XUnsetVisMaterial for working with new visualization materials table in the document. |
Affected Issues 0029902 |
|
mod - src/AIS/AIS_ColoredDrawer.hxx | Diff File | ||
mod - src/AIS/AIS_ColoredShape.cxx | Diff File | ||
mod - src/BinMXCAFDoc/BinMXCAFDoc.cxx | Diff File | ||
add - src/BinMXCAFDoc/BinMXCAFDoc_VisMaterialDriver.cxx | Diff File | ||
add - src/BinMXCAFDoc/BinMXCAFDoc_VisMaterialDriver.hxx | Diff File | ||
add - src/BinMXCAFDoc/BinMXCAFDoc_VisMaterialToolDriver.cxx | Diff File | ||
add - src/BinMXCAFDoc/BinMXCAFDoc_VisMaterialToolDriver.hxx | Diff File | ||
mod - src/BinMXCAFDoc/FILES | Diff File | ||
mod - src/IGESCAFControl/IGESCAFControl_Writer.cxx | Diff File | ||
mod - src/RWGltf/FILES | Diff File | ||
add - src/RWGltf/RWGltf_GltfAlphaMode.hxx | Diff File | ||
mod - src/RWGltf/RWGltf_GltfJsonParser.cxx | Diff File | ||
mod - src/RWGltf/RWGltf_GltfJsonParser.pxx | Diff File | ||
mod - src/RWGltf/RWGltf_MaterialMetallicRoughness.hxx | Diff File | ||
mod - src/RWMesh/RWMesh_CafReader.cxx | Diff File | ||
mod - src/RWObj/RWObj_CafReader.cxx | Diff File | ||
mod - src/RWObj/RWObj_CafReader.hxx | Diff File | ||
mod - src/STEPCAFControl/STEPCAFControl_Writer.cxx | Diff File | ||
mod - src/TKBinXCAF/EXTERNLIB | Diff File | ||
mod - src/TKXmlXCAF/EXTERNLIB | Diff File | ||
mod - src/VrmlData/VrmlData_ShapeConvert.cxx | Diff File | ||
mod - src/VrmlData/VrmlData_ShapeConvert.hxx | Diff File | ||
mod - src/XCAFDoc/FILES | Diff File | ||
mod - src/XCAFDoc/XCAFDoc.cxx | Diff File | ||
mod - src/XCAFDoc/XCAFDoc.hxx | Diff File | ||
mod - src/XCAFDoc/XCAFDoc_ColorTool.cxx | Diff File | ||
mod - src/XCAFDoc/XCAFDoc_ColorTool.hxx | Diff File | ||
mod - src/XCAFDoc/XCAFDoc_DocumentTool.cxx | Diff File | ||
mod - src/XCAFDoc/XCAFDoc_DocumentTool.hxx | Diff File | ||
add - src/XCAFDoc/XCAFDoc_VisMaterial.cxx | Diff File | ||
add - src/XCAFDoc/XCAFDoc_VisMaterial.hxx | Diff File | ||
add - src/XCAFDoc/XCAFDoc_VisMaterialCommon.hxx | Diff File | ||
add - src/XCAFDoc/XCAFDoc_VisMaterialPBR.hxx | Diff File | ||
add - src/XCAFDoc/XCAFDoc_VisMaterialTool.cxx | Diff File | ||
add - src/XCAFDoc/XCAFDoc_VisMaterialTool.hxx | Diff File | ||
mod - src/XCAFPrs/FILES | Diff File | ||
mod - src/XCAFPrs/XCAFPrs.cxx | Diff File | ||
mod - src/XCAFPrs/XCAFPrs_AISObject.cxx | Diff File | ||
mod - src/XCAFPrs/XCAFPrs_AISObject.hxx | Diff File | ||
mod - src/XCAFPrs/XCAFPrs_Style.hxx | Diff File | ||
add - src/XCAFPrs/XCAFPrs_Texture.cxx | Diff File | ||
add - src/XCAFPrs/XCAFPrs_Texture.hxx | Diff File | ||
mod - src/XDEDRAW/XDEDRAW_Colors.cxx | Diff File | ||
mod - src/XmlMXCAFDoc/FILES | Diff File | ||
mod - src/XmlMXCAFDoc/XmlMXCAFDoc.cxx | Diff File | ||
add - src/XmlMXCAFDoc/XmlMXCAFDoc_VisMaterialDriver.cxx | Diff File | ||
add - src/XmlMXCAFDoc/XmlMXCAFDoc_VisMaterialDriver.hxx | Diff File | ||
add - src/XmlMXCAFDoc/XmlMXCAFDoc_VisMaterialToolDriver.cxx | Diff File | ||
add - src/XmlMXCAFDoc/XmlMXCAFDoc_VisMaterialToolDriver.hxx | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2018-06-28 11:58 | kgv | New Issue | |
2018-06-28 11:58 | kgv | Assigned To | => gka |
2018-06-28 11:59 | kgv | Assigned To | gka => kgv |
2018-06-28 11:59 | kgv | Status | new => assigned |
2019-02-06 12:51 |
|
Relationship added | related to 0023037 |
2019-05-05 13:15 | kgv | Relationship added | related to 0030691 |
2019-05-07 14:22 | kgv | Relationship added | related to 0030700 |
2019-07-03 11:30 | git | Note Added: 0085392 | |
2019-08-13 15:28 | git | Note Added: 0086227 | |
2019-08-21 16:20 | git | Note Added: 0086386 | |
2019-08-21 16:56 | git | Note Added: 0086387 | |
2019-08-22 16:46 | git | Note Added: 0086417 | |
2019-08-22 17:27 | git | Note Added: 0086418 | |
2019-08-22 17:49 | git | Note Added: 0086419 | |
2019-08-22 17:55 | git | Note Added: 0086420 | |
2019-08-26 15:34 | git | Note Added: 0086450 | |
2019-09-04 15:54 |
|
Target Version | 7.4.0 => 7.5.0 |
2019-10-08 20:23 | git | Note Added: 0087955 | |
2019-10-08 23:07 | git | Note Added: 0087957 | |
2019-10-09 01:10 | git | Note Added: 0087958 | |
2019-10-09 01:14 | git | Note Added: 0087959 | |
2019-10-09 01:35 | git | Note Added: 0087960 | |
2019-10-09 11:07 | git | Note Added: 0087965 | |
2019-10-09 11:56 | git | Note Added: 0087968 | |
2019-10-09 12:29 | git | Note Added: 0087972 | |
2019-10-09 13:51 | git | Note Added: 0087974 | |
2019-10-09 14:56 | kgv | Note Added: 0087978 | |
2019-10-09 14:56 | kgv | Assigned To | kgv => gka |
2019-10-09 14:56 | kgv | Status | assigned => resolved |
2019-10-09 15:54 | git | Note Added: 0087981 | |
2019-10-09 15:57 | git | Note Added: 0087982 | |
2019-10-09 16:09 | git | Note Added: 0087983 | |
2019-10-09 16:14 | git | Note Added: 0087984 | |
2019-10-09 16:20 | git | Note Added: 0087985 | |
2019-10-09 16:45 | git | Note Added: 0087986 | |
2019-10-09 19:17 |
|
Note Added: 0087990 | |
2019-10-09 19:17 |
|
Assigned To | gka => bugmaster |
2019-10-09 19:17 |
|
Status | resolved => reviewed |
2019-10-23 01:07 | apn | Changeset attached | => occt master a4815d55 |
2019-10-23 01:07 | apn | Assigned To | bugmaster => apn |
2019-10-23 01:07 | apn | Status | reviewed => verified |
2019-10-23 01:07 | apn | Resolution | open => fixed |
2019-10-23 11:51 | git | Note Added: 0088455 | |
2019-10-23 11:51 | git | Note Added: 0088456 | |
2019-10-23 11:51 | git | Note Added: 0088457 | |
2019-10-23 16:52 | apn | Test case number | => Not needed |
2019-11-07 00:02 | kgv | Relationship added | parent of 0031139 |
2020-12-02 16:40 |
|
Fixed in Version | => 7.5.0 |
2020-12-02 17:11 |
|
Status | verified => closed |
2021-08-30 11:00 | kgv | Relationship added | parent of 0032546 |