青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

eryar

PipeCAD - Plant Piping Design Software.
PlantAssistant - Translate AVEVA RVM/SP3D VUE to glTF, STEP, etc.
posts - 606, comments - 590, trackbacks - 0, articles - 0

PBR in OCCT 3D Viewer

Posted on 2020-07-19 08:53 eryar 閱讀(1897) 評(píng)論(0)  編輯 收藏 引用 所屬分類: 2.OpenCASCADE

Forthcoming OCCT 7.5.0 release extends its real-time rendering engine with a PBR (physically-based rendering) mode. OCCT implements PBR metal-roughness material workflow described by core glTF 2.0 specifications and also includes glTF data exchange components. New functionality opens a door to a new level of realism and visual quality of displayed models, and improves interoperability across various 3D engines supporting the same material workflow.

Common material workflow

Before going forward to new PBR capabilities, let's take a look at a shading model available in previous versions of OCCT 3D Viewer.

The Phong/Gouraud reflection model has been widely used in real-time graphics for a long time. Thanks to its simplicity, convincing look and affordable performance, this model has been implemented by fixed-function Transformation & Lighting (T&L) hardware blocks on graphical cards of the past. Introduction of programmable pipeline with first GPUs has given more flexibility to application developers, providing nice improvements like switching from per-vertex (Gouraud) to per-fragment (Phong) shading.

Per-vertex (left) vs. per-fragment (right) shading.

Common (Phong) material model consists of the following components (see Graphic3d_MaterialAspect and XCAFDoc_VisMaterialCommon structures):

  • Ambient color (a constant multiplied by active light);
  • Diffuse color (main object color reflected);
  • Specular color (hotspot of the light on the object);
  • Emissive color (added regardless of active light);
  • Shininess factor (defines a size of light hotspot);
  • Transparency factor.

Components of Phong material model.

Phong shading is an empirical illumination model, which means that it does not try to comply with physical laws of light distribution. Even more, in pursuit of better visual appearance, material workflow implies the lighting environment to be partially baked into an object's material. Dynamic lighting remains computed in real-time, but the object’s material, being artistically prepared for a specific environment, looks natural only there and has to be adjusted for another environment.

PBR Metal-roughness material workflow

The limitations of conventional shading models and growing power of GPUs have pushed developers to look for better and more universal models.

Physically-Based Rendering (PBR) illumination models aim to fit surface shading formulas into constraints of physical laws of light propagation / absorption / reflection - hence called "physically-based". This comes to the concept of energy conservation, which states that an object can not reflect more light than it receives.

Various PBR engines define different material models, but metallic-roughness PBR material workflow became most commonly used thanks to several game engines implementing it and open glTF 2.0 3D asset exchange format specification relying on this model. A common material model is a good step forward to interoperability across engines, so that 3D artists now can be sure that their models look consistent and as designed. There is still some diversity across engines, like PBR specular glossiness material workflow, though.

Compared to Phong shading, PBR model relies on even smaller number of key material properties (see Graphic3d_PBRMaterial and XCAFDoc_VisMaterialPBR structures):

  • Base color (or albedo);
  • Emissive color (added regardless of light);
  • Metallic flag (switching between metal and dielectric properties);
  • Roughness factor (the level of material polishness);
  • Transparency factor.

Metal-roughness PBR material properties.

Emissive color has the same meaning as in case of a Phong shading, as it is applied regardless of lighting - its purpose is defining a cheap fake light source baked into an object.

Base color has a meaning very close to diffuse color in Phong shading. The latter one, however, may include baked properties like self-shadow, inappropriate to a clean albedo texture. Therefore, diffuse texture from Phong material can be passed directly to the PBR pipeline, but to eliminate visual artifacts an artist should manually preprocess texture and clean up from unexpected content.

Roughness factor defines microsurface material properties. Roughness can be considered as the opposite to polishness (or to glossiness, used by another PBR material model).

