Filament Real-Time PBR Engine

repository·main·Indexed 12 days ago

https://github.com/google/filament

A real-time physically based rendering (PBR) engine designed for high efficiency and small footprint. It supports Android, iOS, Linux, macOS, Windows, and WebAssembly (WASM). The engine includes tools for material compilation (matc), IBL generation (cmgen), and mesh conversion (filamesh), as well as a Gradle plugin for Android integration and a gltfio library for model loading.

Tokens
907.8K
Snippets
3.2K
Records
4.6K
Agent score
96%

What's inside Filament

  1. Overview of nanozlib

    main

    nanozlib is a lightweight C/C++ library designed for embedding zlib support into applications. It provides nanoscale secure zlib decoding (using Wuffs std/zlib) and somewhat secure zlib compression (using stb_zlib).

    Key Characteristics

    • Security: The decoding part is designed to be highly secure, specifically avoiding assert, C++ exceptions, and segmentation faults when encountering corrupted or malicious zlib data.
    • Limitations:
      • Supports up to 2GB.
      • Adds approximately 50 KB or more to the compiled binary size (even with -Os optimization).
    • Alternatives: If you require a 'picoscale' (extremely small) zlib decoder, consider the zlib module in stb_image instead.
  2. What is matdbg and its capabilities

    main

    matdbg is a library and web application designed for debugging and live-editing Filament shaders. It allows you to inspect and modify shader code across different graphics backends:

    • OpenGL: Editing GLSL
    • Metal: Editing MSL
    • Vulkan: Editing transpiled GLSL or viewing disassembled SPIR-V
    • WebGPU: Editing WGSL

    Note that a material can be inspected for multiple backends (e.g., Metal) even if the current active session is using a different backend (e.g., Vulkan), provided the material was built with support for those backends included.

  3. Overview of the Googletest Mocking (gMock) Framework

    main

    gMock is a C++ framework for creating and using mock classes. It is designed to help developers derive better system designs and write more effective tests by providing a declarative syntax for defining mocks and controlling their behavior.

    Key capabilities include:

    • Declarative Mock Definition: Define mock objects using a specialized syntax.
    • Partial (Hybrid) Mocks: Create objects that combine real implementation with mocked behavior.
    • Argument Validation: Use a rich set of matchers to validate function arguments.
    • Behavior Control: Use intuitive syntax to specify what a mock should do when called.
    • Automatic Verification: Expectations are verified automatically without requiring a manual record-and-replay step.
    • Ordering Constraints: Express arbitrary (partial) ordering constraints on function calls.
    • Extensibility: Define custom matchers and actions to extend the framework.
    • C++ Specifics: Handles overloaded functions and functions of arbitrary types, and does not rely on exceptions.
  4. Overview of the Vulkan Loader Layer Interface

    main

    The Layer Interface provides a way to interact with the Vulkan loader using a layer-centric view. Layers allow developers to intercept Vulkan calls, add functionality (such as validation or debugging), or modify behavior without changing the application code. This interface is part of the Vulkan ecosystem and is managed by the Vulkan loader to facilitate discovery, dispatching, and management of these layers.

    For a complete architectural overview of the loader, refer to LoaderInterfaceArchitecture.md.

  5. Overview of glslang components

    main

    glslang is a reference compiler and validator for shader languages. Its core components include:

    • Reference Validator and GLSL/ESSL -> AST Front End: Translates OpenGL GLSL and OpenGL|ES GLSL (ESSL) into an internal Abstract Syntax Tree (AST).
    • HLSL -> AST Front End: Translates an approximation of HLSL to the glslang AST. Note that semantics are not reference quality and input is not validated.
    • AST -> SPIR-V Back End: Translates the internal AST into the Khronos-specified SPIR-V intermediate language.
    • Reflector: An API to retrieve reflection information (types, variables, etc.) from the High-Level Language (HLL) source via the AST.
    • Standalone Wrapper: A command-line tool (glslang) providing access to the components above.
  6. Overview of libpng CMake files and scripts

    main
    The libpng distribution includes a set of CMake files, lists, and scripts designed to facilitate the integration and build process of the PNG Reference Library. The main entry point for CMake builds is the CMakeLists.txt file. For projects using FindPNG, the configuration is provided by scripts/cmake/PNGConfig.cmake.
  7. Overview of ZLib.Ada

    main

    ZLib.Ada is a thick binding interface for the ZLib data compression library. It provides Ada-style access to the ZLib C library functions.

    Key features and recent updates include:

    • Package ZLib and ZLib.Streams: Includes Is_Open routines to check stream status.
    • ZLib.Read routine: Now supports Allow_Read_Some and Flush parameters (requires initialization for the Read_Last parameter).
    • Error Handling: Includes a Status_Error exception definition.
    • Demonstration: The source files test.adb and read.adb serve as small demo programs illustrating the main functionality of the binding.
  8. What is Emdawnwebgpu

    main

    Emdawnwebgpu is Dawn's implementation of webgpu.h for Emscripten, built on top of the WebGPU JavaScript API. It allows developers to use the standard <webgpu/webgpu.h> and the Dawn-style <webgpu/webgpu_cpp.h> headers within an Emscripten-based Web project. It is a fork of Emscripten's original USE_WEBGPU bindings and is maintained within the Dawn repository.

    API Stability Note:

    • Core parts of webgpu.h (from webgpu-native/webgpu-headers) are considered stable.
    • Dawn/Emscripten-specific parts and all of webgpu_cpp.h are NOT considered stable and may change.
  9. Overview of the Vulkan Loader

    main

    The Vulkan Loader is a library that sits between a Vulkan application and various Vulkan drivers (Installable Client Drivers or ICDs). Its primary responsibilities include:

    • Multi-driver support: Enabling systems with multiple GPUs (each with different drivers) to function within a single Vulkan environment.
    • Instance management: Supporting multiple global Vulkan instances.
    • Layer management: Managing the insertion of Vulkan layer libraries (such as validation layers) between the application and the drivers.

    This repository provides the loader for Linux, Windows, MacOS, and iOS.

    Note: For Android, a separate loader maintained by Google must be used instead of this one.

  10. What is SPIRV-Cross?

    main

    SPIRV-Cross is a tool designed for parsing and converting SPIR-V shader code into other shader languages or reflection formats. It aims to produce readable, human-like code rather than assembly-like IR.

    Key Features:

    • Language Conversion: Converts SPIR-V to GLSL, Metal Shading Language (MSL), and HLSL.
    • Reflection:
      • Converts SPIR-V to a JSON reflection format.
      • Provides a Reflection API to simplify Vulkan pipeline layout creation.
      • Provides a Reflection API to modify and tweak OpDecorations.
    • Shader Support: Supports vertex, fragment, tessellation, geometry, and compute shaders.