A physially-based GLTF2.0 renderer with image-based lighting.
The renderer uses the reference GLTF2.0 lighting model.
Khronos GLTF viewer | Diligent Engine |
---|---|
![]() | ![]() |
The implementation is based on GLTF sample viewer from Khronos Group and Vulkan-glTF-PBR project by Sascha Willems.
To initialize the renderer, populate GLTF_PBR_Renderer::CreateInfo
structure and create an instance of GLTF_PBR_Renderer
class:
Note that the front face is set to counter-clockwise because in GLTF, y axis points down and we need to invert it, which will reverse the winding order.
The renderer generates all required look-up tables at run-time. For image-based lighting, it pre-computes irradiance cube map for diffuse component and pre-filtered environment map for specular component:
The renderer itself does not implement any loading functionality. Use Asset Loader to load GLTF models. When model is loaded, it is important to call InitializeResourceBindings()
method to let the renderer initialize internal shader resource binding objects:
To render the model, prepare GLTF_PBR_Renderer::RenderInfo
structure and call Render()
method:
For more details, see GLTFViewer.cpp.