Metallic flag defines whether material should behave as metal or as dielectric while responding to the light. In real life, material should be either metal or non-metal, but PBR material workflow supports metallic factors in-between. Such values can be used for displaying a smooth material transition on boundaries - like from corrugated to non-corrugated metal. Usage of non-binary metallic values is discouraged in any other cases, as it may cause unexpected visual results.

With some practice, it soon becomes clear that defining an artistic PBR Metallic-Roughness material is much simpler than defining a similar material for Common material workflow. And unlike Phong shading, the material will behave reasonably in various environments within a proper PBR engine. This also allows the same model to be displayed correctly in different 3D engines.

Exact conversion between Common and PBR metal-roughness material models is impossible. But some material properties have close relations like diffuse color and albedo, shininess and roughness, so that a non-exact lossy conversion is provided by OCCT.

A special care must be taken while defining transparent materials in PBR. First of all, semi-transparent metal makes no sense from a physical point of view. For this reason, applying synthetic transparency might give unexpected results - it is desired resetting material metalness to zero for a natural look. One more material parameter affects transparency - Index of Refraction (IOR).

Additional texture maps

PBR models may be accompanied by base color (albedo) and metal-roughness texture maps, which meaning is clear. In addition, the following texture maps are supported by OCCT and defined by glTF 2.0 core specification:

  • Emissive map (adds color regardless of lighting);
  • Normal map (adds small surface details without extending geometry);
  • Occlusion map (defines a pre-baked global illumination).

As these extra maps have no direct relationship to PBR metal-roughness material workflow, OCCT 3D Viewer now supports these texture maps in both PBR and Phong shading models.

Normal texture may add extra details like scratches or imprints
without altering geometry.

Occlusion texture adds pre-baked global illumination
(smooth shadows at geometry corners).

PBR renderers in OCCT

OCCT provides two PBR renderers:

  • Cinematic non-real-time renderer (ray-tracing/path-tracing);
  • Real-time renderer (rasterization).

Cinematic renderer is designed for uncompromised quality, for which it relies on ray-tracing rendering pipeline (Graphic3d_RM_RAYTRACING). Performance of current graphics hardware does not make it possible using computationally-intensive path-tracing renderer in real-time graphics, but with some limitations it can be used in an interactive fashion. OCCT includes a Path-Tracing rendering engine since 7.0.0 release, and implemented using GLSL programs.


Photorealistic Path-Tracing (above) vs. real-time PBR (below)
rendering engines in OCCT.

The objective of real-time PBR renderer is to be fast enough even on low-end graphics hardware. For that, it heavily relies on traditional rasterization rendering pipeline (Graphic3d_RM_RASTERIZATION), various approximations and tricks making it applicable in real-time, while looking good enough and preserving most important physical properties.

OCCT 7.5.0 introduces a real-time PBR renderer supporting metal-roughness material workflow. The math behind OCCT renderer can be found directly in OCCT documentation. Current implementation handles transparent materials taking an Index of Refraction into account; more advanced transparent material properties might be considered in the future.

The math requires light computations to be done in linear color space, while computer displays use non-linear color space reflecting properties of the human eye. For this reason, OCCT renderer has been improved to handle properly sRGB/RGB color conversions. This has been done as a general improvement affecting not only new PBR renderer, but the Phong shading model, RGB color definition (Quantity_Color) and color import/export in Data Exchange components (STEP, IGES, glTF, OBJ, etc.).

The Path-Tracing engine relies on a more advanced BSDF (Bidirectional Scattering Distribution Function) material model (Graphic3d_BSDF), so that auxiliary conversion tools have been introduced. In particular, built-in OCCT materials have been updated to support PBR metal-roughness material by conversion from previously defined BSDF material properties.

New renderer extends the list of shading models (Graphic3d_TypeOfShadingModel enumeration) with Graphic3d_TOSM_PBR/Graphic3d_TOSM_PBR_FACET values. This makes it possible to mix objects with Phong, Unlit and PBR materials in a single scene, though results might be unexpected.

This is because apart from different material properties, PBR rendering has one more important difference compared to Phong shading - light source intensity. Within Phong shading, light sources have color values within normalized [0; 1] range - so that both a sun and a tiny lamp would have comparable color values in the scene. Obviously, this contradicts physical laws, and PBR introduces unnormalized light intensity property - which should be scaled according to an energy emitted by a light source in the real world.

