MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0030700Open CASCADE[OCCT] OCCT:Visualizationpublic2019-05-07 14:212019-11-21 12:10
Reporterkgv 
Assigned Toapn 
PrioritynormalSeverityfeature 
StatusverifiedResolutionfixed 
PlatformOSOS Version
Product Version 
Target Version[OCCT] 7.5.0*Fixed in Version 
Summary0030700: Visualization, TKOpenGl - support PBR Metallic-Roughness shading model
DescriptionIt is desired supporting PBR Metallic-Roughness shading model defined by glTF format specification for properly displaying such models in 3D Viewer.
TagsNo tags attached.
Test case number
Attached Filespng file icon new_materials_work_in_progress.png (167,250 bytes) 2019-08-30 09:03
png file icon new_materials_work_in_progress_2.png (197,097 bytes) 2019-09-02 16:55
png file icon new_materials_work_in_progress_3.png (170,120 bytes) 2019-09-27 12:26
png file icon pbr_spheres_persp0.png (199,049 bytes) 2019-10-24 02:22
? file icon MetalRoughSpheres_NoTextures.glb (88,332 bytes) 2019-11-06 14:19
png file icon pbr_spheres2.png (411,499 bytes) 2019-11-21 12:10

- Relationships
related to 0029902verifiedapn Open CASCADE Data Exchange, XCAF - provide extended Material definition for visualization purposes 
related to 0030691closedbugmaster Open CASCADE Data Exchange - implement import of mesh data from files in glTF format 
related to 0029528verifiedapn Open CASCADE Visualization, TKOpenGl - allow defining sRGB textures 
related to 0029516closedbugmaster Open CASCADE Visualization - eliminate redundant property Graphic3d_MaterialAspect::ReflectionMode() 
related to 0030126newkgv Open CASCADE Visualization, OpenGl_ShaderManager - define standard Lighting & Clipping within custom GLSL programs as template functions 
related to 0030631newkgv Open CASCADE Visualization - Vulkan graphic driver prototype 
parent of 0031096assignediko Open CASCADE Visualization, TKOpenGl - support metallic-roughness texture mapping 
parent of 0031097assignediko Open CASCADE Visualization, TKOpenGl - support Occlusion texture mapping 
parent of 0031098assignediko Open CASCADE Visualization, TKOpenGl - support Normal texture map 
parent of 0031099newiko Open CASCADE Visualization, TKOpenGl - support Point light source with artistic full cut-off distance 
parent of 0031100newkgv Open CASCADE Data Exchange, RWGltf_CafReader - support reading information from EXT_lights_image_based 
parent of 0031105newiko Open CASCADE Visualization, TKOpenGl - provide built-in environment maps 
parent of 0031129newkgv Open CASCADE Visualization - revise background / environment API 
related to 0030807closedapn Open CASCADE Visualization, TKOpenGl - supporting cubemaps 
related to 0030963closedbugmaster Open CASCADE Visualization, TKOpenGl - texture unit error during FFP global texture's parameters processing 
Not all the children of this issue are yet resolved or closed.

-  Notes
(0084371)
kgv (developer)
2019-05-15 15:36

Useful threads related to light sources definition merged as KHR_lights_punctual extension to glTF 2.0:

https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md [^]
https://github.com/KhronosGroup/glTF/issues/945 [^]
https://github.com/KhronosGroup/glTF/pull/1223 [^]
(0085159)
git (administrator)
2019-06-20 09:58

Branch CR30700 has been created by iko.

SHA-1: a09e93e84b4cd643c202b196008e8c7cd96e07d7


Detailed log of new commits:

Author: iko
Date: Thu Jun 20 09:53:20 2019 +0300

    0030700: 0030700: Visualization, TKOpenGl - support PBR Metallic-Roughness shading model
    
    Metallic-Roughness shading model has been implemented.
    New materials descriptors has been added to standard materal library.
    Light sources intensities are supported now in pbr shading model.
(0085164)
git (administrator)
2019-06-20 10:58

Branch CR30700 has been updated forcibly by iko.

SHA-1: b8818a8be3628d41a2c45fc1866402ec1f41c8cb
(0085181)
git (administrator)
2019-06-20 15:18

Branch CR30700 has been updated by iko.

SHA-1: d744023498a06f51bb1157ccc30e8d6f87ff59c0


Detailed log of new commits:

Author: iko
Date: Thu Jun 20 15:17:11 2019 +0300

    # implement facet pbr shading model

(0085201)
git (administrator)
2019-06-21 16:33

Branch CR30700 has been updated by iko.

SHA-1: 71cd6bc929c2db4b69d6a9e0e8c91f674c97e07d


Detailed log of new commits:

Author: iko
Date: Fri Jun 21 16:31:41 2019 +0300

    # generating and header storage of environment LUT has been implemented

(0085632)
git (administrator)
2019-07-15 14:06

Branch CR30700 has been updated forcibly by iko.

SHA-1: 2181966edb04f0b7d5bd53f19fcbdac4b0fd99b1
(0087047)
git (administrator)
2019-09-13 12:29

Branch CR30700 has been updated forcibly by iko.

SHA-1: 52689bef0717737e80177644eff6c31525ef9d10
(0087049)
git (administrator)
2019-09-13 12:54

Branch CR30700 has been updated forcibly by iko.

SHA-1: 48b87406f4c551d6eabb7b4512ccdb2afd2aaa8c
(0087119)
git (administrator)
2019-09-16 12:06

Branch CR30700 has been updated forcibly by iko.

SHA-1: af255a64b454efd98fa630490161e5257b0a7e04
(0087160)
git (administrator)
2019-09-16 17:27

Branch CR30700 has been updated by iko.

SHA-1: 87e0fec692555507a98b5808fe0ae7c0e6ea2cb8


Detailed log of new commits:

Author: iko
Date: Mon Sep 16 17:22:55 2019 +0300

    # implement PBREnvironment baking control to RenderParams
(0087246)
git (administrator)
2019-09-18 12:49

Branch CR30700 has been updated by iko.

SHA-1: 15c75be3163f4c367318d67d8e8efe9633330dda


Detailed log of new commits:

Author: iko
Date: Wed Sep 18 12:45:10 2019 +0300

    # add documentation
Author: iko
Date: Wed Sep 18 12:31:50 2019 +0300

    # remove 'uint' type from all PBR functions
Author: iko
Date: Wed Sep 18 11:57:35 2019 +0300

    # fix missing sampler parameters applying
Author: iko
Date: Tue Sep 17 17:37:50 2019 +0300

    # add warning messages
    # add basic test cases
    # fix crash during changing shading model to PBR first time

(0087316)
git (administrator)
2019-09-19 17:05

Branch CR30700 has been updated forcibly by iko.

SHA-1: 1a6697ad0ab4caddcb63de44558d393883e49fc0
(0087355)
git (administrator)
2019-09-20 12:48

Branch CR30700 has been updated forcibly by iko.

SHA-1: 33f2cee09d3e269c883f4cb309db5fcb3520aece
(0087356)
git (administrator)
2019-09-20 13:06

Branch CR30700 has been updated by iko.

SHA-1: 3104b4a895bed76621c38b7b52e87ce9289c4c93


Detailed log of new commits:

Author: iko
Date: Fri Sep 20 13:01:45 2019 +0300

    # fix compiler warnings
(0087362)
git (administrator)
2019-09-20 13:40

Branch CR30700 has been updated forcibly by iko.

SHA-1: 8d86509b2b512a62752e5d3a43e173e975417f41
(0087365)
git (administrator)
2019-09-20 14:20

Branch CR30700 has been updated forcibly by iko.

SHA-1: 5224804adb8d8864482963ef5c694c9764c81a60
(0087455)
git (administrator)
2019-09-23 18:16

Branch CR30700_squashed has been created by kgv.

SHA-1: 8fe62c4b587064c8516bd715d7a6474707211b67


Detailed log of new commits:

Author: iko
Date: Thu Jun 20 09:53:20 2019 +0300

    0030700: Visualization, TKOpenGl - support PBR Metallic-Roughness shading model
    
    Metallic-Roughness shading model has been implemented.
    New materials descriptors has been added to standard materal library.
    Light sources intensities are supported now in pbr shading model.
    
    implement facet pbr shading model
    generating and header storage of environment LUT has been implemented
    implement PBREnvironment baking
(0087457)
git (administrator)
2019-09-23 21:27

Branch CR30700 has been updated forcibly by iko.

SHA-1: e135eb121b86a0b6384d73f2f90f11d3117556fc
(0087461)
git (administrator)
2019-09-24 11:02

Branch CR30700 has been updated forcibly by iko.

SHA-1: e61faa6bdd5cf42fafa4aa2fa52b32930d23f3ba
(0087465)
kgv (developer)
2019-09-24 11:53

+  //! in order to provide environment indirect illumination in PBR shading model (Image Based Lightning).


Lighting, as there no thunder around.

+  virtual void GenPBREnvironment() = 0;

It is better avoiding confusing abbreviations in API methods - GeneratePBREnvironment() or UpdatePBREnvironment().

+++ b/src/Graphic3d/Graphic3d_PBRMaterial.cxx
@@ -0,0 +1,346 @@
+// Author: Ilya Khramov
+// Copyright (c) 2016-2019 OPEN CASCADE SAS

Please check headers for new files.

+void Graphic3d_PBRMaterial::SetMetallic (Standard_ShortReal theMetallic)
+{
+  myMetallic = clamp (theMetallic);
+}

It would be better throwing Graphic3d_MaterialDefinitionError exception on wrong input.

+void Graphic3d_PBRMaterial::SetColor (const Quantity_Color& theColor)
+{
+  SetColor (Graphic3d_Vec3 (static_cast<Standard_ShortReal> (theColor.Red()),
+                            static_cast<Standard_ShortReal> (theColor.Green()),
+                            static_cast<Standard_ShortReal> (theColor.Blue())));
+}

Quantity_Color defines cast operator to Graphic3d_Vec3.

