2022 Talk About X3D PBR glTF - michaliskambi/x3d-tests GitHub Wiki
Title: Physically based rendering (PBR) in X3D 4, using glTF with X3D 4
Watch the recorded webinar here: https://www.youtube.com/watch?v=iQ0s1V37tAw
March 29 (Tuesday)
Time: ~45 mins talk + 15 min for QA
Register on https://www.web3d.org/pbr-x3d4-using-gltf
Summary
We will go over the new features in X3D 4 related to materials, lighting and textures. These include
- physically based rendering,
- normal maps,
- more ways to affect materials by textures,
- close alignment with PBR in glTF,
- upcoming work: environment light.
I will make this a practical session: for everything that I'll describe, I'll also show how to actually write it in X3D, and render using Castle Game Engine / view3dscene.
Short Plan
- Overview of X3D
- Materials in X3D 4: unlit, PBR, Phong
- Lights in X3D 4: unbounded intensity, upcoming environment light
- Textures in X3D 4: modify any material parameter
- Practical examples of how to write all above in X3D, classic and XML
- Inline glTF in X3D
- Strategy to express glTF concepts, in particular PBR, using X3D
- Example: export Blender -> glTF, inline in X3D
Full Plan
-
Overview of important X3D concepts
- Shape
- a number of possible geometry nodes
- Appearance
- with materials and textures
-
Materials in X3D 4
3 possible material nodes in X3D 4:
For all materials:
- all their parameters can be affected by textures, e.g.
diffuseColor
anddiffuseTexture
- all material types have a normal texture
- all material types have
emissive
- all material types have transparency
UnlitMaterial
:- Nothing more.
- Just emissive (color and texture).
- Calculation ignores lighting, and is expected to be optimized.
Material
:- Phong lighting model.
- Backward-compatible with X3D 3.
- Parameters: ambient, diffuse, specular, shininess, occlusion
PhysicalMaterial
:- PBR lighting model, compatible with glTF 2.0 PBR metallic-roughness model.
- Parameters: base, metallic, roughness, occlusion
- Note: common metallicRoughnessTexture to parametrize both metallic-roughness, like glTF.
- all their parameters can be affected by textures, e.g.
-
Lights:
Same lights as you know from X3D 3:
But now with unbounded intensity.
Work in progress:
- EnvironmentLight (expected to be largely compatible with Khronos KHR_lights_environment, EXT_lights_image_based) https://github.com/michaliskambi/x3d-tests/wiki/Image-Based-Lighting-(EnvironmentLight-node)
-
Textures:
You can specify them at material slots.
Textures in Appearance.texture also still allowed, backward-compatible: act as Material.diffuseTexture/PhysicalMaterial.baseTexture/UnlitMaterial.emissiveTexture.
Treatment of grayscale and RGB simpler. Grayscale is just equivalent to red=green=blue.
-
Writing above in X3D, classic and XML
-
Inline glTF
-
Strategy to express glTF concepts, in particular PBR, using X3D
-
Example: export Blender -> glTF, inline in X3D
-
Links about development:
Follow from https://github.com/michaliskambi/x3d-tests/wiki/X3D-version-4:-New-features-of-materials,-lights-and-textures https://github.com/michaliskambi/x3d-tests/wiki/Converting-glTF-to-X3D
My viewer: Castle Game Engine and view3dscene https://castle-engine.io/ https://castle-engine.io/view3dscene.php
Conversion: use view3dscene, or online https://castle-engine.io/convert.php