Therefore, a proper light sources setup becomes more critical in PBR workflow and requires more attention. Exactly the same light source definition applied to PBR and Phong shading models produces different results due to unnormalized / normalized light intensity definition.

Image-based lighting

A good light sources’ setup is crucial for a nice-looking PBR rendering results, and it might become a problem. Directional light sources give only a small hotspot on metals, while uniform ambient light sources result in too whitish results, which is no good.

Much better results give an Image-Based Lighting (IBL) - an environment (ambient) lighting based on a predefined image. OCCT 7.4.0 introduced support of cubemaps for viewer background, and OCCT 7.5.0 PBR renderer uses this image background for a realistic environment lighting effect.

No ambient light (top-left), uniform white ambient (top-right),
white room environment (bottom-left) and lake environment (bottom-right).

So far, OCCT does not come with any environment maps, and application developers are responsible for providing them to OCCT 3D Viewer. Normally, an application should provide a list of such images in settings, as different models might look better / more natural in different environments.

Point light sources are handled physically by PBR renderer, so that their attenuation has a squared distance dependency and constant/linear attenuation factors (supported by Phong shading) are ignored. In addition, point light now provides an optional cut-off distance at which light source should be fully attenuated - this is not physically correct (realistic light has an infinite zero attenuation distance), but artistic/optimization feature allowing to manage numerous point sources in a scene.

Performance comparison

Real-time PBR renderer uses various approximations, a lookup table and special textures for Image-Based Lighting pre-baked from an environment image - the generation of these maps, and optimizations of generation of these maps can be considered as subject for a dedicated article. Even with all these tricks, PBR is considerably more computationally intensive than conventional Phong shading.

It is clear that switching from Phong to PBR will affect performance, but to which extent? Well, practically speaking, this is not that crucial on modern graphics hardware. First of all, it should be noted that the main computational complexity resides in a Fragment Shader, while a vertex processing part remains the same. This gives a nice quality to renderer - performance depends more on a frame buffer resolution rather than on a number of triangles.

Tests on modern desktop and mobile hardware show framerate drop from 0% to 15%, but older hardware and extra conditions might give more considerable slowdown.

Data Exchange

XCAF document structure has been extended with a new element - visualization material (XCAFDoc_VisMaterial). It should not be mistaken with previously defined material element (XCAFDoc_Material) defining physical properties (e.g. density).

Visualization material can define Common XCAFDoc_VisMaterialCommon (obsolete), PBR Metal-roughness XCAFDoc_VisMaterialPBR (new) properties, or both at the same time. This gives application flexibility to either rely on automatic conversion between material models or to define specific properties (as automatic conversion can give undesirable results).

The document defines a plain list of Visualization materials, which are assigned to specific parts or sub-shapes. Data Exchange components have been improved to use new elements:

  • XBF document stores any combination of material and color labels. It should be noted, however, that assigning both color and material to the same part gives not well defined result and should be avoided.
  • STEP, IGES and similar formats storing only color information keep using a color table in an XCAF document. Visualization materials in the document are exported as colors.
  • JT reader/writer now translates material properties into a Common material definition in an XCAF document.
  • glTF reader/writer now translates material properties into PBR material definition in an XCAF document.

XCAFPrs_Style now stores both color and visualization material properties, XCAFPrs::CollectStyleSettings() collects overwhelming information from the document and XCAFPrs_AISObject supports displaying visualization material.

Conclusion

PBR dramatically improves the visual quality of rendered models at minor performance costs (on modern hardware). It is not limited to use cases, where realistic look is crucial - PBR is universal and can be used in a wide range of scenarios, from CAD to cartoon animations.

OCCT 3D Viewer supports a wide range of platforms and brings PBR renderer to desktop, mobile and web platforms. The minimal requirement is OpenGL 3.0+ or OpenGL ES 3.0+ capable hardware.
Metallic-roughness material workflow improves interoperability with other 3D engines supporting this workflow and ensuring consistent look of a model. Built-in glTF 2.0 data exchange component allows easily transmit models between OCCT and other systems like Blender.



A sample glTF model displayed in CAD Assistant, Blender and three.js
with close environment setup.

Materials in Draw Harness

The following tcl script defines a sample scene using Phong and PBR shading models.

pload OCAF XDE MODELING VISUALIZATION
vinit View1 -w 350 -h 400
# create an XCAF document from a sample model
restore [locate_data_file Ball.brep] ball
XNewDoc Doc
XAddShape Doc ball 0
# define a sample Common material
vrenderparams -shadingModel PHONG
XAddVisMaterial Doc matCommon -shininess 0.5 \
  -ambient DARKSLATEBLUE -diffuse CORNFLOWERBLUE \
  -specular WHITE
XSetVisMaterial Doc ball matCommon
XDisplay -dispMode 1 Doc
vfit
# define a sample PBR material
vrenderparams -shadingModel PBR
vlight -clear
vlight -add AMBIENT -intensity 1
vlight -add DIRECTIONAL -intensity 5 -headlight -direction 0 0 -1
XAddVisMaterial Doc matPbr -metallic 1 -roughness 0.5 \
  -albedo CORNFLOWERBLUE
XSetVisMaterial Doc ball matPbr
XDisplay -dispMode 1 Doc
vfit
# use cubemap for better ambient lighting
#vbackground -cubemap cubemap.png

  

 

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            欧美一区二区视频网站| 午夜精品福利一区二区蜜股av| 欧美xx69| 欧美成人精品在线播放| 欧美激情视频一区二区三区在线播放 | 国产精品乱人伦一区二区| 欧美日韩第一页| 国产精品美女久久久| 国产日韩欧美在线播放不卡| 国产一区二区三区奇米久涩| 在线精品在线| 亚洲性线免费观看视频成熟| 久久久久国产精品一区| 亚洲国产精彩中文乱码av在线播放| 欧美电影免费观看大全| 一本大道久久精品懂色aⅴ| 欧美一区二区三区久久精品茉莉花| 久久漫画官网| 国产精品一二三| 亚洲黄色影片| 欧美在线地址| 亚洲精品欧洲精品| 久久久噜噜噜久久狠狠50岁| 国产精品白丝av嫩草影院| 亚洲高清视频在线观看| 亚洲欧美国产高清va在线播| 欧美sm视频| 亚洲欧美日韩网| 欧美日韩xxxxx| 在线 亚洲欧美在线综合一区| 一本色道久久综合亚洲精品婷婷| 久久精品一区二区三区中文字幕| 亚洲黄色影院| 久久久噜噜噜久久人人看| 国产精品萝li| 在线一区二区视频| 欧美黄色aaaa| 久久久精品国产免费观看同学| 欧美午夜视频网站| 亚洲精品你懂的| 噜噜噜在线观看免费视频日韩| 中文在线资源观看网站视频免费不卡| 免费在线亚洲| 亚洲国产精品电影在线观看| 性欧美xxxx大乳国产app| 日韩亚洲精品视频| 欧美理论电影网| 亚洲精品在线视频| 欧美激情一二三区| 欧美阿v一级看视频| 在线观看国产欧美| 久久综合一区二区| 欧美主播一区二区三区美女 久久精品人| 欧美日韩在线高清| 亚洲色在线视频| 一本色道**综合亚洲精品蜜桃冫| 欧美老女人xx| 一本一本大道香蕉久在线精品| 亚洲国产一区二区a毛片| 免费成人av资源网| 亚洲精品人人| 亚洲欧洲在线视频| 一本在线高清不卡dvd| 狼人社综合社区| 欧美专区在线播放| 国内成+人亚洲| 久久五月天婷婷| 久久久水蜜桃| 亚洲精品一区二区三区四区高清| 亚洲国产精品嫩草影院| 欧美精品久久久久久久久久| 99精品欧美一区二区蜜桃免费| 日韩特黄影片| 国产精品一二三四| 老司机aⅴ在线精品导航| 欧美1区视频| 亚洲欧美另类综合偷拍| 欧美亚洲一区二区三区| 影音先锋欧美精品| 日韩视频永久免费| 国产一区二区在线观看免费播放| 男女激情久久| 国产精品久久久久影院色老大 | 久久久91精品| 蜜桃av一区二区| 亚洲一区二区三区四区在线观看 | 午夜精品久久久久久久久久久久久 | 欧美伊人影院| 亚洲激情一区二区三区| 亚洲美女av黄| 国产在线精品二区| 亚洲日本欧美| 国产亚洲精品成人av久久ww| 亚洲第一精品夜夜躁人人爽 | 久久一区二区三区四区| 一区二区三区欧美激情| 亚洲欧美日韩中文视频| 亚洲精品网址在线观看| 亚洲一区久久| 99精品国产一区二区青青牛奶 | 亚洲婷婷综合色高清在线| 伊人色综合久久天天| 亚洲图色在线| 亚洲精品免费看| 久久精品国产亚洲高清剧情介绍| 亚洲精品九九| 久久国产精品久久久| 亚洲影院污污.| 欧美激情一区二区三区全黄| 久久福利精品| 国产精品扒开腿做爽爽爽视频| 欧美激情一区在线观看| 欧美日韩国语| 狠狠色狠狠色综合| 一区二区三区免费网站| 亚洲国产欧美一区| 欧美一区二区三区婷婷月色| 亚洲一区国产视频| 欧美日韩在线高清| 亚洲人午夜精品免费| 在线日韩中文| 久久精品视频免费观看| 久久精品中文字幕一区二区三区| 欧美午夜激情在线| 夜夜嗨一区二区三区| 一区二区三区精密机械公司| 欧美国产高清| 亚洲国产精品高清久久久| 在线播放日韩欧美| 久久综合伊人| 亚洲大胆视频| 亚洲伦理网站| 欧美日本在线一区| 亚洲精品网址在线观看| 亚洲伦伦在线| 欧美日韩成人精品| av成人福利| 亚洲欧美一区二区三区在线| 国产精品毛片| 欧美一区二区三区视频| 久久久久国产精品麻豆ai换脸| 国产午夜精品久久久久久久| 香蕉久久久久久久av网站| 久久九九精品| 亚洲激情成人网| 欧美日韩1区| 亚洲欧美第一页| 蜜臀av性久久久久蜜臀aⅴ| 亚洲黄色成人| 国产精品盗摄久久久| 香蕉成人伊视频在线观看| 久久久综合网站| 亚洲日韩第九十九页| 欧美日韩在线观看一区二区三区 | 午夜精品久久久久久久久| 国产精品一二三视频| 久久成年人视频| 亚洲国产视频一区二区| 亚洲一级在线观看| 国产亚洲一级| 欧美激情按摩| 亚洲欧美日韩在线| 亚洲国产日韩一区| 欧美一区二区视频免费观看| 亚洲第一主播视频| 欧美亚洲第一区| 久久亚洲私人国产精品va媚药 | 久久久午夜精品| 亚洲精品一区二区三区四区高清| 亚洲专区一二三| 亚洲成在线观看| 国产精品成人一区二区网站软件 | 欧美色一级片| 久久天天躁狠狠躁夜夜av| 亚洲免费av观看| 久久亚洲一区二区| 亚洲在线成人| 在线成人h网| 久久国产精品亚洲va麻豆| 久久精品国语| 亚洲激情六月丁香| 国产精品视频导航| 欧美高清视频| 欧美在线观看日本一区| 亚洲国产综合视频在线观看| 久久精品久久99精品久久| 日韩亚洲欧美综合| 怡红院精品视频在线观看极品| 欧美日精品一区视频| 看欧美日韩国产| 香蕉亚洲视频| 亚洲午夜激情| 一区二区三区日韩在线观看| 欧美激情亚洲综合一区| 久久久综合免费视频| 欧美亚洲网站| 亚洲欧美日韩精品久久久久| 99pao成人国产永久免费视频| 一区二区在线视频| 国产亚洲欧美日韩美女|