+void Graphic3d_PBRMaterial::SetBSDF (const Graphic3d_BSDF& theBSDF)
+{

Would be good having also a method performing conversion in opposite direction.

+Standard_Boolean Graphic3d_PBRMaterial::operator== (const Graphic3d_PBRMaterial &theOther) const

+{
+  return (myMetallic == theOther.myMetallic)

Better inlining trivial methods within Graphic3d_PBRMaterial.

+void Graphic3d_PBRMaterial::GenerateEnvLUT (const Handle(Image_PixMap) &theLUT,
+Graphic3d_Vec3 Graphic3d_PBRMaterial::importanceSample (const Graphic3d_Vec2 &theHammerslayPoint,

+Graphic3d_Vec3 Graphic3d_PBRMaterial::view (Standard_ShortReal theCosV)
+Graphic3d_Vec3 Graphic3d_PBRMaterial::reflect (const Graphic3d_Vec3 &theVector,
+                                               const Graphic3d_Vec3 &theAxis)

Unexpected &.
GenerateEnvironmentLUT?
Maybe internal methods intended for LUT generation like importanceSample() could be prefixed somehow [lutImportanceSample()]?

+      theLUT->ChangeValue<Graphic3d_Vec3>(theLUT->SizeX() - 1 - y, x) = aResult;

theLUT->SizeY()?

+    if ((theNumber >> i) != 0)
+    {
+      aPhi2 += ((theNumber >> i) & 1) / Standard_ShortReal(1 << (i + 1));
+    }
+    else
+    {
+      break;
+    }

Putting a 'break' first without 'else' would probably look more natural.

+//! Class implementing Metallic-Roughness physically based material system
+class Graphic3d_PBRMaterial

"material system" -> "material definition"?

+
+  static const Standard_ShortReal MIN_ROUGHNESS; //!< Roughness cannot be 0 in real calculations, 
so it is minimal achievable level of roughness in practice

Non-integer constants may cause problems sometimes.
Better defining as method.
(0087472)
kgv (developer)
2019-09-24 13:27

+  Graphic3d_Vec4     myColor;     //!< base color with alpha component [0, 1]

As it called color and used as a color - please define it as Quantity_ColorRGBA.

+  Graphic3d_Vec3     myEmission;  //!< light intensity emitted by material [>= 0]
+  Standard_ShortReal myIOR;       //!< index of refraction [1, 3]
+  Graphic3d_Vec4     myColor;     //!< base color with alpha component [0, 1]

Is there some reason putting myEmission before the color?
I would reorder properties to put color first.

+  //! Returns base color with alpha component of material.
+  //! All 4 values are in range [0, 1].
+  //! (1, 1, 1, 1) by default.
+  const Graphic3d_Vec4& Color() const { return myColor; }

Might worth mentioning another alias of this property in description - albedo.

+  //! (1, 1, 1, 1) by default.
+  const Graphic3d_Vec4& Color() const { return myColor; }
...
+  myColor     (0.f, 0.f, 0.f, 1.f),

Description/implementation mismatch.
I would drop by default mentioning, as there is no meaningful default for material color - empty constructor description could be extended with initialization parameters instead.

   Standard_ShortReal                WhitePoint;                  //!< white point value used in filmic 
tone mapping (path tracing), 1.0 by default
 
+  Standard_Integer                  PBREnvPow2Size;              //!< size of IBL maps side can be 
calculated as 2^PBREnvPow2Size
+  Standard_Integer                  PBREnvSpecMapLevelsNumber;   //!< number of levels used in specular 
IBL map
+  Standard_Integer                  PBREnvBakingSamplesNumber;   //!< number of samples used in Monte-Carlo 
integration during PBR environment generation

Please put PBR rendering parameters before RayTracing options.

+  //! Physically based illumination system.
+  Graphic3d_TOSM_PBR,

Metalic-roughness physically based (PBR) illumination system.

+  //! Flat physically based shading.
+  Graphic3d_TOSM_PBR_FACET,

//! Same as Graphic3d_TOSM_PBR but using flat per-triangle normal.

+  Graphic3d_TextureUnit myPBRDiffIBLMapTexUnit; //!< texture unit where specular IBL map is expected 
to  be binded (0 if PBR is not supported)

"to be bound".

+    glGetIntegerv (GL_DRAW_FRAMEBUFFER_BINDING, &myFBO);

This would cause issues on Android as GL_DRAW_FRAMEBUFFER_BINDING has been introduced singe GLES3.

+  Standard_ShortReal           myClearColor[4];

Graphic3d_Vec4.

+  Handle(OpenGl_PBREnvironment) anEnvironment;
+
+  if (theCtx->arbFBO != NULL)
+  {

if (theCtx->arbFBO = NULL)
{
  return Handle(OpenGl_PBREnvironment)();
}

+  :
+  myPow2Size (std::max (1u, thePowOf2Size)),

I see some rationale for this syntax with : on dedicated line,
but it is uncommon to OCCT, where is usually placed on the same line with first field:
+: myPow2Size (std::max (1u, thePowOf2Size)),

+  if (theCtx != NULL)
+  {
+    theCtx->arbFBO->glDeleteFramebuffers (1, &myFBO);
+  }

myFBO is not checked for validness and not reset after deletion.

+  GLuint              myFBO;        //!< frame buffer object to generate or clear IBL maps

myFBO is not specified within field initialization list.

+  myIsComplete (Standard_True)
...
+  myIsComplete = myIsComplete && initVAO(theCtx);
+  myIsComplete = myIsComplete && initTextures (theCtx);
+  myIsComplete = myIsComplete && checkFBOComplentess (theCtx);

Weird style - it is better initializing myIsComplete=false and then setting it.

+void OpenGl_PBREnvironment::initFBO (const Handle(OpenGl_Context)& theCtx)
+{
+  theCtx->arbFBO->glGenFramebuffers (1, &myFBO);

Looks more like "createFBO()" and method lacks check if myFBO was already generated.

+// =======================================================================
+// function : processCubeMapSide
+// purpose  :
+// =======================================================================
+void OpenGl_PBREnvironment::processIBLMap (const Handle(OpenGl_Context)& theCtx,

Mismatch.

+  theCtx->ShaderManager()->BindPBREnvBakingProgram();
+  if (theCtx->ActiveProgram().IsNull())

Usually BindPBREnvBakingProgram() returns TRUE on success.

+  myVBO.BindAttribute (theCtx, Graphic3d_TOA_POS);
+  theCtx->arbFBO->glBindFramebuffer (GL_DRAW_FRAMEBUFFER, myFBO);

I would expect FBO being bound before VBOs.

+class OpenGl_PBREnvironment : public Standard_Transient
+{

OpenGl_NamedResource.

+  setParameter(theCtx, theSampler, theTarget, GL_TEXTURE_BASE_LEVEL, theParams->BaseLevel());
+  setParameter(theCtx, theSampler, theTarget, GL_TEXTURE_MAX_LEVEL,  theParams->MaxLevel());

if (IsGlGreaterEqual (1, 2))
(0087479)
kgv (developer)
2019-09-24 14:34

 #include <OpenGl_Workspace.hxx>
+#include "../Textures/Textures_EnvLUT.pxx"
 
 #include <TCollection_ExtendedString.hxx>

Better moving after all "normal" includes.

+//! The same function as THE_FUNC_transformNormal but is used in PBR pipeline.
+//! The normals are expected to be in world coordinate system in PBR pipeline.
+const char THE_FUNC_PBR_transformNormal[] =

Please add coordinate system description to THE_FUNC_transformNormal.
And it might be better renaming variables to THE_FUNC_transformNormal_Model + THE_FUNC_transformNormal_World or similar instead of "PBR", which looks irrelevant.

+const char THE_FUNC_PBR_transformNormal[] =
+EOL"vec3 transformNormal (in vec3 theNormal)"
+EOL"{"

Indentation is inconsistent to other string constants in the file.

+const char THE_FUNC_PBR_lightDef[] =
+  EOL"vec3  DirectLightning;"  //!< Accumulator of direct lightning from light sources

+  EOL"vec4  BaseColor;"        //!< Base color (albedo) of material for PBR
+  EOL"float Metallic;"         //!< Metallic coefficient of material
+  EOL"float Roughness;"        //!< Roughness coefficient of material
+  EOL"float IOR;"              //!< Material's index of refraction
+  EOL"vec3  Emission;";        //!< Light intensity emitted by material

Please consider reordering variables taking into account pushing these constants into UBO in some future.

+  EOL"float geometry (in float theCosV,"
+  EOL"                in float theCosL,"
+  EOL"                in float theRoughness)"
+  EOL"{"
+  EOL"  float k = theRoughness + 1.0;"
+  EOL"  k *= 0.125 * k;"
+  EOL"  float g1 = 1.0;"
+  EOL"  g1 /= g1 * (1.0 - k) + k;"
+  EOL"  float g2 = 1.0;"
+  EOL"  g2 /= g2 * (1.0 - k) + k;"
+  EOL"  return g1 * g2;"
+  EOL"}";

Why not just
+ EOL" float k = theRoughness + 1.0;"
+ EOL" k *= 0.125 * k;"
+ EOL" float g1 = 1.0 / ((1.0 - k) + k);"
+ EOL" return g1 * g1;"
?

+  EOL""

"" is redundant (just EOL).
(0087480)
git (administrator)
2019-09-24 14:38

Branch CR30700 has been updated by iko.

SHA-1: 304aab734594e2551f204dc5cbe78611325cd1ab


Detailed log of new commits:

Author: iko
Date: Tue Sep 24 14:33:48 2019 +0300

    
    # implement 2-channel image type
(0087481)
git (administrator)
2019-09-24 14:44

Branch CR30700 has been updated by iko.

SHA-1: 05101e4e31e75a4a282e88968fd5bc40f5e9d1b5


Detailed log of new commits:

Author: iko
Date: Tue Sep 24 14:40:41 2019 +0300

    # fix compiler warnings 2
(0087483)
git (administrator)
2019-09-24 15:04

Branch CR30700 has been updated by iko.

SHA-1: 86af5d697ec5f5a912901337d3b83463e7338ef5


Detailed log of new commits:

Author: iko
Date: Tue Sep 24 15:00:24 2019 +0300

    # fix compiler warnings
    # delete 'lightning'
(0087485)
kgv (developer)
2019-09-24 15:43

+//! Returns coordinates of point theNumber from hammersley point set having size theSize.

Hammersley, as it is a name.

+  theProgram->SetUniform (myContext, "occSpecIBLLevelsNumber", myLightSourceState.SpecIBLMapLevels());


Should be added to OpenGl_StateVariable.
And probably renamed occSpecIBLLevelsNumber -> occNbSpecIBLLevels.

+    }
+
+

Please avoid redundant double empty lines.

-    + aLightsLoop
-    + EOL"  vec4 aMatAmbient  = " + aGetMatAmbient
-    + EOL"  vec4 aMatDiffuse  = " + aGetMatDiffuse
-    + EOL"  vec4 aMatSpecular = theIsFront ? occFrontMaterial_Specular() : occBackMaterial_Specular();"

+      + aLightsLoop
+      + EOL"  vec4 aMatAmbient  = " + aGetMatAmbient
+      + EOL"  vec4 aMatDiffuse  = " + aGetMatDiffuse
+      + EOL"  vec4 aMatSpecular = theIsFront ? occFrontMaterial_Specular() : occBackMaterial_Specular();"


Unexpected change.

+      + THE_FUNC_lightDef
+      + aLightsFunc
+      + EOL
       EOL"vec4 computeLighting (in vec3 theNormal,"

Please adjust indentation.

+      EOL"  vec2 Coeff = occTexture2D (occEnvLUT, vec2(abs(dot(theView, theNormal)), Roughness)).xy;"


const vec2 aCoeff

+  const TCollection_AsciiString aProgId = TCollection_AsciiString (theIsFlatNormal ? "flat-" 
: "phong-") + (theIsPBR ? "PBR-" : "") + genLightKey (myLightSourceState.LightSources()) 
+ "-";

Shader ids are lower-case by convention.

+  Handle(Graphic3d_ShaderProgram) aProgramSrc = new Graphic3d_ShaderProgram;

new Graphic3d_ShaderProgram()

+  TCollection_AsciiString aSrcFrag, aSrcVert;
+
+  aSrcVert += TCollection_AsciiString()
...
+
+  aSrcFrag += TCollection_AsciiString()
+  + THE_FUNC_PBR_hammersley

+= looks awkward here.

+Graphic3d_TypeOfShadingModel OpenGl_ShaderManager::PBRShadingModelFallback (Graphic3d_TypeOfShadingModel 
theShadingModel,
+                                                                            Standard_Boolean             
thePBRIsAllowed

theIsPbrAllowed.
Please move to header.

+  //! Checks whether one of PBR shading models is set as default model.
+  Standard_Boolean PBRIsAllowed() const { return myShadingModel == Graphic3d_TOSM_PBR
+                                              || myShadingModel == Graphic3d_TOSM_PBR_FACET; }

IsPbrAllowed().

+  //! Sets number of mipmap levels used in specular IBL map.
+  void SetSpecIBLMapLevels (Standard_Integer theSpecIBLMapLevels) { mySpecIBLMapLevels = theSpecIBLMapLevels; 
}
+
+  //! Returns number of mipmap levels used in specular IBL map.
+  //! 0 by default or in case of using non-PBR shading model.
+  Standard_Integer SpecIBLMapLevels() const { return mySpecIBLMapLevels; }

Please declare getter first.

+  PBRColor    = theMat.PBRMaterial().Color();

Looks like color of "non-physical" material is ignored here.

+  aFile << "//this file generated by vgenenvlut draw command\n";

has been generated
(0087500)
kgv (developer)
2019-09-25 08:09

+  OpenGl_Vec4 Emission;       //!< material emission
+  OpenGl_Vec4 Params;         //!< extra packed parameters
+  OpenGl_Vec4 PBRColor;       //!< base color of PBR material with alpha component
..
+vec4  occFrontMaterial_Specular(void);            //!< Specular reflection
+vec4  occFrontMaterial_PBRColor(void);            //!< Base color of PBR material

Please separate common/PBR material definition parameters passed to GLSL program:
- Split materials within OpenGl_Material in two groups (either as sub-structures, or as OpenGl_PBRMaterial).
- Add flag IsPBR() or similar to Graphic3d_ShaderProgram.
- Add THE_IS_PBR macros to Declarations.glsl managed by IsPBR().
- Use different variables for PBR within DeclarationsImpl.glsl (e.g. occPBRFrontMaterial or similar).
- The same might be applied to light sources, if not all obsolete parameters are used by PBR lighting.
(0087504)
kgv (developer)
2019-09-25 10:39

+  //! Enum classified the type of IBL map
+  enum OpenGl_TypeOfIBLMap
+  {
+    OpenGl_TOIM_Diffuse,
+    OpenGl_TOIM_Specular
+  };
...
+  //! State of PBR environment.
+  enum PBREnvironmentState
+  {
+    OpenGl_PES_NONEXISTENT,
+    OpenGl_PES_UNAVAILABLE, // indicates failed try to create PBR environment
+    OpenGl_PES_CREATED
+  };
+
+  //! Type of action which can be done with PBR environment.
+  enum PBREnvironmentRequest
+  {
+    OpenGl_PER_NONE,
+    OpenGl_PER_BAKE,
+    OpenGl_PER_CLEAR
+  };

OpenGl_TOIM_ is an old CDL style for enumeration values, it is no more recommended (complicates association of OpenGl_TOIM_ values with enumeration name).
More convenient style is using full enumeration name as prefix, e.g. OpenGl_TypeOfIBLMap_Diffuse.
(0087510)
git (administrator)
2019-09-25 14:19

Branch CR30700_1 has been created by iko.

SHA-1: 7aa5f7f5a62d0f04406e66fe83b077cdb5e486ab


Detailed log of new commits:

Author: iko
Date: Thu Jun 20 09:53:20 2019 +0300

    0030700: Visualization, TKOpenGl - support PBR Metallic-Roughness shading model
    
    Metallic-Roughness shading model has been implemented.
    New materials descriptors has been added to standard materal library.
    Light sources intensities are supported now in pbr shading model.
(0087566)
git (administrator)
2019-09-27 12:04

Branch CR30700_1 has been updated by iko.

SHA-1: b78e60723ce7002b4710aefc0919281e22cf074f


Detailed log of new commits:

Author: iko
Date: Fri Sep 27 12:03:37 2019 +0300

    # fix remarks
(0087569)
git (administrator)
2019-09-27 12:55

Branch CR30700_1 has been updated forcibly by iko.

SHA-1: 4df9f23ac1fae5d9a7f2e22b6cfb87f4426df326
(0087571)
git (administrator)
2019-09-27 14:07

Branch CR30700_1 has been updated forcibly by iko.

SHA-1: 4694e33d209e5e5b1771545a6406644d3026e617
(0087579)
kgv (developer)
2019-09-27 17:15

+      EOL"  anIndirectLightingSpec *= occTextureCubeLod (occSpecIBLMap, -reflect (theView, theNormal), 
Roughness * float (occNbSpecIBLLevels - 1)).rgb;"

textureCubeLod() with 'Lod' suffix is disallowed by specs in Fragment shader for versions before GLSL 130 and GLSL 300 es:
> The built-ins suffixed with “Lod” are allowed only in a vertex shader.

Either, the fallback not using occTextureCubeLod() in fragment shader should be provided, or minimal requirements for PBR renderer should be increased.
(0087581)
kgv (developer)
2019-09-27 18:36

Please also extend vlistmaterials with PBR metalic-roughness material properties.
(0087582)
kgv (developer)
2019-09-27 18:38

Building issues on Android platform:

C:\occt.git\src\OpenGl\OpenGl_FrameBuffer.cxx: In static member function 'static Standard_Boolean OpenGl_FrameBuffer::BufferDump(const 
opencascade::handle<OpenGl_Context>&, const opencascade::handle<OpenGl_FrameBuffer>&, 
Image_PixMap&, Graphic3d_BufferType)':
C:\occt.git\src\OpenGl\OpenGl_FrameBuffer.cxx:745:10: warning: enumeration value 'Image_Format_RGF' not 
handled in switch [-Wswitch]
   switch (theImage.Format())
          ^
C:\occt.git\src\OpenGl\OpenGl_Sampler.cxx: In static member function 'static void OpenGl_Sampler::applySamplerParams(const 
opencascade::handle<OpenGl_Context>&, const opencascade::handle<Graphic3d_TextureParams>&, 
OpenGl_Sampler*, GLenum, bool)':
C:\occt.git\src\OpenGl\OpenGl_Sampler.cxx:267:50: error: 'GL_TEXTURE_BASE_LEVEL' was not declared in 
this scope
     setParameter (theCtx, theSampler, theTarget, GL_TEXTURE_BASE_LEVEL, theParams->BaseLevel());
                                                  
^
C:\occt.git\src\OpenGl\OpenGl_Sampler.cxx:268:50: error: 'GL_TEXTURE_MAX_LEVEL' was not declared in this 
scope
     setParameter (theCtx, theSampler, theTarget, GL_TEXTURE_MAX_LEVEL,  theParams->MaxLevel());
(0087583)
git (administrator)
2019-09-27 21:09

Branch CR30700_1 has been updated by kgv.

SHA-1: 9706f274589e7ad6750a2c067be57954e8e71ddc


Detailed log of new commits:

Author: kgv
Date: Fri Sep 27 21:09:06 2019 +0300

    # corrections

(0087584)
kgv (developer)
2019-09-27 21:18

+  GLint aLocation = theProgram->GetStateLocation (OpenGl_OCCT_NB_SPEC_IBL_LEVELS);
+  if (aLocation != OpenGl_ShaderProgram::INVALID_LOCATION)

For new code OpenGl_ShaderUniformLocation is preferred:
if (const OpenGl_ShaderUniformLocation aLocBack = theProgram->GetStateLocation (OpenGl_OCCT_NB_SPEC_IBL_LEVELS))
(0087585)
git (administrator)
2019-09-27 21:51

Branch CR30700_1 has been updated by kgv.

SHA-1: e660b93e4564cfbfbef9d00c84490b46b12b6f1e


Detailed log of new commits:

Author: kgv
Date: Fri Sep 27 21:51:13 2019 +0300

    OpenGl_PBREnvironment::Release() - fix crash on accessing invalid OpenGL context

(0087586)
git (administrator)
2019-09-27 22:15

Branch CR30700_1 has been updated by kgv.

SHA-1: 730c6f80d98747aa08ebcd12ba9224eb5c76b173


Detailed log of new commits:

Author: kgv
Date: Fri Sep 27 22:15:14 2019 +0300

    # fix material transparency loss

(0087587)
git (administrator)
2019-09-27 22:50

Branch CR30700_1 has been updated by kgv.

SHA-1: f54360b1268305ca35daa8a5e5e2767893915578


Detailed log of new commits:

Author: kgv
Date: Fri Sep 27 22:50:43 2019 +0300

    # do not extend list of deprecated constants
    # fix texture internal format for Image_Format_RGF

(0087588)
git (administrator)
2019-09-27 23:12

Branch CR30700_1 has been updated forcibly by kgv.

SHA-1: 66b0d93ebb19e2aa328decff89915e1fcf3ee3bc
(0087595)
git (administrator)
2019-09-28 22:05

Branch CR30700_1 has been updated by kgv.

SHA-1: d0c18cb6e6e6d7d2bd9728c36fcacfbbefc45398


Detailed log of new commits:

Author: kgv
Date: Sat Sep 28 22:05:24 2019 +0300

    # OpenGl_PBREnvironment::Bind() - avoid non-symmetrical bind/unbind texture units

(0087596)
git (administrator)
2019-09-28 22:36

Branch CR30700_1 has been updated by kgv.

SHA-1: e9994761b431f16251acd1420104fa2e9aab36d0


Detailed log of new commits:

Author: kgv
Date: Sat Sep 28 22:36:25 2019 +0300

    # OpenGl_PBREnvironment - remove redundant default argument theIsDrawAction value

(0087597)
git (administrator)
2019-09-28 23:35

Branch CR30700_1 has been updated by kgv.

SHA-1: 770ce60e56ece5836fc9e4a0116d47e5b2559a3b


Detailed log of new commits:

Author: kgv
Date: Sat Sep 28 23:35:03 2019 +0300

    # THE_FUNC_PBR_directionalLightFirst - remove unused variable aHalf

(0087662)
git (administrator)
2019-10-01 15:34

Branch CR30700_1 has been updated forcibly by kgv.

SHA-1: cb0803c3f01417175b0901b88fd19ab8af895fe3
(0087669)
git (administrator)
2019-10-01 17:52

Branch CR30700_1 has been updated by kgv.

SHA-1: cbc0096d34f3ef4135588812b9b7040aab38950d


Detailed log of new commits:

Author: kgv
Date: Tue Oct 1 17:51:53 2019 +0300

    # OpenGl_View::SetBackgroundCubeMap() - do not crash on NULL argument; added TODOs

(0087670)
git (administrator)
2019-10-01 18:06

Branch CR30700_1 has been updated by kgv.

SHA-1: 830a375dd43ff3d8c5e60b2da3a9411c4251cbd0


Detailed log of new commits:

Author: kgv
Date: Tue Oct 1 18:05:49 2019 +0300

    # OpenGl_PBREnvironment - fix binding VBO without default VAO in Core Profile

(0087681)
git (administrator)
2019-10-02 09:28

Branch CR30700_1 has been updated by kgv.

SHA-1: d9b0d37f038cb7e42994bc314a92f0ee2054223a


Detailed log of new commits:

Author: kgv
Date: Wed Oct 2 09:27:51 2019 +0300

    # OpenGl_ShaderManager - fix cubemap shader compilation on Andreno due to implicit cast

(0087682)
git (administrator)
2019-10-02 09:51

Branch CR30700_1 has been updated by kgv.

SHA-1: 5539a2e6e5eae55dca8b48f2819a57ef6183e016


Detailed log of new commits:

Author: kgv
Date: Wed Oct 2 09:51:12 2019 +0300

    # occLight_Intensity() - revert expansion of light sources array definition, pack intensity

(0087686)
git (administrator)
2019-10-02 10:54

Branch CR30700_1 has been updated by kgv.

SHA-1: 2c7bf7922f65decbaa11e22992e952d03983c7e6


Detailed log of new commits:

Author: kgv
Date: Wed Oct 2 10:54:02 2019 +0300

    # OpenGl_Material - separate Commong and PBR material definitions

(0087695)
git (administrator)
2019-10-02 16:58

Branch CR30700_1 has been updated by kgv.

SHA-1: 55dc17d3711733f15f51205343056e6da18e966a


Detailed log of new commits:

Author: kgv
Date: Wed Oct 2 16:57:59 2019 +0300

    # OpenGl_ShaderManager::defaultGlslVersion() - define minimal GLSL version for PBR
    # as OpenGL 3.0, OpenGL ES 3.0 or OpenGL 2.1 + GL_EXT_gpu_shader4

Author: kgv
Date: Wed Oct 2 16:13:40 2019 +0300

    occLight_IsHeadlight() now returns bool instead of int.
    Avoid using lowp for enumerations.
    
    Workaround occLight_IsHeadlight() ignorance on Adreno 308
    caused by some GLSL optimizator bugs.

Author: kgv
Date: Wed Oct 2 13:44:01 2019 +0300

    # THE_FUNC_PBR_directionalLightFirst - eliminate redundant duplicate

(0087700)
git (administrator)
2019-10-02 17:45

Branch CR30700_1 has been updated by kgv.

SHA-1: 9ee6734946ed2dba4578a58831e89affb62df8a5


Detailed log of new commits:

Author: kgv
Date: Wed Oct 2 17:45:06 2019 +0300

    # OpenGl_FrameBuffer::BufferDump - suppress compiler warning concerning Image_Format_RGF

(0087726)
git (administrator)
2019-10-02 22:26

Branch CR30700_1 has been updated by kgv.

SHA-1: 48867171d2130842f730c0f500c686b357584167


Detailed log of new commits:

Author: kgv
Date: Wed Oct 2 22:26:26 2019 +0300

    # fix LUT texture initialization on Android, where GL_RG32F is NOT texture-filterable format on most hardware.
    # GL_RG16F is used instead.

(0087769)
git (administrator)
2019-10-03 15:32

Branch CR30700_1 has been updated by kgv.

SHA-1: 0560cc1ae61ee074457ef954967ccc701a241e3d


Detailed log of new commits:

Author: kgv
Date: Thu Oct 3 15:32:08 2019 +0300

    # fix GLSL compilation errors on PBR env baking program

(0087794)
git (administrator)
2019-10-03 20:29

Branch CR30700_1 has been updated by kgv.

SHA-1: 9ef2ebc7d3f1a3339b066532a67d84a667d13d0b


Detailed log of new commits:

Author: kgv
Date: Thu Oct 3 20:28:53 2019 +0300

    # cosmetics

(0087795)
git (administrator)
2019-10-03 21:19

Branch CR30700_1 has been updated by kgv.

SHA-1: e189c6dbd6b959bfd95d90145f6cfdd92119787b


Detailed log of new commits:

Author: kgv
Date: Thu Oct 3 21:18:46 2019 +0300

    # cosmetics

(0087796)
git (administrator)
2019-10-03 21:39

Branch CR30700_1 has been updated by kgv.

SHA-1: 0b775c11c37893eebd0b312ed1dad4f19d5caced


Detailed log of new commits:

Author: kgv
Date: Thu Oct 3 21:38:57 2019 +0300

    OpenGl_Texture::EstimatedDataSize() - fixed estimation for Cubemap textures

(0087797)
git (administrator)
2019-10-04 00:26

Branch CR30700_1 has been updated by kgv.

SHA-1: 5796167188f4d75916483a31f73a0c46970c3f21


Detailed log of new commits:

Author: kgv
Date: Fri Oct 4 00:25:47 2019 +0300

    OpenGl_Sampler::applySamplerParams() - fixed uninitialized GL_TEXTURE_WRAP_R in case of GL_TEXTURE_CUBE_MAP target.

(0087810)
git (administrator)
2019-10-04 13:23

Branch CR30700_1 has been updated by kgv.

SHA-1: 674ac02c5ec0651de287da4b148118524c9645fb


Detailed log of new commits:

Author: kgv
Date: Fri Oct 4 13:22:41 2019 +0300

    # OpenGl_PBREnvironment - performance profiling

(0087887)
kgv (developer)
2019-10-06 10:41
edited on: 2019-10-06 11:26

Adreno 512 - IBL baking hangs (application doesn't respond for some reason).
Times with added glFinish(), 1024 samples:
10-06 10:34:03.824 D/CadAssistant(11562): processIBLMap(SPECULAR, DRAW, 5 16x16) filled in 0.020619 s

10-06 10:34:03.839 D/CadAssistant(11562): processIBLMap(SPECULAR, DRAW, 5 16x16) filled in 0.013906 s

10-06 10:34:03.853 D/CadAssistant(11562): processIBLMap(SPECULAR, DRAW, 5 16x16) filled in 0.013695 s

10-06 10:34:03.866 D/CadAssistant(11562): processIBLMap(SPECULAR, DRAW, 5 16x16) filled in 0.012632 s

10-06 10:34:03.879 D/CadAssistant(11562): processIBLMap(SPECULAR, DRAW, 5 16x16) filled in 0.013041 s

10-06 10:34:03.892 D/CadAssistant(11562): processIBLMap(SPECULAR, DRAW, 5 16x16) filled in 0.012706 s

10-06 10:34:03.925 D/CadAssistant(11562): processIBLMap(SPECULAR, DRAW, 4 32x32) filled in 0.032434 s

10-06 10:34:03.958 D/CadAssistant(11562): processIBLMap(SPECULAR, DRAW, 4 32x32) filled in 0.032421 s

10-06 10:34:03.990 D/CadAssistant(11562): processIBLMap(SPECULAR, DRAW, 4 32x32) filled in 0.03109 s

10-06 10:34:04.015 D/CadAssistant(11562): processIBLMap(SPECULAR, DRAW, 4 32x32) filled in 0.024692 s

10-06 10:34:04.035 D/CadAssistant(11562): processIBLMap(SPECULAR, DRAW, 4 32x32) filled in 0.019536 s

10-06 10:34:04.055 D/CadAssistant(11562): processIBLMap(SPECULAR, DRAW, 4 32x32) filled in 0.019762 s

10-06 10:34:04.125 D/CadAssistant(11562): processIBLMap(SPECULAR, DRAW, 3 64x64) filled in 0.069585 s

10-06 10:34:04.170 D/CadAssistant(11562): processIBLMap(SPECULAR, DRAW, 3 64x64) filled in 0.044642 s

10-06 10:34:04.213 D/CadAssistant(11562): processIBLMap(SPECULAR, DRAW, 3 64x64) filled in 0.042468 s

10-06 10:34:04.255 D/CadAssistant(11562): processIBLMap(SPECULAR, DRAW, 3 64x64) filled in 0.042348 s

10-06 10:34:04.300 D/CadAssistant(11562): processIBLMap(SPECULAR, DRAW, 3 64x64) filled in 0.043973 s

10-06 10:34:04.347 D/CadAssistant(11562): processIBLMap(SPECULAR, DRAW, 3 64x64) filled in 0.04662 s

10-06 10:34:04.507 D/CadAssistant(11562): processIBLMap(SPECULAR, DRAW, 2 128x128) filled in 0.159907 
s
10-06 10:34:04.667 D/CadAssistant(11562): processIBLMap(SPECULAR, DRAW, 2 128x128) filled in 0.158927 
s
10-06 10:34:04.823 D/CadAssistant(11562): processIBLMap(SPECULAR, DRAW, 2 128x128) filled in 0.15533 
s
10-06 10:34:04.981 D/CadAssistant(11562): processIBLMap(SPECULAR, DRAW, 2 128x128) filled in 0.158143 
s
10-06 10:34:05.140 D/CadAssistant(11562): processIBLMap(SPECULAR, DRAW, 2 128x128) filled in 0.157671 
s
10-06 10:34:05.299 D/CadAssistant(11562): processIBLMap(SPECULAR, DRAW, 2 128x128) filled in 0.158583 
s
10-06 10:34:05.890 D/CadAssistant(11562): processIBLMap(SPECULAR, DRAW, 1 256x256) filled in 0.591154 
s
10-06 10:34:06.485 D/CadAssistant(11562): processIBLMap(SPECULAR, DRAW, 1 256x256) filled in 0.594755 
s
10-06 10:34:07.071 D/CadAssistant(11562): processIBLMap(SPECULAR, DRAW, 1 256x256) filled in 0.585593 
s
10-06 10:34:07.212 W/MiuiPerfServiceClient( 3422): interceptAndQueuing:2521|com.android.systemui|286|286|unknown|null|StatusBar|21902967364767|Slow 
swap buffers|1
10-06 10:34:07.660 D/CadAssistant(11562): processIBLMap(SPECULAR, DRAW, 1 256x256) filled in 0.588466 
s
10-06 10:34:08.249 D/CadAssistant(11562): processIBLMap(SPECULAR, DRAW, 1 256x256) filled in 0.588234 
s
10-06 10:34:08.841 D/CadAssistant(11562): processIBLMap(SPECULAR, DRAW, 1 256x256) filled in 0.591177 
s
10-06 10:34:09.197 D/PerfShielderService( 2317): com.android.systemui|StatusBar|461|21904143358257|461|6|1

10-06 10:34:09.198 W/MiuiPerfServiceClient( 3422): interceptAndQueuing:2521|com.android.systemui|461|461|unknown|null|StatusBar|21904143358257|Slow 
swap buffers|1
10-06 10:34:10.842 I/OpenGLRenderer( 2521): Davey! duration=1640ms; Flags=0, IntendedVsync=21905682908909, 
Vsync=21905682908909, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=21905683588100, 
AnimationStart=21905683628360, PerformTraversalsStart=21905683631641, DrawStart=21905683784923, SyncQueued=21905683817683, 
SyncStart=21905683907891, IssueDrawCommandsStart=21905684211537, SwapBuffers=21905688584141, FrameCompleted=21907323042266, 
DequeueBufferDuration=393000, QueueBufferDuration=1633728000, 
10-06 10:34:10.862 W/Adreno-GSL(11562): <gsl_ldd_control:548>: ioctl fd 55 code 0x400c0907 (IOCTL_KGSL_DEVICE_WAITTIMESTAMP_CTXTID) 
failed: errno 35 Resource deadlock would occur
10-06 10:34:10.862 W/Adreno-GSL(11562): <log_gpu_snapshot:457>: panel.gpuSnapshotPath is not set.not 
generating user snapshot
10-06 10:34:10.862 D/CadAssistant(11562): processIBLMap(SPECULAR, DRAW, 0 512x512) filled in 2.02112 
s
10-06 10:34:10.863 W/Adreno-GSL(11562): <gsl_ldd_control:548>: ioctl fd 55 code 0xc040094a (IOCTL_KGSL_GPU_COMMAND) 
failed: errno 35 Resource deadlock would occur
10-06 10:34:10.863 W/Adreno-GSL(11562): <log_gpu_snapshot:457>: panel.gpuSnapshotPath is not set.not 
generating user snapshot
10-06 10:34:10.863 D/CadAssistant(11562): processIBLMap(SPECULAR, DRAW, 0 512x512) filled in 0.000637 
s
10-06 10:34:10.864 D/CadAssistant(11562): processIBLMap(SPECULAR, DRAW, 0 512x512) filled in 0.000138 
s
10-06 10:34:10.864 D/CadAssistant(11562): processIBLMap(SPECULAR, DRAW, 0 512x512) filled in 1.3e-05 
s
10-06 10:34:10.864 D/CadAssistant(11562): processIBLMap(SPECULAR, DRAW, 0 512x512) filled in 1.1e-05 
s
10-06 10:34:10.864 D/CadAssistant(11562): processIBLMap(SPECULAR, DRAW, 0 512x512) filled in 1.1e-05 
s
10-06 10:34:10.864 D/CadAssistant(11562): processIBLMap(DIFFUSE, DRAW, 0 512x512) filled in 1.1e-05 s

10-06 10:34:10.865 D/CadAssistant(11562): processIBLMap(DIFFUSE, DRAW, 0 512x512) filled in 1.2e-05 s

10-06 10:34:10.865 D/CadAssistant(11562): processIBLMap(DIFFUSE, DRAW, 0 512x512) filled in 1.1e-05 s

10-06 10:34:10.865 D/CadAssistant(11562): processIBLMap(DIFFUSE, DRAW, 0 512x512) filled in 1.1e-05 s

10-06 10:34:10.866 D/CadAssistant(11562): processIBLMap(DIFFUSE, DRAW, 0 512x512) filled in 1.1e-05 s

10-06 10:34:10.866 D/CadAssistant(11562): IBL 512x512 is baked in 7.06202 s


(0087888)
kgv (developer)
2019-10-06 10:55
edited on: 2019-10-06 11:26

Mali-G51 (application works), 1024 samples:
10-06 10:51:27.521 D/CadAssistant(24425): processIBLMap(SPECULAR, DRAW, 5 16x16) filled in 0.020527 s

10-06 10:51:27.536 D/CadAssistant(24425): processIBLMap(SPECULAR, DRAW, 5 16x16) filled in 0.014951 s

10-06 10:51:27.551 D/CadAssistant(24425): processIBLMap(SPECULAR, DRAW, 5 16x16) filled in 0.014991 s

10-06 10:51:27.565 D/CadAssistant(24425): processIBLMap(SPECULAR, DRAW, 5 16x16) filled in 0.012778 s

10-06 10:51:27.578 D/CadAssistant(24425): processIBLMap(SPECULAR, DRAW, 5 16x16) filled in 0.013232 s

10-06 10:51:27.593 D/CadAssistant(24425): processIBLMap(SPECULAR, DRAW, 5 16x16) filled in 0.013895 s

10-06 10:51:27.635 D/CadAssistant(24425): processIBLMap(SPECULAR, DRAW, 4 32x32) filled in 0.041807 s

10-06 10:51:27.678 D/CadAssistant(24425): processIBLMap(SPECULAR, DRAW, 4 32x32) filled in 0.042113 s

10-06 10:51:27.721 D/CadAssistant(24425): processIBLMap(SPECULAR, DRAW, 4 32x32) filled in 0.042033 s

10-06 10:51:27.759 D/CadAssistant(24425): processIBLMap(SPECULAR, DRAW, 4 32x32) filled in 0.037676 s

10-06 10:51:27.802 D/CadAssistant(24425): processIBLMap(SPECULAR, DRAW, 4 32x32) filled in 0.041821 s

10-06 10:51:27.838 D/CadAssistant(24425): processIBLMap(SPECULAR, DRAW, 4 32x32) filled in 0.03608 s

10-06 10:51:27.906 D/CadAssistant(24425): processIBLMap(SPECULAR, DRAW, 3 64x64) filled in 0.0673 s

10-06 10:51:27.974 D/CadAssistant(24425): processIBLMap(SPECULAR, DRAW, 3 64x64) filled in 0.067517 s

10-06 10:51:28.042 D/CadAssistant(24425): processIBLMap(SPECULAR, DRAW, 3 64x64) filled in 0.066943 s

10-06 10:51:28.114 D/CadAssistant(24425): processIBLMap(SPECULAR, DRAW, 3 64x64) filled in 0.064439 s

10-06 10:51:28.175 D/CadAssistant(24425): processIBLMap(SPECULAR, DRAW, 3 64x64) filled in 0.060736 s

10-06 10:51:28.236 D/CadAssistant(24425): processIBLMap(SPECULAR, DRAW, 3 64x64) filled in 0.059916 s

10-06 10:51:28.440 D/CadAssistant(24425): processIBLMap(SPECULAR, DRAW, 2 128x128) filled in 0.202953 
s
10-06 10:51:28.600 D/CadAssistant(24425): processIBLMap(SPECULAR, DRAW, 2 128x128) filled in 0.159407 
s
10-06 10:51:28.743 D/CadAssistant(24425): processIBLMap(SPECULAR, DRAW, 2 128x128) filled in 0.14278 
s
10-06 10:51:29.185 D/CadAssistant(24425): processIBLMap(SPECULAR, DRAW, 2 128x128) filled in 0.154375 
s
10-06 10:51:29.773 D/CadAssistant(24425): processIBLMap(SPECULAR, DRAW, 1 256x256) filled in 0.586699 
s
10-06 10:51:30.367 D/CadAssistant(24425): processIBLMap(SPECULAR, DRAW, 1 256x256) filled in 0.593637 
s
10-06 10:51:30.955 D/CadAssistant(24425): processIBLMap(SPECULAR, DRAW, 1 256x256) filled in 0.587042 
s
10-06 10:51:31.549 D/CadAssistant(24425): processIBLMap(SPECULAR, DRAW, 1 256x256) filled in 0.593025 
s
10-06 10:51:32.129 D/CadAssistant(24425): processIBLMap(SPECULAR, DRAW, 1 256x256) filled in 0.579944 
s
10-06 10:51:32.718 D/CadAssistant(24425): processIBLMap(SPECULAR, DRAW, 1 256x256) filled in 0.588718 
s
10-06 10:51:37.367 D/CadAssistant(24425): processIBLMap(SPECULAR, DRAW, 0 512x512) filled in 2.32203 
s
10-06 10:51:44.333 D/CadAssistant(24425): processIBLMap(SPECULAR, DRAW, 0 512x512) filled in 2.31021 
s
10-06 10:51:46.672 D/CadAssistant(24425): processIBLMap(SPECULAR, DRAW, 0 512x512) filled in 2.33801 
s
10-06 10:51:48.673 D/CadAssistant(24425): processIBLMap(DIFFUSE, DRAW, 0 512x512) filled in 2.00075 s

10-06 10:51:50.691 D/CadAssistant(24425): processIBLMap(DIFFUSE, DRAW, 0 512x512) filled in 2.01699 s

10-06 10:51:52.712 D/CadAssistant(24425): processIBLMap(DIFFUSE, DRAW, 0 512x512) filled in 2.02012 s

10-06 10:51:54.718 D/CadAssistant(24425): processIBLMap(DIFFUSE, DRAW, 0 512x512) filled in 2.00565 s

10-06 10:51:56.733 D/CadAssistant(24425): processIBLMap(DIFFUSE, DRAW, 0 512x512) filled in 2.01491 s

10-06 10:51:58.744 D/CadAssistant(24425): processIBLMap(DIFFUSE, DRAW, 0 512x512) filled in 2.00954 s

10-06 10:51:58.744 D/CadAssistant(24425): IBL 512x512 is baked in 31.244 s


(0087889)
kgv (developer)
2019-10-06 11:25
edited on: 2019-10-06 11:56

For comparison, it looks like three.js uses just 32 samples by default (1024 in OCCT within current patch):
    var PMREMGenerator = function ( sourceTexture, samplesPerLevel, resolution ) {
        this.resolution = ( resolution !== undefined ) ? resolution : 256; // NODE: 256 is currently 
hard coded in the glsl code for performance reasons
this.samplesPerLevel = ( samplesPerLevel !== undefined ) ? samplesPerLevel : 32;


but this is probably done with some hack in math and causes visual artifacts:
> By using the previous convolved maps,
> a lower number of samples are generally sufficient
>(right now 32, which gives okay results
> unless we see the reflection very carefully, or zoom in too much

(0087890)
kgv (developer)
2019-10-06 11:38

Adreno 308 bakes 512 environment with 100 samples within 28 seconds.
(0088246)
git (administrator)
2019-10-17 12:33

Branch CR30700_1 has been updated by iko.

SHA-1: e3b0713609f7ebe01f6de31f28661c9c0b90157a


Detailed log of new commits:

Author: iko
Date: Thu Oct 17 12:30:47 2019 +0300

    # spherical harmonics work in progress
(0088311)
git (administrator)
2019-10-18 15:46

Branch CR30700_1 has been updated by iko.

SHA-1: 68526c8ab4ccbe7fd83201e95a7384411cf62b2f


Detailed log of new commits:

Author: iko
Date: Fri Oct 18 15:44:35 2019 +0300

    # implement spherical harmonics for diffuse IBL map
(0088410)
git (administrator)
2019-10-22 13:13

Branch CR30700_1 has been updated by kgv.

SHA-1: 54c17b3fb4a6c76124bdee3e06bdf52e01d6d705


Detailed log of new commits:

Author: kgv
Date: Tue Oct 22 13:12:24 2019 +0300

    # fix implicit casts in GLSL code bakeDiffuseMap()/bakeDiffuseSH()/bakeSpecularMap()/occDiffIBLMap()

(0088427)
git (administrator)
2019-10-22 16:38

Branch CR30700_1 has been updated by iko.

SHA-1: 967a612df6db54da723f5ef2fa2fd12dbaff172d


Detailed log of new commits:

Author: iko
Date: Tue Oct 22 16:22:37 2019 +0300

    # implement spherical harmonics for diffuse IBL map
    # fix bugs
    # improve documentation
(0088428)
git (administrator)
2019-10-22 16:52

Branch CR30700_2 has been created by iko.

SHA-1: 3d44bfe4c4df1767f115ce5bcb679c5b1e8a1358


Detailed log of new commits:

Author: iko
Date: Thu Jun 20 09:53:20 2019 +0300

    0030700: Visualization, TKOpenGl - support PBR Metallic-Roughness shading model
    
    Metallic-Roughness shading model has been implemented.
    New materials descriptors has been added to standard materal library.
    Light sources intensities are supported now in pbr shading model.
(0088429)
git (administrator)
2019-10-22 17:36

Branch CR30700_2 has been updated forcibly by iko.

SHA-1: a1be38bd2bd2f12da78c578a2ffee14429e26c9c
(0088433)
kgv (developer)
2019-10-22 23:07

+// function : SetRoughness
+// purpose  :
+// =======================================================================
+void Graphic3d_PBRMaterial::SetIOR (Standard_ShortReal theIOR)

Misprint.

+Graphic3d_PBRMaterial& Graphic3d_PBRMaterial::operator= (const Graphic3d_BSDF& theBSDF)
+{
+  SetBSDF (theBSDF);

I'm not sure this is really useful.
Explicit SetBSDF() call would be more straightforward and operator=() can be removed.

+// =======================================================================
+// function : GenerateEnvLUT
+// purpose  :
+// =======================================================================
+void Graphic3d_PBRMaterial::GenerateEnvironmentLUT (const Handle(Image_PixMap) &theLUT,
+                                                    unsigned int theIntegralSamplesNumber)

GenerateEnvLUT
const Handle(Image_PixMap)& theLUT
theNbIntegralSamples

+// =======================================================================
+// function : geometryFactor
+// purpose  :
+// =======================================================================
+Standard_ShortReal Graphic3d_PBRMaterial::lutgenGeometryFactor

comment

+Graphic3d_Vec3 Graphic3d_PBRMaterial::lutgenReflect (const Graphic3d_Vec3 &theVector,
+                                                     const Graphic3d_Vec3 &theAxis)
+{
+  return theAxis * theAxis.Dot(theVector) * 2.f - theVector;
+}
\ No newline at end of file
...
+#endif // _Graphic3d_PBRMaterial_HeaderFile
\ No newline at end of file
...
+#endif // _OpenGl_PBREnvironment_HeaderFile
\ No newline at end of file

Please add empty line at the end of files.

+  static Standard_ShortReal lutgenGeometryFactor (Standard_ShortReal theCosL,
+  static Graphic3d_Vec2 lutgenHammersley (
+  static Standard_ShortReal lutgenImportanceSampleCosTheta
+  static Graphic3d_Vec3 lutgenImportanceSample 
+  static Graphic3d_Vec3 lutgenView (Standard_ShortReal theCosV);
+  static Graphic3d_Vec3 lutgenReflec

'lutGen' prefix.

+  Standard_Integer                  PbrEnvPow2Size;              //!< size of IBL maps side can be 
calculated as 2^PbrEnvPow2Size (> 0)
+  Standard_Integer                  PbrEnvSpecMapNbLevels;       //!< number of levels used in specular 
IBL map (> 1)
+  Standard_Integer                  PbrEnvBakingDiffNbSamples;   //!< number of samples used in Monte-Carlo 
integration during diffuse IBL map's
+                                                                 //!  spherical harmonics coefficients 
generation (> 0)
+  Standard_Integer                  PbrEnvBakingSpecNbSamples;   //!< number of samples used in Monte-Carlo 
integration during specular IBL map's generation (> 0)
+  Standard_ShortReal                PbrEnvBakingProbability;

Default values should be in comment.

+    theCtx->core11fwd->glEnable (GL_SCISSOR_TEST);
+    theCtx->core11fwd->glScissor (0, 0, 1, 1);
+    glClear (GL_COLOR_BUFFER_BIT);
+
+    glClearColor (0.f, 0.f, 0.f, 1.f);
+    theCtx->core11fwd->glScissor (1, 0, 8, 1);
+    glClear (GL_COLOR_BUFFER_BIT);

It might be preferable to call glClear() first without scissor test (so that the driver will be aware, that full content is invalidated), and after that clear one pixel with scissor test.

+        glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
+      }
+      else
+      {
+        glClear(GL_COLOR_BUFFER_BIT);

Here and in other places - please prefer using aCtx->core11fwd instead of direct functions, even if they are supposed to be always available.

+  Standard_EXPORT virtual void Release (OpenGl_Context* theCtx = NULL) Standard_OVERRIDE;

Default parameter value is redundant.

+//! Calculates direct illumination using Cook-Torrance BRDF.
+const char THE_FUNC_PBR_illumination[] =
+  EOL"vec3 illumination (in vec3  theView,"

Please move new self-sustained non-trivial GLSL functions to Shaders resource folder with generation of .pxx.

+  GLint aLocation = theProgram->GetStateLocation (OpenGl_OCCT_NB_SPEC_IBL_LEVELS);
+  if (aLocation != OpenGl_ShaderProgram::INVALID_LOCATION)

Please use OpenGl_ShaderUniformLocation in new code, e.g.
> if (const OpenGl_ShaderUniformLocation aLocation = theProgram->GetStateLocation (OpenGl_OCCT_NB_SPEC_IBL_LEVELS))

+  Standard_EXPORT static Graphic3d_TypeOfShadingModel PBRShadingModelFallback (Graphic3d_TypeOfShadingModel 
theShadingModel,
+                                                                               Standard_Boolean             
theIsPbrAllowed = Standard_False)
+  {

Unexpected Standard_EXPORT.

-  const OpenGl_Aspects* anAspectsBackup = myWorkspace->SetAspects (myCubeMapParams);
+  const OpenGl_Aspects* anAspectsBackup = myWorkspace->SetAspects(myCubeMapParams);
...
-  myWorkspace->SetAspects (anAspectsBackup);
+  myWorkspace->SetAspects(anAspectsBackup);

Unrelated.

+protected: //! @name methods related to PBR
+
+  //! Checks whether PBR is available.
+  Standard_Boolean checkPBRAvailability() const;
+
+  //! Generates IBL maps used in PBR pipeline.
+  //! If background cubemap is not set clears all IBL maps. 
+  void bakePBREnvironment (const Handle(OpenGl_Context)& theCtx);
+
+  //! Fills all IBL maps with white color.
+  //! So that environment lighting is considered to be constant
+  //! and is completely controls by ambient light sources.
+  void clearPBREnvironment (const Handle(OpenGl_Context)& theCtx);
+
+  //! Process requests to generate or to clear PBR environment.
+  void processPBREnvRequest (const Handle(OpenGl_Context)& theCtx);

Protected methods should be Standard_EXPORT'ed.

@@ -782,6 +784,61 @@ void OpenGl_View::redraw (const Graphic3d_Camera::Projection theProjection,
                           OpenGl_FrameBuffer*                theOitAccumFbo)
 {
   Handle(OpenGl_Context) aCtx = myWorkspace->GetGlContext();
+
+  // process PBR environment 
+  if (myShadingModel == Graphic3d_TOSM_PBR
+   || myShadingModel == Graphic3d_TOSM_PBR_FACET)
+  {
+    if (!myPBREnvironment.IsNull()
+     && myPBREnvironment->SizesAreDifferent (myRenderParams.PbrEnvPow2Size,
+                                             myRenderParams.PbrEnvSpecMapNbLevels))

OpenGl_View::Redraw() is currently used as a place for preparing global resources (FBOs, etc.).

@@ -310,6 +316,16 @@ const OpenGl_Aspects* OpenGl_Workspace::ApplyAspects()
     myGlContext->BindTextures (myEnvironmentTexture);
   }
 
+  if ((myView->myShadingModel == Graphic3d_TOSM_PBR
+    || myView->myShadingModel == Graphic3d_TOSM_PBR_FACET)
+   && !myView->myPBREnvironment.IsNull())
+  {
+    myView->myPBREnvironment->Bind (myGlContext);
+    Handle(OpenGl_Texture) anEnvLUT;
+    myGlContext->GetResource ("EnvLUT", anEnvLUT);
+    anEnvLUT->Bind (myGlContext);
+  }

If this happens at every ApplyAspects() call, then it should be optimized to avoid redundant re-biding of "EnvLUT" texture.

+vec3 occDiffIBLMap (in vec3 theNormal, in vec3 theSHCoeffs[9])
+{

This can be badly optimized by GLSL compiler (big theSHCoeffs array can be entirely copied within each call).

+//=============================================================================
+//function : GenPBREnvironment
+//purpose  :
+//=============================================================================
+void V3d_View::GeneratePBREnvironment (Standard_Boolean theToUpdate)

Comment.

+static std::string envlutWriteToFile (Standard_ShortReal theValue)

envLutWriteToFile

+  std::fstream aFile;
+
+  OSD_OpenStream (aFile, aFilePath, std::ios::out);

std::ofstream
std::ios::out | std::ios::binary

+  Handle(Image_PixMap) aPixMap = new Image_PixMap;

new Image_PixMap()

+  theCommands.Add("vgenenvlut",
+                  "vgenenvlut [-size size = 128]",

Description is missing.

+    std::cerr << "Error: 'vgenpbrenv' command does not have any arguments\n";
+    return 1;

std::cout
Shorter message would be enough "Syntax error: not enough arguments\n".

+  theCommands.Add("vgenpbrenv",
+    "forcible generates IBL maps used in PBR pipeline",
+    __FILE__, VGenPBREnvironment, group);
+  theCommands.Add("vclearpbrenv",
+    "forcible clears IBL maps used in PBR pipeline",
+    __FILE__, VClearPBREnvironment, group);

It is better merging commands into single one "vpbrenv" with options '-clear' and '-generate'.
(0088549)
kgv (developer)
2019-10-23 12:06

Please extend test groups de_mesh/gltf_read and de_mesh/obj_read with making screenshots with PBR shading model turned ON.
(0088553)
git (administrator)
2019-10-23 13:04

Branch CR30700_2 has been updated forcibly by iko.

SHA-1: 3df316f48083c3a49cb4c5a62af23e232e95fa8a
(0088562)
git (administrator)
2019-10-24 00:40

Branch CR30700_2 has been updated by kgv.

SHA-1: 72eb73701b66ec8b372ecadae5c835e4e7c1ea91


Detailed log of new commits:

Author: kgv
Date: Thu Oct 24 00:39:43 2019 +0300

    # make screenshots in PBR shading mode within de_mesh/gltf_read and de_mesh/obj_read test groups

(0088563)
git (administrator)
2019-10-24 02:19

Branch CR30700_2 has been updated by kgv.

SHA-1: e019b642b49590ddfd16efeddff724c259643327


Detailed log of new commits:

Author: kgv
Date: Thu Oct 24 02:18:29 2019 +0300

    # add test case displaying spheres grid with different metallic-roughness values

(0088564)
git (administrator)
2019-10-24 02:27

Branch CR30700_2 has been updated forcibly by kgv.

SHA-1: 7bf7b9668157a355386859a4a1ccaeeb0a572d41
(0088577)
git (administrator)
2019-10-24 17:11

Branch CR30700_2 has been updated by iko.

SHA-1: 93e0eeaba9e57503a89b527a001a32af37d6a812


Detailed log of new commits:

Author: iko
Date: Thu Oct 24 17:05:43 2019 +0300

    # fix remarks
(0088581)
git (administrator)
2019-10-24 17:42

Branch CR30700_2 has been updated by iko.

SHA-1: 9433fba10c6c473920920553f333d8617585b55f


Detailed log of new commits:

Author: iko
Date: Thu Oct 24 17:41:03 2019 +0300

    # fix remarks of remarks
(0088583)
kgv (developer)
2019-10-24 20:42
edited on: 2019-10-24 20:43

There are errors in Ray-Tracing v3d/raytrace/textures:
Error: Failed to get 64-bit handle of OpenGL texture #1280


(0088590)
git (administrator)
2019-10-25 11:54

Branch CR30700_2 has been updated by iko.

SHA-1: de220a9b01b54de1f2bba52a6286d0a4e574e880


Detailed log of new commits:

Author: iko
Date: Fri Oct 25 11:52:43 2019 +0300

    # fix bug with sampler parameter
(0088592)
kgv (developer)
2019-10-25 13:12

> src/Textures/Textures_EnvLUT.pxx: 392 KB
Please compress the file a little bit:
- Replace 1 space between R and G with 0 space
- Replace 2 spaces between RG values with 1 space
- Remove 2 spaces at the beginning of each file.
The result would be 358 KB which is a little bit better without sacrificing noticeably the file content.
(0088593)
git (administrator)
2019-10-25 13:31

Branch CR30700_2 has been updated forcibly by iko.

SHA-1: bbb8e3d7773a5e4a07ec95455027b3779cb505ed
(0088599)
git (administrator)
2019-10-25 15:46

Branch CR30700_2 has been updated by iko.

SHA-1: 05ea4e74f5e1bfb5a47e3abb513a445ae5a684dd


Detailed log of new commits:

Author: iko
Date: Fri Oct 25 15:45:13 2019 +0300

    # fix lightsources shader misprints
    # compress env lut
(0088610)
git (administrator)
2019-10-25 16:59

Branch CR30700_3 has been created by kgv.

SHA-1: 154832eb3f2464e0d4d619c6bbbc3b0dcf045e8f


Detailed log of new commits:

Author: iko
Date: Thu Jun 20 09:53:20 2019 +0300

    0030700: Visualization, TKOpenGl - support PBR Metallic-Roughness shading model
    
    Metallic-Roughness shading model Graphic3d_TOSM_PBR has been implemented.
    New materials descriptors Graphic3d_PBRMaterial have been added to Graphic3d_MaterialAspect.
    PBR shading model requires OpenGL 3.0+ or OpenGL ES 3.0+ hardware.
    Environment cubemap is expected to be provided for realistic look of metallic materials.
    
    occLight_IsHeadlight() now returns bool instead of int.
    Avoid using lowp for enumerations to workaround occLight_IsHeadlight()
    ignorance on Adreno 308 caused by some GLSL optimizator bugs.
    
    OpenGl_Texture::EstimatedDataSize() - fixed estimation for Cubemap textures.
    OpenGl_Sampler::applySamplerParams() - fixed uninitialized GL_TEXTURE_WRAP_R in case of GL_TEXTURE_CUBE_MAP target.
(0088613)
git (administrator)
2019-10-25 17:49

Branch CR30700_3 has been updated forcibly by kgv.

SHA-1: 9c40a93657f091346e73f105bdc0f67b9cf71871
(0088614)
kgv (developer)
2019-10-25 17:50

Please raise the patch.

Test case v3d/materials/bug24855 has been removed from patch - will be integrated within another issue.
(0088620)
apn (administrator)
2019-10-27 12:31

Windows-32/64-vc9/vc10/vc11/vc12

Graphic3d_PBRMaterial.cxx:186, MSBuild, Priority: Normal
nonstandard extension used: enum 'Image_Format' used in qualified name

OpenGl_PBREnvironment.cxx:117, MSBuild, Priority: Normal
'OpenGl_PBREnvironmentSentry' : assignment operator could not be generated

OpenGl_View_Redraw.cxx:381, MSBuild, Priority: Normal
nonstandard extension used: enum 'Image_Format' used in qualified name

ViewerTest_OpenGlCommands.cxx:1439, MSBuild, Priority: Normal
nonstandard extension used: enum 'Image_Format' used in qualified name
(0088621)
git (administrator)
2019-10-28 09:13

Branch CR30700_3 has been updated forcibly by kgv.

SHA-1: d574dc93c0fa9b36d301bd1d5fa7a02d1ef0c4f1
(0088622)
kgv (developer)
2019-10-28 09:14

Warning should be fixed now.
(0088647)
git (administrator)
2019-10-29 17:42

Branch CR30700_3 has been updated by iko.

SHA-1: afb54bc98205944536af8cbf97928e8695435b71


Detailed log of new commits:

Author: iko
Date: Tue Oct 29 17:40:28 2019 +0300

    # fix base color texture using in PBR shader
(0088657)
kgv (developer)
2019-10-30 10:50

> # fix base color texture using in PBR shader
This commit produces white screenshots on Jenkins.
(0088658)
kgv (developer)
2019-10-30 11:33

> Please also extend vlistmaterials with PBR metalic-roughness material properties.
This one still not taken into account.
(0088689)
git (administrator)
2019-10-31 13:51

Branch CR30700_3 has been updated forcibly by iko.

SHA-1: 3f3fc4a72052e40d9c57a01207de0547d1a905be
(0088691)
git (administrator)
2019-10-31 15:59

Branch CR30700_3 has been updated by kgv.

SHA-1: e069ae08d66ee9f1e15f060f9a95a3afe7aee9da


Detailed log of new commits:

Author: kgv
Date: Thu Oct 31 15:58:44 2019 +0300

    # add PBR properties to vlistmaterials command

(0088692)
git (administrator)
2019-10-31 16:08

Branch CR30700_4 has been created by kgv.

SHA-1: bbe620165fae6d4031cc9b170fbd4e1c53d18096


Detailed log of new commits:

Author: iko
Date: Thu Jun 20 09:53:20 2019 +0300

    0030700: Visualization, TKOpenGl - support PBR Metallic-Roughness shading model
    
    Metallic-Roughness shading model Graphic3d_TOSM_PBR has been implemented.
    New materials descriptors Graphic3d_PBRMaterial have been added to Graphic3d_MaterialAspect.
    PBR shading model requires OpenGL 3.0+ or OpenGL ES 3.0+ hardware.
    Environment cubemap is expected to be provided for realistic look of metallic materials.
    
    occLight_IsHeadlight() now returns bool instead of int.
    Avoid using lowp for enumerations to workaround occLight_IsHeadlight()
    ignorance on Adreno 308 caused by some GLSL optimizator bugs.
    
    OpenGl_Texture::EstimatedDataSize() - fixed estimation for Cubemap textures.
    OpenGl_Sampler::applySamplerParams() - fixed uninitialized GL_TEXTURE_WRAP_R in case of GL_TEXTURE_CUBE_MAP target.
(0088693)
kgv (developer)
2019-10-31 16:14

Please take CR30700_4 into IR.
(0088694)
git (administrator)
2019-10-31 17:44

Branch CR30700_4 has been updated by kgv.

SHA-1: 762a3e56bc3ba5a9400cd3aefa9011d1ce933bba


Detailed log of new commits:

Author: kgv
Date: Thu Oct 31 17:43:29 2019 +0300

    # XCAFDoc_VisMaterial::FillMaterialAspect() - fix undefined BSDF material

(0088695)
git (administrator)
2019-10-31 18:42

Branch CR30700_4 has been updated forcibly by kgv.

SHA-1: 8314e8f1a7c7aef8b0fd0d3c345f3720afd56878
(0088696)
git (administrator)
2019-10-31 18:45

Branch CR30700_4 has been updated forcibly by kgv.

SHA-1: e781174eaa02692dd00fde2f0e2e2ce8e652054a
(0088699)
git (administrator)
2019-11-01 10:49

Branch CR30700_4 has been updated by kgv.

SHA-1: b77730304a18c99c331e3e8b17d6d94bff21b279


Detailed log of new commits:

Author: kgv
Date: Fri Nov 1 10:48:40 2019 +0300

    # Graphic3d_PBRMaterial::RoughnessFromSpecular() - move Common->PBR math

(0088700)
git (administrator)
2019-11-01 10:54

Branch CR30700_4 has been updated by kgv.

SHA-1: 0270b5383966e16c80d01a1d5a92e64d3f9243f6


Detailed log of new commits:

Author: kgv
Date: Fri Nov 1 10:52:51 2019 +0300

    # fix CLang warning

(0088841)
git (administrator)
2019-11-10 11:41

Branch CR30700_4 has been deleted by inv.

SHA-1: 0270b5383966e16c80d01a1d5a92e64d3f9243f6
(0088842)
git (administrator)
2019-11-10 11:41

Branch CR30700_3 has been deleted by inv.

SHA-1: e069ae08d66ee9f1e15f060f9a95a3afe7aee9da
(0088852)
git (administrator)
2019-11-10 11:41

Branch CR30700_2 has been deleted by inv.

SHA-1: 05ea4e74f5e1bfb5a47e3abb513a445ae5a684dd
(0088859)
git (administrator)
2019-11-10 11:42

Branch CR30700_1 has been deleted by inv.

SHA-1: 967a612df6db54da723f5ef2fa2fd12dbaff172d
(0088873)
git (administrator)
2019-11-10 11:42

Branch CR30700 has been deleted by inv.

SHA-1: 86af5d697ec5f5a912901337d3b83463e7338ef5
(0088874)
git (administrator)
2019-11-10 11:42

Branch CR30700_squashed has been deleted by inv.

SHA-1: 8fe62c4b587064c8516bd715d7a6474707211b67

- Related Changesets
occt: master 67312b79
Timestamp: 2019-06-20 06:53:20
Author: iko
Committer: apn
Details ] Diff ]
0030700: Visualization, TKOpenGl - support PBR Metallic-Roughness shading model

Metallic-Roughness shading model Graphic3d_TOSM_PBR has been implemented.
New materials descriptors Graphic3d_PBRMaterial have been added to Graphic3d_MaterialAspect.
PBR shading model requires OpenGL 3.0+ or OpenGL ES 3.0+ hardware.
Environment cubemap is expected to be provided for realistic look of metallic materials.

occLight_IsHeadlight() now returns bool instead of int.
Avoid using lowp for enumerations to workaround occLight_IsHeadlight()
ignorance on Adreno 308 caused by some GLSL optimizator bugs.

OpenGl_Texture::EstimatedDataSize() - fixed estimation for Cubemap textures.
OpenGl_Sampler::applySamplerParams() - fixed uninitialized GL_TEXTURE_WRAP_R in case of GL_TEXTURE_CUBE_MAP target.
mod - src/Graphic3d/FILES Diff ] File ]
mod - src/Graphic3d/Graphic3d_BSDF.cxx Diff ] File ]
mod - src/Graphic3d/Graphic3d_BSDF.hxx Diff ] File ]
mod - src/Graphic3d/Graphic3d_CubeMap.hxx Diff ] File ]
mod - src/Graphic3d/Graphic3d_CView.hxx Diff ] File ]
mod - src/Graphic3d/Graphic3d_MaterialAspect.cxx Diff ] File ]
mod - src/Graphic3d/Graphic3d_MaterialAspect.hxx Diff ] File ]
add - src/Graphic3d/Graphic3d_PBRMaterial.cxx Diff ] File ]
add - src/Graphic3d/Graphic3d_PBRMaterial.hxx Diff ] File ]
mod - src/Graphic3d/Graphic3d_RenderingParams.hxx Diff ] File ]
mod - src/Graphic3d/Graphic3d_ShaderProgram.cxx Diff ] File ]
mod - src/Graphic3d/Graphic3d_ShaderProgram.hxx Diff ] File ]
mod - src/Graphic3d/Graphic3d_TextureParams.cxx Diff ] File ]
mod - src/Graphic3d/Graphic3d_TextureParams.hxx Diff ] File ]
mod - src/Graphic3d/Graphic3d_TypeOfLimit.hxx Diff ] File ]
mod - src/Graphic3d/Graphic3d_TypeOfShadingModel.hxx Diff ] File ]
mod - src/Image/Image_Color.hxx Diff ] File ]
mod - src/Image/Image_Format.hxx Diff ] File ]
mod - src/Image/Image_PixMap.cxx Diff ] File ]
mod - src/Media/Media_Frame.cxx Diff ] File ]
mod - src/OpenGl/FILES Diff ] File ]
mod - src/OpenGl/OpenGl_Context.cxx Diff ] File ]
mod - src/OpenGl/OpenGl_Context.hxx Diff ] File ]
mod - src/OpenGl/OpenGl_FrameBuffer.cxx Diff ] File ]
mod - src/OpenGl/OpenGl_GlFunctions.hxx Diff ] File ]
mod - src/OpenGl/OpenGl_GraphicDriver.cxx Diff ] File ]
mod - src/OpenGl/OpenGl_LayerList.cxx Diff ] File ]
mod - src/OpenGl/OpenGl_Material.hxx Diff ] File ]
add - src/OpenGl/OpenGl_PBREnvironment.cxx Diff ] File ]
add - src/OpenGl/OpenGl_PBREnvironment.hxx Diff ] File ]
mod - src/OpenGl/OpenGl_Sampler.cxx Diff ] File ]
mod - src/OpenGl/OpenGl_ShaderManager.cxx Diff ] File ]
mod - src/OpenGl/OpenGl_ShaderManager.hxx Diff ] File ]
mod - src/OpenGl/OpenGl_ShaderProgram.cxx Diff ] File ]
mod - src/OpenGl/OpenGl_ShaderProgram.hxx Diff ] File ]
mod - src/OpenGl/OpenGl_ShaderStates.hxx Diff ] File ]
mod - src/OpenGl/OpenGl_Texture.cxx Diff ] File ]
mod - src/OpenGl/OpenGl_Texture.hxx Diff ] File ]
mod - src/OpenGl/OpenGl_TextureFormat.cxx Diff ] File ]
mod - src/OpenGl/OpenGl_View.cxx Diff ] File ]
mod - src/OpenGl/OpenGl_View.hxx Diff ] File ]
mod - src/OpenGl/OpenGl_View_Redraw.cxx Diff ] File ]
mod - src/OpenGl/OpenGl_Workspace.cxx Diff ] File ]
mod - src/Shaders/Declarations.glsl Diff ] File ]
mod - src/Shaders/DeclarationsImpl.glsl Diff ] File ]
mod - src/Shaders/FILES Diff ] File ]
add - src/Shaders/PBRCookTorrance.glsl Diff ] File ]
add - src/Shaders/PBRDistribution.glsl Diff ] File ]
add - src/Shaders/PBREnvBaking.fs Diff ] File ]
add - src/Shaders/PBREnvBaking.vs Diff ] File ]
add - src/Shaders/PBRFresnel.glsl Diff ] File ]
add - src/Shaders/PBRGeometry.glsl Diff ] File ]
add - src/Shaders/PBRIllumination.glsl Diff ] File ]
mod - src/Shaders/PhongShading.fs Diff ] File ]
mod - src/Shaders/Shaders_DeclarationsImpl_glsl.pxx Diff ] File ]
mod - src/Shaders/Shaders_Declarations_glsl.pxx Diff ] File ]
add - src/Shaders/Shaders_PBRCookTorrance_glsl.pxx Diff ] File ]
add - src/Shaders/Shaders_PBRDistribution_glsl.pxx Diff ] File ]
add - src/Shaders/Shaders_PBREnvBaking_fs.pxx Diff ] File ]
add - src/Shaders/Shaders_PBREnvBaking_vs.pxx Diff ] File ]
add - src/Shaders/Shaders_PBRFresnel_glsl.pxx Diff ] File ]
add - src/Shaders/Shaders_PBRGeometry_glsl.pxx Diff ] File ]
add - src/Shaders/Shaders_PBRIllumination_glsl.pxx Diff ] File ]
mod - src/Textures/FILES Diff ] File ]
add - src/Textures/Textures_EnvLUT.pxx Diff ] File ]
mod - src/V3d/V3d_View.cxx Diff ] File ]
mod - src/V3d/V3d_View.hxx Diff ] File ]
mod - src/ViewerTest/ViewerTest.cxx Diff ] File ]
mod - src/ViewerTest/ViewerTest_OpenGlCommands.cxx Diff ] File ]
mod - src/ViewerTest/ViewerTest_ViewerCommands.cxx Diff ] File ]
mod - src/XCAFDoc/XCAFDoc_VisMaterial.cxx Diff ] File ]
mod - tests/de_mesh/gltf_read/end Diff ] File ]
mod - tests/de_mesh/obj_read/end Diff ] File ]
add - tests/v3d/glsl/pbr_spheres Diff ] File ]
add - tests/v3d/materials/pbr1 Diff ] File ]

