View Issue Details

IDProjectCategoryView StatusLast Update
0030700Open CASCADEOCCT:Visualizationpublic2022-07-22 10:59
Reporterkgv Assigned Toapn  
PrioritynormalSeverityfeature 
Status closedResolutionfixed 
Target Version7.5.0Fixed in Version7.5.0 
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 Files

  • new_materials_work_in_progress.png (167,250 bytes)
  • new_materials_work_in_progress_2.png (197,097 bytes)
  • new_materials_work_in_progress_3.png (170,120 bytes)
  • pbr_spheres_persp0.png (199,049 bytes)
  • MetalRoughSpheres_NoTextures.glb (88,332 bytes)
  • pbr_spheres2.png (411,499 bytes)

Relationships

related to 0029902 closedapn Open CASCADE Data Exchange, XCAF - provide extended Material definition for visualization purposes 
related to 0030691 closedbugmaster Open CASCADE Data Exchange - implement import of mesh data from files in glTF format 
related to 0029528 closedapn Open CASCADE Visualization, TKOpenGl - allow defining sRGB textures 
related to 0029516 closedbugmaster Open CASCADE Visualization - eliminate redundant property Graphic3d_MaterialAspect::ReflectionMode() 
related to 0030126 assignedngavrilo Open CASCADE Visualization, Graphic3d_ShaderManager - define standard Lighting & Clipping within custom GLSL programs as template functions 
related to 0030631 newvpozdyayev Open CASCADE Visualization - Vulkan graphic driver prototype 
parent of 0031096 closedbugmaster Open CASCADE Visualization, TKOpenGl - support metallic-roughness texture mapping 
parent of 0031097 closedbugmaster Open CASCADE Visualization, TKOpenGl - support Occlusion texture mapping 
parent of 0031098 closedbugmaster Open CASCADE Visualization, TKOpenGl - support Normal texture map 
parent of 0031099 closedbugmaster Open CASCADE Visualization, TKOpenGl - support Point light source with artistic full cut-off distance 
parent of 0031100 newvpozdyayev Open CASCADE Data Exchange, RWGltf_CafReader - support reading information from EXT_lights_image_based 
parent of 0031105 newiko Open CASCADE Visualization, TKOpenGl - provide built-in environment maps 
parent of 0031129 newvpozdyayev Open CASCADE Visualization - revise background / environment API 
parent of 0031293 closedbugmaster Open CASCADE Visualization, TKOpenGl - broken capping when PBR shading is ON 
parent of 0031370 closedbugmaster Open CASCADE Documentation - provide information about PBR implementation 
parent of 0031372 closedkgv Open CASCADE Visualization, TKOpenGl - failed to create texture on OpenGL ES 2.0 due to unknown GL_TEXTURE_BASE_LEVEL 
parent of 0031580 closedbugmaster Open CASCADE Visualization, TKOpenGl - cubemap initialization error on OpenGL ES 2.0 
parent of 0031584 newvpozdyayev Open CASCADE Visualization, TKOpenGl - support cubemap Ambient lighting within Graphic3d_TOSM_FRAGMENT shading 
parent of 0031607 newvpozdyayev Open CASCADE Visualization, Graphic3d_Aspects - store Front/Back shading materials via Handles 
parent of 0031996 closedbugmaster Open CASCADE Visualization - PhongShading.fs compilation error on OpenGL drivers for AMD Radeon 
parent of 0032083 closedbugmaster Open CASCADE Visualization, TKOpenGl - PBR rendering is unavailable on Apple A12 Bionic (iPad) 
parent of 0033074 closedvpozdyayev Open CASCADE Visualization, TKOpenGl - PBR shader compilation error on Mesa OpenGL 3.1 
related to 0030807 closedapn Open CASCADE Visualization, TKOpenGl - supporting cubemaps 
related to 0030963 closedbugmaster Open CASCADE Visualization, TKOpenGl - texture unit error during FFP global texture's parameters processing 
related to 0031196 closedbugmaster Community Visualization, TKOpenGl - enable Ray-Tracing using OpenGL ES 3.2 
Not all the children of this issue are yet resolved or closed.

Activities

kgv

2019-05-15 15:36

developer   ~0084371

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

git

2019-06-20 09:58

administrator   ~0085159

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.

git

2019-06-20 10:58

administrator   ~0085164

Branch CR30700 has been updated forcibly by iko.

SHA-1: b8818a8be3628d41a2c45fc1866402ec1f41c8cb

git

2019-06-20 15:18

administrator   ~0085181

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

git

2019-06-21 16:33

administrator   ~0085201

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

git

2019-07-15 14:06

administrator   ~0085632

Branch CR30700 has been updated forcibly by iko.

SHA-1: 2181966edb04f0b7d5bd53f19fcbdac4b0fd99b1

iko

2019-08-30 09:03

developer  

new_materials_work_in_progress.png (167,250 bytes)

iko

2019-09-02 16:55

developer  

new_materials_work_in_progress_2.png (197,097 bytes)

git

2019-09-13 12:29

administrator   ~0087047

Branch CR30700 has been updated forcibly by iko.

SHA-1: 52689bef0717737e80177644eff6c31525ef9d10

git

2019-09-13 12:54

administrator   ~0087049

Branch CR30700 has been updated forcibly by iko.

SHA-1: 48b87406f4c551d6eabb7b4512ccdb2afd2aaa8c

git

2019-09-16 12:06

administrator   ~0087119

Branch CR30700 has been updated forcibly by iko.

SHA-1: af255a64b454efd98fa630490161e5257b0a7e04

git

2019-09-16 17:27

administrator   ~0087160

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

git

2019-09-18 12:49

administrator   ~0087246

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

git

2019-09-19 17:05

administrator   ~0087316

Branch CR30700 has been updated forcibly by iko.

SHA-1: 1a6697ad0ab4caddcb63de44558d393883e49fc0

git

2019-09-20 12:48

administrator   ~0087355

Branch CR30700 has been updated forcibly by iko.

SHA-1: 33f2cee09d3e269c883f4cb309db5fcb3520aece

git

2019-09-20 13:06

administrator   ~0087356

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

git

2019-09-20 13:40

administrator   ~0087362

Branch CR30700 has been updated forcibly by iko.

SHA-1: 8d86509b2b512a62752e5d3a43e173e975417f41

git

2019-09-20 14:20

administrator   ~0087365

Branch CR30700 has been updated forcibly by iko.

SHA-1: 5224804adb8d8864482963ef5c694c9764c81a60

git

2019-09-23 18:16

administrator   ~0087455

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

git

2019-09-23 21:27

administrator   ~0087457

Branch CR30700 has been updated forcibly by iko.

SHA-1: e135eb121b86a0b6384d73f2f90f11d3117556fc

git

2019-09-24 11:02

administrator   ~0087461

Branch CR30700 has been updated forcibly by iko.

SHA-1: e61faa6bdd5cf42fafa4aa2fa52b32930d23f3ba

kgv

2019-09-24 11:53

developer   ~0087465

+  //! 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.

kgv

2019-09-24 13:27

developer   ~0087472

+  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))

kgv

2019-09-24 14:34

developer   ~0087479

 #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).

git

2019-09-24 14:38

administrator   ~0087480

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

git

2019-09-24 14:44

administrator   ~0087481

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

git

2019-09-24 15:04

administrator   ~0087483

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'

kgv

2019-09-24 15:43

developer   ~0087485

+//! 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

kgv

2019-09-25 08:09

developer   ~0087500

+  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.

kgv

2019-09-25 10:39

developer   ~0087504

+  //! 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.

git

2019-09-25 14:19

administrator   ~0087510

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.

git

2019-09-27 12:04

administrator   ~0087566

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

iko

2019-09-27 12:26

developer  

new_materials_work_in_progress_3.png (170,120 bytes)

git

2019-09-27 12:55

administrator   ~0087569

Branch CR30700_1 has been updated forcibly by iko.

SHA-1: 4df9f23ac1fae5d9a7f2e22b6cfb87f4426df326

git

2019-09-27 14:07

administrator   ~0087571

Branch CR30700_1 has been updated forcibly by iko.

SHA-1: 4694e33d209e5e5b1771545a6406644d3026e617

kgv

2019-09-27 17:15

developer   ~0087579

+      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.

kgv

2019-09-27 18:36

developer   ~0087581

Please also extend vlistmaterials with PBR metalic-roughness material properties.

kgv

2019-09-27 18:38

developer   ~0087582

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());

git

2019-09-27 21:09

administrator   ~0087583

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

kgv

2019-09-27 21:18

developer   ~0087584

+  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))

git

2019-09-27 21:51

administrator   ~0087585

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

git

2019-09-27 22:15

administrator   ~0087586

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

git

2019-09-27 22:50

administrator   ~0087587

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

git

2019-09-27 23:12

administrator   ~0087588

Branch CR30700_1 has been updated forcibly by kgv.

SHA-1: 66b0d93ebb19e2aa328decff89915e1fcf3ee3bc

git

2019-09-28 22:05

administrator   ~0087595

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

git

2019-09-28 22:36

administrator   ~0087596

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

git

2019-09-28 23:35

administrator   ~0087597

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

git

2019-10-01 15:34

administrator   ~0087662

Branch CR30700_1 has been updated forcibly by kgv.

SHA-1: cb0803c3f01417175b0901b88fd19ab8af895fe3

git

2019-10-01 17:52

administrator   ~0087669

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

git

2019-10-01 18:06

administrator   ~0087670

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

git

2019-10-02 09:28

administrator   ~0087681

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

git

2019-10-02 09:51

administrator   ~0087682

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

git

2019-10-02 10:54

administrator   ~0087686

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

git

2019-10-02 16:58

administrator   ~0087695

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

git

2019-10-02 17:45

administrator   ~0087700

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

git

2019-10-02 22:26

administrator   ~0087726

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.

git

2019-10-03 15:32

administrator   ~0087769

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

git

2019-10-03 20:29

administrator   ~0087794

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

git

2019-10-03 21:19

administrator   ~0087795

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

git

2019-10-03 21:39

administrator   ~0087796

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

git

2019-10-04 00:26

administrator   ~0087797

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.

git

2019-10-04 13:23

administrator   ~0087810

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

kgv

2019-10-06 10:41

developer   ~0087887

Last edited: 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


kgv

2019-10-06 10:55

developer   ~0087888

Last edited: 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


kgv

2019-10-06 11:25

developer   ~0087889

Last edited: 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

kgv

2019-10-06 11:38

developer   ~0087890

Adreno 308 bakes 512 environment with 100 samples within 28 seconds.

git

2019-10-17 12:33

administrator   ~0088246

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

git

2019-10-18 15:46

administrator   ~0088311

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

git

2019-10-22 13:13

administrator   ~0088410

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()

git

2019-10-22 16:38

administrator   ~0088427

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

git

2019-10-22 16:52

administrator   ~0088428

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.

git

2019-10-22 17:36

administrator   ~0088429

Branch CR30700_2 has been updated forcibly by iko.

SHA-1: a1be38bd2bd2f12da78c578a2ffee14429e26c9c

kgv

2019-10-22 23:07

developer   ~0088433

+// 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'.

kgv

2019-10-23 12:06

developer   ~0088549

Please extend test groups de_mesh/gltf_read and de_mesh/obj_read with making screenshots with PBR shading model turned ON.

git

2019-10-23 13:04

administrator   ~0088553

Branch CR30700_2 has been updated forcibly by iko.

SHA-1: 3df316f48083c3a49cb4c5a62af23e232e95fa8a

git

2019-10-24 00:40

administrator   ~0088562

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

git

2019-10-24 02:19

administrator   ~0088563

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

kgv

2019-10-24 02:22

developer  

pbr_spheres_persp0.png (199,049 bytes)

git

2019-10-24 02:27

administrator   ~0088564

Branch CR30700_2 has been updated forcibly by kgv.

SHA-1: 7bf7b9668157a355386859a4a1ccaeeb0a572d41

git

2019-10-24 17:11

administrator   ~0088577

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

git

2019-10-24 17:42

administrator   ~0088581

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

kgv

2019-10-24 20:42

developer   ~0088583

Last edited: 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


git

2019-10-25 11:54

administrator   ~0088590

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

kgv

2019-10-25 13:12

developer   ~0088592

> 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.

git

2019-10-25 13:31

administrator   ~0088593

Branch CR30700_2 has been updated forcibly by iko.

SHA-1: bbb8e3d7773a5e4a07ec95455027b3779cb505ed

git

2019-10-25 15:46

administrator   ~0088599

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

git

2019-10-25 16:59

administrator   ~0088610

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.

git

2019-10-25 17:49

administrator   ~0088613

Branch CR30700_3 has been updated forcibly by kgv.

SHA-1: 9c40a93657f091346e73f105bdc0f67b9cf71871

kgv

2019-10-25 17:50

developer   ~0088614

Please raise the patch.

Test case v3d/materials/bug24855 has been removed from patch - will be integrated within another issue.

apn

2019-10-27 12:31

administrator   ~0088620

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

git

2019-10-28 09:13

administrator   ~0088621

Branch CR30700_3 has been updated forcibly by kgv.

SHA-1: d574dc93c0fa9b36d301bd1d5fa7a02d1ef0c4f1

kgv

2019-10-28 09:14

developer   ~0088622

Warning should be fixed now.

git

2019-10-29 17:42

administrator   ~0088647

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

kgv

2019-10-30 10:50

developer   ~0088657

> # fix base color texture using in PBR shader
This commit produces white screenshots on Jenkins.

kgv

2019-10-30 11:33

developer   ~0088658

> Please also extend vlistmaterials with PBR metalic-roughness material properties.
This one still not taken into account.

git

2019-10-31 13:51

administrator   ~0088689

Branch CR30700_3 has been updated forcibly by iko.

SHA-1: 3f3fc4a72052e40d9c57a01207de0547d1a905be

git

2019-10-31 15:59

administrator   ~0088691

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

git

2019-10-31 16:08

administrator   ~0088692

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.

kgv

2019-10-31 16:14

developer   ~0088693

Please take CR30700_4 into IR.

git

2019-10-31 17:44

administrator   ~0088694

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

git

2019-10-31 18:42

administrator   ~0088695

Branch CR30700_4 has been updated forcibly by kgv.

SHA-1: 8314e8f1a7c7aef8b0fd0d3c345f3720afd56878

git

2019-10-31 18:45

administrator   ~0088696

Branch CR30700_4 has been updated forcibly by kgv.

SHA-1: e781174eaa02692dd00fde2f0e2e2ce8e652054a

git

2019-11-01 10:49

administrator   ~0088699

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

git

2019-11-01 10:54

administrator   ~0088700

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

kgv

2019-11-06 14:19

developer  

MetalRoughSpheres_NoTextures.glb (88,332 bytes)

git

2019-11-10 11:41

administrator   ~0088841

Branch CR30700_4 has been deleted by inv.

SHA-1: 0270b5383966e16c80d01a1d5a92e64d3f9243f6

git

2019-11-10 11:41

administrator   ~0088842

Branch CR30700_3 has been deleted by inv.

SHA-1: e069ae08d66ee9f1e15f060f9a95a3afe7aee9da

git

2019-11-10 11:41

administrator   ~0088852

Branch CR30700_2 has been deleted by inv.

SHA-1: 05ea4e74f5e1bfb5a47e3abb513a445ae5a684dd

git

2019-11-10 11:42

administrator   ~0088859

Branch CR30700_1 has been deleted by inv.

SHA-1: 967a612df6db54da723f5ef2fa2fd12dbaff172d

git

2019-11-10 11:42

administrator   ~0088873

Branch CR30700 has been deleted by inv.

SHA-1: 86af5d697ec5f5a912901337d3b83463e7338ef5

git

2019-11-10 11:42

administrator   ~0088874

Branch CR30700_squashed has been deleted by inv.

SHA-1: 8fe62c4b587064c8516bd715d7a6474707211b67

kgv

2019-11-21 12:10

developer  

pbr_spheres2.png (411,499 bytes)

Related Changesets

occt: master 67312b79

2019-06-20 06:53:20

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.
Affected Issues
0030700
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-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
2019-10-06 11:26 kgv Note Edited: 0087887
2019-10-06 11:29 kgv Note Edited: 0087889
2019-10-06 11:38 kgv Note Added: 0087890
2019-10-06 11:56 kgv Note Edited: 0087889
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
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
2019-11-28 10:40 kgv Relationship added related to 0031196
2020-01-12 15:22 kgv Relationship added parent of 0031293
2020-02-12 17:14 kgv Relationship added parent of 0031370
2020-02-14 19:34 kgv Relationship added parent of 0031372
2020-05-27 13:36 kgv Relationship added parent of 0031580
2020-05-27 23:25 kgv Relationship added parent of 0031584
2020-06-11 09:53 kgv Relationship added parent of 0031607
2020-12-02 16:40 emo Fixed in Version => 7.5.0
2020-12-02 17:11 emo Status verified => closed
2020-12-14 22:09 kgv Relationship added parent of 0031996
2021-01-25 00:42 kgv Relationship added parent of 0032083
2022-07-22 10:59 kgv Relationship added parent of 0033074