- Issue History
Date Modified Username Field Change
2019-05-07 14:21 kgv New Issue
2019-05-07 14:21 kgv Assigned To => kgv
2019-05-07 14:21 kgv Assigned To kgv => iko
2019-05-07 14:21 kgv Status new => assigned
2019-05-07 14:22 kgv Relationship added related to 0029902
2019-05-07 14:23 kgv Relationship added related to 0030691
2019-05-07 14:24 kgv Relationship added related to 0029528
2019-05-07 14:26 kgv Relationship added related to 0029516
2019-05-07 14:27 kgv Relationship added related to 0030126
2019-05-07 14:27 kgv Relationship added related to 0030631
2019-05-07 14:27 kgv Relationship added related to 0029298
2019-05-15 15:36 kgv Note Added: 0084371
2019-06-20 09:58 git Note Added: 0085159
2019-06-20 10:58 git Note Added: 0085164
2019-06-20 15:18 git Note Added: 0085181
2019-06-21 16:33 git Note Added: 0085201
2019-06-25 14:08 kgv Relationship added related to 0030807
2019-07-15 14:06 git Note Added: 0085632
2019-08-13 12:04 kgv Target Version 7.4.0 => 7.5.0*
2019-08-30 09:03 iko File Added: new_materials_work_in_progress.png
2019-09-02 16:55 iko File Added: new_materials_work_in_progress_2.png
2019-09-12 16:37 kgv Relationship added related to 0030963
2019-09-13 12:29 git Note Added: 0087047
2019-09-13 12:54 git Note Added: 0087049
2019-09-16 12:06 git Note Added: 0087119
2019-09-16 17:27 git Note Added: 0087160
2019-09-18 12:49 git Note Added: 0087246
2019-09-19 17:05 git Note Added: 0087316
2019-09-20 12:48 git Note Added: 0087355
2019-09-20 13:06 git Note Added: 0087356
2019-09-20 13:40 git Note Added: 0087362
2019-09-20 14:20 git Note Added: 0087365
2019-09-23 18:16 git Note Added: 0087455
2019-09-23 21:27 git Note Added: 0087457
2019-09-24 11:02 git Note Added: 0087461
2019-09-24 11:53 kgv Note Added: 0087465
2019-09-24 13:27 kgv Note Added: 0087472
2019-09-24 14:34 kgv Note Added: 0087479
2019-09-24 14:38 git Note Added: 0087480
2019-09-24 14:44 git Note Added: 0087481
2019-09-24 15:04 git Note Added: 0087483
2019-09-24 15:43 kgv Note Added: 0087485
2019-09-25 08:09 kgv Note Added: 0087500
2019-09-25 10:39 kgv Note Added: 0087504
2019-09-25 14:19 git Note Added: 0087510
2019-09-27 12:04 git Note Added: 0087566
2019-09-27 12:26 iko File Added: new_materials_work_in_progress_3.png
2019-09-27 12:55 git Note Added: 0087569
2019-09-27 14:07 git Note Added: 0087571
2019-09-27 17:15 kgv Note Added: 0087579
2019-09-27 18:36 kgv Note Added: 0087581
2019-09-27 18:38 kgv Note Added: 0087582
2019-09-27 21:09 git Note Added: 0087583
2019-09-27 21:18 kgv Note Added: 0087584
2019-09-27 21:51 git Note Added: 0087585
2019-09-27 22:15 git Note Added: 0087586
2019-09-27 22:50 git Note Added: 0087587
2019-09-27 23:12 git Note Added: 0087588
2019-09-28 22:05 git Note Added: 0087595
2019-09-28 22:36 git Note Added: 0087596
2019-09-28 23:35 git Note Added: 0087597
2019-10-01 15:34 git Note Added: 0087662
2019-10-01 17:52 git Note Added: 0087669
2019-10-01 18:06 git Note Added: 0087670
2019-10-02 09:28 git Note Added: 0087681
2019-10-02 09:51 git Note Added: 0087682
2019-10-02 10:54 git Note Added: 0087686
2019-10-02 16:58 git Note Added: 0087695
2019-10-02 17:45 git Note Added: 0087700
2019-10-02 22:26 git Note Added: 0087726
2019-10-03 15:32 git Note Added: 0087769
2019-10-03 20:29 git Note Added: 0087794
2019-10-03 21:19 git Note Added: 0087795
2019-10-03 21:39 git Note Added: 0087796
2019-10-04 00:26 git Note Added: 0087797
2019-10-04 13:23 git Note Added: 0087810
2019-10-06 10:41 kgv Note Added: 0087887
2019-10-06 10:55 kgv Note Added: 0087888
2019-10-06 11:25 kgv Note Added: 0087889
2019-10-06 11:26 kgv Note Edited: 0087888 View Revisions
2019-10-06 11:26 kgv Note Edited: 0087887 View Revisions
2019-10-06 11:29 kgv Note Edited: 0087889 View Revisions
2019-10-06 11:38 kgv Note Added: 0087890
2019-10-06 11:56 kgv Note Edited: 0087889 View Revisions
2019-10-17 12:33 git Note Added: 0088246
2019-10-18 15:46 git Note Added: 0088311
2019-10-22 13:13 git Note Added: 0088410
2019-10-22 16:38 git Note Added: 0088427
2019-10-22 16:52 git Note Added: 0088428
2019-10-22 17:36 git Note Added: 0088429
2019-10-22 23:07 kgv Note Added: 0088433
2019-10-23 12:06 kgv Note Added: 0088549
2019-10-23 12:24 kgv Relationship added parent of 0031096
2019-10-23 12:25 kgv Relationship added parent of 0031097
2019-10-23 12:27 kgv Relationship added parent of 0031098
2019-10-23 12:30 kgv Relationship added parent of 0031099
2019-10-23 12:48 kgv Relationship added parent of 0031100
2019-10-23 13:04 git Note Added: 0088553
2019-10-24 00:40 git Note Added: 0088562
2019-10-24 02:19 git Note Added: 0088563
2019-10-24 02:22 kgv File Added: pbr_spheres_persp0.png
2019-10-24 02:27 git Note Added: 0088564
2019-10-24 17:11 git Note Added: 0088577
2019-10-24 17:42 git Note Added: 0088581
2019-10-24 20:42 kgv Note Added: 0088583
2019-10-24 20:43 kgv Note Edited: 0088583 View Revisions
2019-10-25 11:54 git Note Added: 0088590
2019-10-25 12:28 kgv Relationship added parent of 0031105
2019-10-25 13:12 kgv Note Added: 0088592
2019-10-25 13:31 git Note Added: 0088593
2019-10-25 15:46 git Note Added: 0088599
2019-10-25 16:59 git Note Added: 0088610
2019-10-25 17:49 git Note Added: 0088613
2019-10-25 17:50 kgv Note Added: 0088614
2019-10-25 17:50 kgv Assigned To iko => bugmaster
2019-10-25 17:50 kgv Status assigned => resolved
2019-10-25 17:50 kgv Status resolved => reviewed
2019-10-27 12:31 apn Note Added: 0088620
2019-10-28 09:13 git Note Added: 0088621
2019-10-28 09:14 kgv Note Added: 0088622
2019-10-29 17:42 git Note Added: 0088647
2019-10-30 10:50 kgv Note Added: 0088657
2019-10-30 11:33 kgv Note Added: 0088658
2019-10-31 13:51 git Note Added: 0088689
2019-10-31 15:59 git Note Added: 0088691
2019-10-31 16:08 git Note Added: 0088692
2019-10-31 16:14 kgv Note Added: 0088693
2019-10-31 17:44 git Note Added: 0088694
2019-10-31 18:42 git Note Added: 0088695
2019-10-31 18:45 git Note Added: 0088696
2019-11-01 10:49 git Note Added: 0088699
2019-11-01 10:54 git Note Added: 0088700
2019-11-02 17:43 apn Changeset attached => occt master 67312b79
2019-11-02 17:43 apn Assigned To bugmaster => apn
2019-11-02 17:43 apn Status reviewed => verified
2019-11-02 17:43 apn Resolution open => fixed
2019-11-05 10:49 kgv Relationship added parent of 0031129
2019-11-06 14:19 kgv File Added: MetalRoughSpheres_NoTextures.glb
2019-11-10 11:41 git Note Added: 0088841
2019-11-10 11:41 git Note Added: 0088842
2019-11-10 11:41 git Note Added: 0088852
2019-11-10 11:42 git Note Added: 0088859
2019-11-10 11:42 git Note Added: 0088873
2019-11-10 11:42 git Note Added: 0088874
2019-11-21 12:10 kgv File Added: pbr_spheres2.png


Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker