Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS, and WebGL2

Overview

Filament

Android Build Status iOS Build Status Linux Build Status macOS Build Status Windows Build Status Web Build Status

Filament is a real-time physically based rendering engine for Android, iOS, Linux, macOS, Windows, and WebGL. It is designed to be as small as possible and as efficient as possible on Android.

Download

Download Filament releases to access stable builds. Filament release archives contains host-side tools that are required to generate assets.

Make sure you always use tools from the same release as the runtime library. This is particularly important for matc (material compiler).

If you'd rather build Filament yourself, please refer to our build manual.

Android

Android projects can simply declare Filament libraries as Maven dependencies:

repositories {
    // ...
    mavenCentral()
}

dependencies {
    implementation 'com.google.android.filament:filament-android:1.15.1'
}

Here are all the libraries available in the group com.google.android.filament:

Artifact Description
filament-android The Filament rendering engine itself.
gltfio-android A glTF 2.0 loader for Filament, depends on filament-android.
gltfio-android-lite Trimmed version of gltfio that does not support some glTF extensions.
filament-utils-android KTX loading, Kotlin math, and camera utilities, depends on gltfio-android.
filament-utils-android-lite Trimmed version of filament-utils that does not support some glTF features.
filamat-android A runtime material builder/compiler. This library is large but contains a full shader compiler/validator/optimizer and supports both OpenGL and Vulkan.
filamat-android-lite A much smaller alternative to filamat-android that can only generate OpenGL shaders. It does not provide validation or optimizations.

iOS

iOS projects can use CocoaPods to install the latest release:

pod 'Filament', '~> 1.15.1'

Snapshots

If you prefer to live on the edge, you can download a continuous build by following the following steps:

  1. Find the commit you're interested in.
  2. Click the green check mark under the commit message.
  3. Click on the Details link for the platform you're interested in.
  4. On the top right, click on the Artifacts dropdown and choose an artifact.

Documentation

  • Filament, an in-depth explanation of real-time physically based rendering, the graphics capabilities and implementation of Filament. This document explains the math and reasoning behind most of our decisions. This document is a good introduction to PBR for graphics programmers.
  • Materials, the full reference documentation for our material system. This document explains our different material models, how to use the material compiler matc and how to write custom materials.
  • Material Properties, a reference sheet for the standard material model.

Examples

Night scene Night scene Materials Materials Helmet Screen-space refraction

Features

APIs

  • Native C++ API for Android, iOS, Linux, macOS and Windows
  • Java/JNI API for Android
  • JavaScript API

Backends

  • OpenGL 4.1+ for Linux, macOS and Windows
  • OpenGL ES 3.0+ for Android and iOS
  • Metal for macOS and iOS
  • Vulkan 1.0 for Android, Linux, macOS, and Windows
  • WebGL 2.0 for all platforms

Rendering

  • Clustered forward renderer
  • Cook-Torrance microfacet specular BRDF
  • Lambertian diffuse BRDF
  • Custom lighting/surface shading
  • HDR/linear lighting
  • Metallic workflow
  • Clear coat
  • Anisotropic lighting
  • Approximated translucent (subsurface) materials
  • Cloth/fabric/sheen shading
  • Normal mapping & ambient occlusion mapping
  • Image-based lighting
  • Physically-based camera (shutter speed, sensitivity and aperture)
  • Physical light units
  • Point lights, spot lights and directional light
  • Specular anti-aliasing
  • Spot and directional light shadows
  • Cascaded shadows
  • EVSM, PCSS, DPCF, or PCF shadows
  • Transparent shadows
  • Contact shadows
  • Screen-space ambient occlusion
  • Screen-space refraction
  • Global fog
  • Dynamic resolution (with support for AMD FidelityFX FSR)

Post processing

  • HDR bloom
  • Depth of field bokeh
  • Multiple tone mappers: generic (customizable), ACES, filmic, etc.
  • Color and tone management: luminance scaling, gamut mapping
  • Color grading: exposure, night adaptation, white balance, channel mixer, shadows/mid-tones/highlights, ASC CDL, contrast, saturation, etc.
  • TAA, FXAA, MSAA
  • Screen-space lens flares

glTF 2.0

  • Encodings

    • Embeded
    • Binary
  • Primitive Types

    • Points
    • Lines
    • Line Loop
    • Line Strip
    • Triangles
    • Triangle Strip
    • Triangle Fan
  • Animation

    • Transform animation
    • Linear interpolation
    • Morph animation
      • Sparse accessor
    • Skin animation
    • Joint animation
  • Extensions

    • KHR_draco_mesh_compression
    • KHR_lights_punctual
    • KHR_materials_clearcoat
    • KHR_materials_ior
    • KHR_materials_pbrSpecularGlossiness
    • KHR_materials_sheen
    • KHR_materials_transmission
    • KHR_materials_unlit
    • KHR_materials_volume
    • KHR_mesh_quantization
    • KHR_texture_transform

Rendering with Filament

Native Linux, macOS and Windows

You must create an Engine, a Renderer and a SwapChain. The SwapChain is created from a native window pointer (an NSView on macOS or a HWND on Windows for instance):

Engine* engine = Engine::create();
SwapChain* swapChain = engine->createSwapChain(nativeWindow);
Renderer* renderer = engine->createRenderer();

To render a frame you must then create a View, a Scene and a Camera:

Camera* camera = engine->createCamera(EntityManager::get().create());
View* view = engine->createView();
Scene* scene = engine->createScene();

view->setCamera(camera);
view->setScene(scene);

Renderables are added to the scene:

Entity renderable = EntityManager::get().create();
// build a quad
RenderableManager::Builder(1)
        .boundingBox({{ -1, -1, -1 }, { 1, 1, 1 }})
        .material(0, materialInstance)
        .geometry(0, RenderableManager::PrimitiveType::TRIANGLES, vertexBuffer, indexBuffer, 0, 6)
        .culling(false)
        .build(*engine, renderable);
scene->addEntity(renderable);

The material instance is obtained from a material, itself loaded from a binary blob generated by matc:

Material* material = Material::Builder()
        .package((void*) BAKED_MATERIAL_PACKAGE, sizeof(BAKED_MATERIAL_PACKAGE))
        .build(*engine);
MaterialInstance* materialInstance = material->createInstance();

To learn more about materials and matc, please refer to the materials documentation.

To render, simply pass the View to the Renderer:

// beginFrame() returns false if we need to skip a frame
if (renderer->beginFrame(swapChain)) {
    // for each View
    renderer->render(view);
    renderer->endFrame();
}

For complete examples of Linux, macOS and Windows Filament applications, look at the source files in the samples/ directory. These samples are all based on libs/filamentapp/ which contains the code that creates a native window with SDL2 and initializes the Filament engine, renderer and views.

For more information on how to prepare environment maps for image-based lighting please refer to BUILDING.md.

Android

See android/samples for examples of how to use Filament on Android.

You must always first initialize Filament by calling Filament.init().

Rendering with Filament on Android is similar to rendering from native code (the APIs are largely the same across languages). You can render into a Surface by passing a Surface to the createSwapChain method. This allows you to render to a SurfaceTexture, a TextureView or a SurfaceView. To make things easier we provide an Android specific API called UiHelper in the package com.google.android.filament.android. All you need to do is set a render callback on the helper and attach your SurfaceView or TextureView to it. You are still responsible for creating the swap chain in the onNativeWindowChanged() callback.

iOS

Filament is supported on iOS 11.0 and above. See ios/samples for examples of using Filament on iOS.

Filament on iOS is largely the same as native rendering with C++. A CAEAGLLayer or CAMetalLayer is passed to the createSwapChain method. Filament for iOS supports both Metal (preferred) and OpenGL ES.

Assets

To get started you can use the textures and environment maps found respectively in third_party/textures and third_party/environments. These assets are under CC0 license. Please refer to their respective URL.txt files to know more about the original authors.

Environments must be pre-processed using cmgen or using the libiblprefilter library.

How to make contributions

Please read and follow the steps in CONTRIBUTING.md. Make sure you are familiar with the code style.

Directory structure

This repository not only contains the core Filament engine, but also its supporting libraries and tools.

  • android: Android libraries and projects
    • filamat-android: Filament material generation library (AAR) for Android
    • filament-android: Filament library (AAR) for Android
    • filament-utils-android: Extra utilities (KTX loader, math types, etc.)
    • gltfio-android: Filament glTF loading library (AAR) for Android
    • samples: Android-specific Filament samples
  • art: Source for various artworks (logos, PDF manuals, etc.)
  • assets: 3D assets to use with sample applications
  • build: CMake build scripts
  • docs: Documentation
    • math: Mathematica notebooks used to explore BRDFs, equations, etc.
  • filament: Filament rendering engine (minimal dependencies)
    • backend: Rendering backends/drivers (Vulkan, Metal, OpenGL/ES)
  • ide: Configuration files for IDEs (CLion, etc.)
  • ios: Sample projects for iOS
  • libs: Libraries
    • bluegl: OpenGL bindings for macOS, Linux and Windows
    • bluevk: Vulkan bindings for macOS, Linux, Windows and Android
    • camutils: Camera manipulation utilities
    • filabridge: Library shared by the Filament engine and host tools
    • filaflat: Serialization/deserialization library used for materials
    • filagui: Helper library for Dear ImGui
    • filamat: Material generation library
    • filamentapp: SDL2 skeleton to build sample apps
    • filameshio: Tiny filamesh parsing library (see also tools/filamesh)
    • geometry: Mesh-related utilities
    • gltfio: Loader for glTF 2.0
    • ibl: IBL generation tools
    • image: Image filtering and simple transforms
    • imageio: Image file reading / writing, only intended for internal use
    • matdbg: DebugServer for inspecting shaders at run-time (debug builds only)
    • math: Math library
    • mathio: Math types support for output streams
    • utils: Utility library (threads, memory, data structures, etc.)
    • viewer: glTF viewer library (requires gltfio)
  • samples: Sample desktop applications
  • shaders: Shaders used by filamat and matc
  • third_party: External libraries and assets
    • environments: Environment maps under CC0 license that can be used with cmgen
    • models: Models under permissive licenses
    • textures: Textures under CC0 license
  • tools: Host tools
    • cmgen: Image-based lighting asset generator
    • filamesh: Mesh converter
    • glslminifier: Minifies GLSL source code
    • matc: Material compiler
    • matinfo Displays information about materials compiled with matc
    • mipgen Generates a series of miplevels from a source image
    • normal-blending: Tool to blend normal maps
    • resgen Aggregates binary blobs into embeddable resources
    • roughness-prefilter: Pre-filters a roughness map from a normal map to reduce aliasing
    • specular-color: Computes the specular color of conductors based on spectral data
  • web: JavaScript bindings, documentation, and samples

License

Please see LICENSE.

Disclaimer

This is not an officially supported Google product.

Issues
  • Building using native Visual Studio

    Building using native Visual Studio

    Describe the bug Not a bug. I am just wondering what prevents building filament using the native Microsoft compiler in Visual Studio? Is it just a matter of C++ code not building? I saw a reference about assembly code in another issue. Is this still a problem or is there equivalent c code?

    enhancement windows 
    opened by gpyalt 37
  • Initial draft of C FFI wrapper for filament

    Initial draft of C FFI wrapper for filament

    This is an initial draft of a C wrapper for #139.

    This will likely require major rework before it is merged, but I wanted to get the discussion going nevertheless.

    Current the idea of API.h / cfilament.h is that the same symbol name is used in the C header, but is directly aliased to the C++ class if the header is included from the cpp file.

    I am also not sure whether duplication of documentation makes sense here. The interface is most likely going to be used by writers of FFI wrappers for other languages that do not use the header directly. Actual users of C will likely have access to an actual C++ compiler and can link against the static library directly without use of this wrapper.

    opened by shartte 37
  • Occlusion Material

    Occlusion Material

    Describe the bug I use filament via the SceneForm SDK. But I suspect it is a filament bug. When I put this material on an object then on some devices (I have not yet been able to determine which ones are 100% functional and which are not.) the objects behind it are displayed in black.

    This effect only affects GLTF and OBJ objects. FBX models are correctly occluded.

    The question now is whether it is a filament bug or rather an ArCore bug.

    This is my occluder material:

    material {
        name : "Occlusion material",
        shadingModel : unlit,
        colorWrite : false,
        depthWrite : true
    }
    
    fragment {
        void material(inout MaterialInputs material) {
            prepareMaterial(material);
            material.baseColor = vec4(0.0);
        }
    }
    

    To Reproduce Simply place a model with this material in front of a GLTF object. That is the result. 68686583-2135c400-056c-11ea-8a0b-c2b1ce06e7b6

    Expected behavior It would be correct if the object behind it were not visible. Like this: 68686464-f8adca00-056b-11ea-9dd5-9203d7a497fe

    Screenshots See "ToReproduce" and "Expected behavior" sections

    Smartphone (please complete the following information):

    • Device: [Not Working: Pixel 3a / OnePlus 5T] [Working: for example Samsung S7]
    • OS: [All Android Versions]

    Additional context The render order of the objects was set as follows: Camera -> Occlusion -> Others

    If this is not a filament error I apologize. But I have the feeling that the people in the SceneForm Repo are being let down.

    Maybe someone from this team can help. What surprises me is that it only does not work with GLTF and OBJ objects.

    opened by bobekos 36
  • readPixels on iOS/Metal returns buffer with only zeros

    readPixels on iOS/Metal returns buffer with only zeros

    I am using readPixels with a callback on iOS/Metal. The PixelBuffer uses PixelDataFormat::RGBA and PixelDataType::UBYTE. I am reserving an uint8_t array of size width * height * 4 for the storage, and call renderer->readPixels(0, 0, width, height, std::move(pb)).

    The swapchain has SwapChain::CONFIG_TRANSPARENT | SwapChain::CONFIG_READABLE as parameters, and I have metalLayer.opaque = NO to match that.

    Unfortunately, when the callback fires, the buffer is all zeros. Any ideas?

    (will try on other backends tomorrow).

    bug metal 
    opened by kpeeters 35
  • "gltfviewer -s" results in no lighting

    Describe the bug in windows, command "gltf_viewer my.gltf", that point lighting effect is visible; however, command "gltf_viewer -s my.gltf",that point lighting effect is gone. However, we do not want to scale the scene.

    Expected behavior how could be modify the code to control this?

    opened by JackKaiXing 34
  • 1.16 may have broken skinmeshes lighting

    1.16 may have broken skinmeshes lighting

    Describe the bug I updated from 1.15.2 to 1.16.1 and the lighting of my skin meshes completely broke. It looks as if the normals aren't computed properly, I'm not even sure the light is coming from the correct direction. No problem on static geometries.

    • I already rebuilt the materials.
    • I don't think I have any kind of scales in my hierarchy

    To Reproduce Steps to reproduce the behavior: I don't have repro steps and can't provide screenshots yet, this will take me a while to provide (or is there a way to provide screenshots privately?)

    I'm opening the ticket as a heads-up and welcoming suggestions if this problem could be on my side. In the meanwhile I've temporarily reverted to 1.15.2.

    Desktop (please complete the following information):

    • OS: Windows
    • GPU: NVIDIA GTX 1080
    • Backend: OpenGL
    bug 
    opened by teub 33
  • How to show only gltf model not the background part

    How to show only gltf model not the background part

    I want to render the gltf model with a transparent background in android-

    the code is

      ` surfaceView = SurfaceView(this);
        choreographer = Choreographer.getInstance()
        modelViewer = ModelViewer(surfaceView)
        surfaceView.setOnTouchListener(modelViewer)
        loadGltf("BusterDrone")
        loadEnvironment("venetian_crossroads_2k")
    
    }
    
    private fun loadEnvironment(ibl: String) {
        // Create the indirect light source and add it to the scene.
        var buffer = readAsset("envs/$ibl/${ibl}_ibl.ktx")
        KtxLoader.createIndirectLight(modelViewer.engine, buffer).apply {
            intensity = 100_000f
            modelViewer.scene.indirectLight = this
    
        }
    
        // Create the sky box and add it to the scene.
        buffer = readAsset("envs/$ibl/${ibl}_skybox.ktx")
        KtxLoader.createSkybox(modelViewer.engine, buffer).apply {
            //modelViewer.view.blendMode=View.BlendMode.TRANSLUCENT
            modelViewer.scene.skybox= Skybox.Builder().intensity(0f).color(0.0f, 0.0f, 0.0f, 0.0f).build(modelViewer.engine)
            //modelViewer.scene.skybox=null
        }
    }
    
    private fun loadGltf(name: String) {
        val buffer = readAsset("models/${name}.gltf")
        modelViewer.loadModelGltf(buffer) { uri -> readAsset("models/$uri") }
        modelViewer.transformToUnitCube()
    }
    
    private fun readAsset(assetName: String): ByteBuffer {
        val input = assets.open(assetName)
        val bytes = ByteArray(input.available())
        input.read(bytes)
        return ByteBuffer.wrap(bytes)
    }`
    

    I'm getting the black background when I'm using this code in skybox modelViewer.scene.skybox= Skybox.Builder().intensity(0f).color(0.0f, 0.0f, 0.0f, 0.0f).build(modelViewer.engine)

    and twhen I'm using this code in skybox. modelViewer.view.blendMode=View.BlendMode.TRANSLUCENT modelViewer.scene.skybox=null

    I'm getting like this Screenshot_2020-10-21-11-18-24-514_com google android filament gltf (1)

    Please tell me how can I show the model without any background?

    enhancement gltf 
    opened by shivammaindola 33
  • How to render into a transparent RenderTarget/Texture?

    How to render into a transparent RenderTarget/Texture?

    I create a View and set a RenderTarget which contains a color and depth attachment.

    The texture for the color attachment is created like:

    fila_texture = filament::Texture::Builder()
          .width(settings.width)
          .height(settings.height)
          .levels(1)
          .usage(filament::Texture::Usage::COLOR_ATTACHMENT | filament::Texture::Usage::SAMPLEABLE)
          .format(filament::Texture::InternalFormat::RGBA16F)
          .build(settings.ctx->getEngineRef());
    

    I've set the clear color using ClearOptions of the Renderer to an arbitary color with an alpha of 0.

    Is this the correct way of rendering into a transparent buffer?

    I'm asking because the result I get seems to have an alpha of 1.0.

    bug 
    opened by roxlu 33
  • GLTF's UV scaling functionality not implemented?

    GLTF's UV scaling functionality not implemented?

    Bug description We suspect that the Filament 1.4.5 version, present in last Sceneform version (1.16.0), does not deal (properly) with UV Scaling in GLTF/GLB files.

    To Reproduce This kind of transform is carried-out by means of the GLTF 2.0 extension KHR_texture_transform. Said this, when this kind of UV Scaling is used in a GLTF file under ARCore, in order to obtain a repeatable large texture, these are the wrong results obtained: image Please note the wrong repetition problem in the platform and the rail.

    Expected behavior Of course, the texture is shown in a correct way when we visualize the GLTF by means of a WebGL viewer (e.g. VSCodium GLTF Extension with BJS rendering): image

    Smartphone (please complete the following information):

    • Device: Motorola MotoG6 and Samsung Tab S4
    • OS: Android 9.0
    bug gltf 
    opened by vortice3D 29
  • opengl32.lib duplicate defines error

    opengl32.lib duplicate defines error

    I am trying to build the filament libs into my own project, but my project already includes opengl for other libs and I am getting the following errors: https://pastebin.com/aNCA9DEd

    Do you guys have some sort of workaround for this just like the unwindows.h file?

    opened by Tenebralus 27
  • Devices with PowerVR GE8320 GPU crash at glCompileShader

    Devices with PowerVR GE8320 GPU crash at glCompileShader

    Describe the bug Crashes on start in a Samsung A10s device. It runs ok very rarely. It does not crash in other test devices I have (Samsung S8 and Moto E5), so it could be GPU specific.

    To Reproduce This is my own project but I am getting a very similar log when running the ibl sample.

    Smartphone (please complete the following information):

    • Device: A10s (GPU - PowerVR GE8320)
    • OS: Android 10

    Additional context 2021-03-16 23:51:25.031 22948-22948/com.ribeirop.drumknee I/Filament: FEngine (32 bits) created at 0xb7f4e800 (threading is enabled) 2021-03-16 23:51:25.032 22948-22991/com.ribeirop.drumknee D/Filament: Using ASurfaceTexture 2021-03-16 23:51:25.032 22948-22991/com.ribeirop.drumknee D/Filament: FEngine resolved backend: OpenGL 2021-03-16 23:51:25.032 22948-22991/com.ribeirop.drumknee I/GPUD: @gpudInitialize: successfully initialized with 1, dbg=0 mmdump_dbg=0 2021-03-16 23:51:25.119 22948-22948/com.ribeirop.drumknee D/skia_mt: canRunInCoworker = true 2021-03-16 23:51:25.150 22948-22948/com.ribeirop.drumknee I/chatty: uid=10213(com.ribeirop.drumknee) identical 2 lines 2021-03-16 23:51:25.163 22948-22948/com.ribeirop.drumknee D/skia_mt: canRunInCoworker = true 2021-03-16 23:51:25.165 22948-22948/com.ribeirop.drumknee D/pwd param: baseColor 2021-03-16 23:51:25.165 22948-22948/com.ribeirop.drumknee D/pwd param: aoRoughnessMetallic 2021-03-16 23:51:25.165 22948-22948/com.ribeirop.drumknee D/pwd param: normal

    --------- beginning of crash
    

    2021-03-16 23:51:25.185 22948-22991/com.ribeirop.drumknee A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xf41b1af4 in tid 22991 (FEngine::loop), pid 22948 (beirop.drumknee) 2021-03-16 23:51:25.241 23003-23003/? E/crash_dump32: unknown process state: t 2021-03-16 23:51:25.268 23003-23003/? I/crash_dump32: obtaining output fd from tombstoned, type: kDebuggerdTombstone 2021-03-16 23:51:25.269 711-711/? I//system/bin/tombstoned: received crash request for pid 22991 2021-03-16 23:51:25.271 23003-23003/? I/crash_dump32: performing dump of process 22948 (target tid = 22991) 2021-03-16 23:51:25.310 23003-23003/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 2021-03-16 23:51:25.310 23003-23003/? A/DEBUG: Build fingerprint: 'samsung/a10sub/a10s:10/QP1A.190711.020/A107MUBU5BTL3:user/release-keys' 2021-03-16 23:51:25.310 23003-23003/? A/DEBUG: Revision: '0' 2021-03-16 23:51:25.310 23003-23003/? A/DEBUG: ABI: 'arm' 2021-03-16 23:51:25.311 23003-23003/? A/DEBUG: Timestamp: 2021-03-16 23:51:25-0500 2021-03-16 23:51:25.311 23003-23003/? A/DEBUG: pid: 22948, tid: 22991, name: FEngine::loop >>> com.ribeirop.drumknee <<< 2021-03-16 23:51:25.311 23003-23003/? A/DEBUG: uid: 10213 2021-03-16 23:51:25.311 23003-23003/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xf41b1af4 2021-03-16 23:51:25.311 23003-23003/? A/DEBUG: r0 00000000 r1 d41b1000 r2 d4145800 r3 00000000 2021-03-16 23:51:25.312 23003-23003/? A/DEBUG: r4 00000000 r5 f41b0ffc r6 07ffffff r7 b677bb60 2021-03-16 23:51:25.312 23003-23003/? A/DEBUG: r8 b57ecaf8 r9 d41b1000 r10 b3481e08 r11 d422fb08 2021-03-16 23:51:25.312 23003-23003/? A/DEBUG: ip 80000000 sp b677b798 lr 00000000 pc c79fd6e0 2021-03-16 23:51:25.313 23003-23003/? A/DEBUG: backtrace: 2021-03-16 23:51:25.314 23003-23003/? A/DEBUG: #00 pc 0006d6e0 /vendor/lib/libusc.so (BuildId: ec6d8269f8f221da2cb0ede7e0024482) 2021-03-16 23:51:25.314 23003-23003/? A/DEBUG: #01 pc 0007cb71 /vendor/lib/libusc.so (BuildId: ec6d8269f8f221da2cb0ede7e0024482) 2021-03-16 23:51:25.314 23003-23003/? A/DEBUG: #02 pc 00073311 /vendor/lib/libusc.so (BuildId: ec6d8269f8f221da2cb0ede7e0024482) 2021-03-16 23:51:25.314 23003-23003/? A/DEBUG: #03 pc 00071d63 /vendor/lib/libusc.so (BuildId: ec6d8269f8f221da2cb0ede7e0024482) 2021-03-16 23:51:25.314 23003-23003/? A/DEBUG: #04 pc 00005873 /vendor/lib/libusc.so (PVRUniFlexCompileToHw+3186) (BuildId: ec6d8269f8f221da2cb0ede7e0024482) 2021-03-16 23:51:25.314 23003-23003/? A/DEBUG: #05 pc 00061ccb /vendor/lib/libglslcompiler.so (BuildId: 600709fa3200f50452062f5b736b41f3) 2021-03-16 23:51:25.314 23003-23003/? A/DEBUG: #06 pc 00070b8f /vendor/lib/libglslcompiler.so (GLSLCompileToUniflex+1718) (BuildId: 600709fa3200f50452062f5b736b41f3) 2021-03-16 23:51:25.314 23003-23003/? A/DEBUG: #07 pc 0004e20d /vendor/lib/egl/libGLESv2_mtk.so (BuildId: f9800c71c4892176d477a8334c20fef3) 2021-03-16 23:51:25.314 23003-23003/? A/DEBUG: #08 pc 0004defd /vendor/lib/egl/libGLESv2_mtk.so (BuildId: f9800c71c4892176d477a8334c20fef3) 2021-03-16 23:51:25.314 23003-23003/? A/DEBUG: #09 pc 0005d0c3 /vendor/lib/egl/libGLESv2_mtk.so (glCompileShader+74) (BuildId: f9800c71c4892176d477a8334c20fef3) 2021-03-16 23:51:25.315 23003-23003/? A/DEBUG: #10 pc 0009643f /data/app/com.ribeirop.drumknee-5ZEiTIUMbLRaY70sGbC_Bg==/lib/arm/libfilament-jni.so (BuildId: 11f810e802c95af1b10300672993d823ada35002) 2021-03-16 23:51:25.491 1126-1346/? D/PkgPredictorService-NapPreloadController: Sent booster pkg = [com.ribeirop.drumknee, com.google.android.filament.ibl] uid: 0 2021-03-16 23:51:25.492 1126-1346/? D/PkgPredictorService-NapPreloadController: Sent pkg = com.google.android.filament.ibl type: booster 2021-03-16 23:51:25.492 1126-1643/? D/ActivityManager: [ML] packageName : com.google.android.filament.ibl uid : 0 type : booster 2021-03-16 23:51:25.492 1126-1643/? D/ActivityManager: [ML] This Package is on the Memory 2021-03-16 23:51:25.492 1126-1152/? D/ActivityManager: update ML list: [com.ribeirop.drumknee, com.google.android.filament.ibl] uid:[0, 0] 2021-03-16 23:51:25.970 1434-1763/? D/NetworkController.MobileSignalController(0/2147483647): onSignalStrengthsChanged signalStrength=SignalStrength:{mCdma=Invalid,mGsm=Invalid,mWcdma=CellSignalStrengthWcdma: ss=-51 ber=99 rscp=-46 ecno=0 level=4,mTdscdma=Invalid,mLte=Invalid,mNr=Invalid,SignalBarInfo{ wcdmaLevel=4 },P,rat=3,primary=CellSignalStrengthWcdma} level=4 2021-03-16 23:51:25.971 1434-1763/? D/NetworkController.MobileSignalController(0/2147483647): getMobileIconGroup(): 0 2021-03-16 23:51:25.971 1434-1763/? D/NetworkController.MobileSignalController(0/2147483647): updateLTEMobileIconGroup(): 0

    opened by paulorrfilho 25
  • Crash on Android 31

    Crash on Android 31

    Describe the bug as the picture, the crash happens on Android 31.

    image

    and i found that, most of machines are use Mali-G57 gpu.

    image

    stack

    #00 pc 0000000000033b9c /apex/com.android.runtime/lib64/bionic/libc.so (abort+180) [arm64-v8a::f24f65acf653c409ca4332aced817a71]
    #01 pc 00000000000359fc /apex/com.android.runtime/lib64/bionic/libc.so [arm64-v8a::f24f65acf653c409ca4332aced817a71]
    #02 pc 00000000000981cc /apex/com.android.runtime/lib64/bionic/libc.so (_ZL8snprintfPcU17pass_object_size1mPKcz+92) [arm64-v8a::f24f65acf653c409ca4332aced817a71]
    #03 pc 000000000009800c /apex/com.android.runtime/lib64/bionic/libc.so (pthread_mutex_lock+172) [arm64-v8a::f24f65acf653c409ca4332aced817a71]
    #04 pc 000000000019c654 /vendor/lib64/egl/libGLES_mali.so [arm64-v8a::2ec4b9d18b1e23170000000000000000]
    #05 pc 0000000000114a14 /vendor/lib64/egl/libGLES_mali.so [arm64-v8a::2ec4b9d18b1e23170000000000000000]
    #06 pc 0000000000114f64 /vendor/lib64/egl/libGLES_mali.so [arm64-v8a::2ec4b9d18b1e23170000000000000000]
    #07 pc 00000000000aba20 /vendor/lib64/egl/libGLES_mali.so [arm64-v8a::2ec4b9d18b1e23170000000000000000]
    #08 pc 00000000000ab1a8 /vendor/lib64/egl/libGLES_mali.so [arm64-v8a::2ec4b9d18b1e23170000000000000000]
    #09 pc 00000000000a8fd0 /vendor/lib64/egl/libGLES_mali.so [arm64-v8a::2ec4b9d18b1e23170000000000000000]
    #10 pc 00000000000a8ef0 /vendor/lib64/egl/libGLES_mali.so [arm64-v8a::2ec4b9d18b1e23170000000000000000]
    #11 pc 0000000000049c04 /vendor/lib64/egl/libGLES_mali.so [arm64-v8a::2ec4b9d18b1e23170000000000000000]
    #12 pc 00000000000a50e0 /vendor/lib64/egl/libGLES_mali.so [arm64-v8a::2ec4b9d18b1e23170000000000000000]
    #13 pc 00000000000426b4 /vendor/lib64/egl/libGLES_mali.so [arm64-v8a::2ec4b9d18b1e23170000000000000000]
    #14 pc 000000000012bf24 /xxx/libfilament-jni.so [arm64-v8a::667b99daac804df245f21dede78652f3]
    

    I use addr2line command to translate 000000000012bf24 into _ZN8filament7backend18ConcreteDispatcherINS0_12OpenGLDriverEE4drawERNS0_6DriverEPNS0_11CommandBaseEPl

    are ther any suggestions?

    gpu specific 
    opened by August1996 5
  • ClearOptions explicit set attachments load & store action

    ClearOptions explicit set attachments load & store action

    Is your feature request related to a problem? Please describe.

        /**
         * ClearOptions are used at the beginning of a frame to clear or retain the SwapChain content.
         */
        struct ClearOptions {
            /** Color to use to clear the SwapChain */
            math::float4 clearColor = {};
            /**
             * Whether the SwapChain should be cleared using the clearColor. Use this if translucent
             * View will be drawn, for instance.
             */
            bool clear = false;
            /**
             * Whether the SwapChain content should be discarded. clear implies discard. Set this
             * to false (along with clear to false as well) if the SwapChain already has content that
             * needs to be preserved
             */
            bool discard = true;
        };
    

    Currently ClearOptions is missing properties such as clearDepth and clearStencil. Also clear and discard are not explicit enough for users.

    Describe the solution you'd like Add explicit properties to config attachments for render passes. For example.

        enum class LoadOp {
            DontCare,
            Clear,
            Load
        };
    
        enum class StoreOp {
            DontCare,
            Store,
        };
    
        /**
         * ClearOptions are used at the beginning of a frame to clear or retain the SwapChain content.
         */
        struct ClearOptions {
            /** Color to use to clear the SwapChain */
            math::float4 clearColor = {};// clear all the color attachments
            LoadOp colorLoadOp;
            StoreOp colorStoreOp;
    
            float clearDepth;
            LoadOp depthLoadOp;
            StoreOp depthStoreOp;
    
            uint32_t clearStencil;
            LoadOp stencilLoadOp;
            StoreOp stencilStoreOp;
        };
    

    Describe alternatives you've considered No.

    OS and backend No.

    opened by Michael-Lfx 4
  • material_sandbox crashes in release on Windows (1.23.2)

    material_sandbox crashes in release on Windows (1.23.2)

    Describe the bug material_sandbox crashes in release on Windows (tested on f88b6d9c9)

    To Reproduce Steps to reproduce the behavior:

    1. build material_sandbox on Windows in release
    2. open monkey.obj (filament\out>samples\Release\material_sandbox.exe ..\assets\models\monkey\monkey.obj)
    3. Access violation reading location 0xFFFFFFFFFFFFFFFF.

    Logs Out of the box there's no symbol in release (it would be nice to have them) but I think the crash happens in FView::prepare (as I have symbols in my own build). On my project I can work around the crash by #pragma disable("", off) in both Scene.cpp and View.cpp Edit: I tested the same workaround with material_sandbox which confirms it's very likely to be the same issue.

    Desktop

    • OS: Windows, VS2019, VS2022
    • GPU: NVIDIA GTX 1080
    • Backend: OpenGL

    Additional context Here's what the callstack looks like on my project if I disable optimizations only on Scene.cpp (I suspect the callstack in material_sandbox is similar). Disabling optimizations on Scene.cpp helps having a more detailed callstack. I think I also had this issue with 1.23.1, but not 1.23.0. Disabling optimizations on both Scene.cpp and View.cpp gets rid of the crash (which is obviously not a fix).

    utils::StructureOfArraysBase<utils::Arena<utils::HeapAllocator,utils::LockingPolicy::NoLock,utils::TrackingPolicy::Untracked,utils::AreaPolicy::HeapArea>,utils::EntityInstance<filament::RenderableManager,0>,filament::math::details::TMat44<float>,filament::FRenderableManager::Visibility,filament::FRenderableManager::SkinningBindingInfo,filament::FRenderableManager::MorphingBindingInfo,filament::math::details::TVec3<float>,unsigned short,unsigned char,unsigned short,unsigned char,filament::math::details::TVec3<float>,utils::Slice<filament::FRenderPrimitive,unsigned int>,unsigned int,filament::PerRenderableData,float>::swap'::`2'::<lambda_1>::operator()<filament::PerRenderableData *>(filament::PerRenderableData * p) Line 316	C++
    utils::StructureOfArraysBase<utils::Arena<utils::HeapAllocator,utils::LockingPolicy::NoLock,utils::TrackingPolicy::Untracked,utils::AreaPolicy::HeapArea>,utils::EntityInstance<filament::RenderableManager,0>,filament::math::details::TMat44<float>,filament::FRenderableManager::Visibility,filament::FRenderableManager::SkinningBindingInfo,filament::FRenderableManager::MorphingBindingInfo,filament::math::details::TVec3<float>,unsigned short,unsigned char,unsigned short,unsigned char,filament::math::details::TVec3<float>,utils::Slice<filament::FRenderPrimitive,unsigned int>,unsigned int,filament::PerRenderableData,float>::forEach<`utils::StructureOfArraysBase<utils::Arena<utils::HeapAllocator,utils::LockingPolicy::NoLock,utils::TrackingPolicy::Untracked,utils::AreaPolicy::HeapArea>,utils::EntityInstance<filament::RenderableManager,0>,filament::math::details::TMat44<float>,filament::FRenderableManager::Visibility,filament::FRenderableManager::SkinningBindingInfo,filament::FRenderableManager::MorphingBindingInfo,filament::math::details::TVec3<float>,unsigned short,unsigned char,unsigned short,unsigned char,filament::math::details::TVec3<float>,utils::Slice<filament::FRenderPrimitive,unsigned int>,unsigned int,filament::PerRenderableData,float>::swap'::`2'::<lambda_1>>(utils::StructureOfArraysBase<utils::Arena<utils::HeapAllocator,utils::LockingPolicy::NoLock,utils::TrackingPolicy::Untracked,utils::AreaPolicy::HeapArea>,utils::EntityInstance<filament::RenderableManager,0>,filament::math::details::TMat44<float>,filament::FRenderableManager::Visibility,filament::FRenderableManager::SkinningBindingInfo,filament::FRenderableManager::MorphingBindingInfo,filament::math::details::TVec3<float>,unsigned short,unsigned char,unsigned short,unsigned char,filament::math::details::TVec3<float>,utils::Slice<filament::FRenderPrimitive,unsigned int>,unsigned int,filament::PerRenderableData,float>::swap::__l2::<lambda_1> && f) Line 364	C++
    [Inline Frame] utils::StructureOfArraysBase<utils::Arena<utils::HeapAllocator,utils::LockingPolicy::NoLock,utils::TrackingPolicy::Untracked,utils::AreaPolicy::HeapArea>,utils::EntityInstance<filament::RenderableManager,0>,filament::math::details::TMat44<float>,filament::FRenderableManager::Visibility,filament::FRenderableManager::SkinningBindingInfo,filament::FRenderableManager::MorphingBindingInfo,filament::math::details::TVec3<float>,unsigned short,unsigned char,unsigned short,unsigned char,filament::math::details::TVec3<float>,utils::Slice<filament::FRenderPrimitive,unsigned int>,unsigned int,filament::PerRenderableData,float>::swap(unsigned __int64) Line 314	C++
    [Inline Frame] utils::swap(utils::StructureOfArraysBase<utils::Arena<utils::HeapAllocator,utils::LockingPolicy::NoLock,utils::TrackingPolicy::Untracked,utils::AreaPolicy::HeapArea>,utils::EntityInstance<filament::RenderableManager,0>,filament::math::details::TMat44<float>,filament::FRenderableManager::Visibility,filament::FRenderableManager::SkinningBindingInfo,filament::FRenderableManager::MorphingBindingInfo,filament::math::details::TVec3<float>,unsigned short,unsigned char,unsigned short,unsigned char,filament::math::details::TVec3<float>,utils::Slice<filament::FRenderPrimitive,unsigned int>,unsigned int,filament::PerRenderableData,float>::StructureRef) Line 89	C++
    [Inline Frame] std::iter_swap(utils::StructureOfArraysBase<utils::Arena<utils::HeapAllocator,utils::LockingPolicy::NoLock,utils::TrackingPolicy::Untracked,utils::AreaPolicy::HeapArea>,utils::EntityInstance<filament::RenderableManager,0>,filament::math::details::TMat44<float>,filament::FRenderableManager::Visibility,filament::FRenderableManager::SkinningBindingInfo,filament::FRenderableManager::MorphingBindingInfo,filament::math::details::TVec3<float>,unsigned short,unsigned char,unsigned short,unsigned char,filament::math::details::TVec3<float>,utils::Slice<filament::FRenderPrimitive,unsigned int>,unsigned int,filament::PerRenderableData,float>::Iterator<utils::StructureOfArraysBase<utils::Arena<utils::HeapAllocator,utils::LockingPolicy::NoLock,utils::TrackingPolicy::Untracked,utils::AreaPolicy::HeapArea>,utils::EntityInstance<filament::RenderableManager,0>,filament::math::details::TMat44<float>,filament::FRenderableManager::Visibility,filament::FRenderableManager::SkinningBindingInfo,filament::FRenderableManager::MorphingBindingInfo,filament::math::details::TVec3<float>,unsigned short,unsigned char,unsigned short,unsigned char,filament::math::details::TVec3<float>,utils::Slice<filament::FRenderPrimitive,unsigned int>,unsigned int,filament::PerRenderableData,float> *>) Line 78	C++
    [Inline Frame] std::partition(utils::StructureOfArraysBase<utils::Arena<utils::HeapAllocator,utils::LockingPolicy::NoLock,utils::TrackingPolicy::Untracked,utils::AreaPolicy::HeapArea>,utils::EntityInstance<filament::RenderableManager,0>,filament::math::details::TMat44<float>,filament::FRenderableManager::Visibility,filament::FRenderableManager::SkinningBindingInfo,filament::FRenderableManager::MorphingBindingInfo,filament::math::details::TVec3<float>,unsigned short,unsigned char,unsigned short,unsigned char,filament::math::details::TVec3<float>,utils::Slice<filament::FRenderPrimitive,unsigned int>,unsigned int,filament::PerRenderableData,float>::Iterator<utils::StructureOfArraysBase<utils::Arena<utils::HeapAllocator,utils::LockingPolicy::NoLock,utils::TrackingPolicy::Untracked,utils::AreaPolicy::HeapArea>,utils::EntityInstance<filament::RenderableManager,0>,filament::math::details::TMat44<float>,filament::FRenderableManager::Visibility,filament::FRenderableManager::SkinningBindingInfo,filament::FRenderableManager::MorphingBindingInfo,filament::math::details::TVec3<float>,unsigned short,unsigned char,unsigned short,unsigned char,filament::math::details::TVec3<float>,utils::Slice<filament::FRenderPrimitive,unsigned int>,unsigned int,filament::PerRenderableData,float> *>) Line 5154	C++
    filament::FView::partition(utils::StructureOfArraysBase<utils::Arena<utils::HeapAllocator,utils::LockingPolicy::NoLock,utils::TrackingPolicy::Untracked,utils::AreaPolicy::HeapArea>,utils::EntityInstance<filament::RenderableManager,0>,filament::math::details::TMat44<float>,filament::FRenderableManager::Visibility,filament::FRenderableManager::SkinningBindingInfo,filament::FRenderableManager::MorphingBindingInfo,filament::math::details::TVec3<float>,unsigned short,unsigned char,unsigned short,unsigned char,filament::math::details::TVec3<float>,utils::Slice<filament::FRenderPrimitive,unsigned int>,unsigned int,filament::PerRenderableData,float>::Iterator<utils::StructureOfArraysBase<utils::Arena<utils::HeapAllocator,utils::LockingPolicy::NoLock,utils::TrackingPolicy::Untracked,utils::AreaPolicy::HeapArea>,utils::EntityInstance<filament::RenderableManager,0>,filament::math::details::TMat44<float>,filament::FRenderableManager::Visibility,filament::FRenderableManager::SkinningBindingInfo,filament::FRenderableManager::MorphingBindingInfo,filament::math::details::TVec3<float>,unsigned short,unsigned char,unsigned short,unsigned char,filament::math::details::TVec3<float>,utils::Slice<filament::FRenderPrimitive,unsigned int>,unsigned int,filament::PerRenderableData,float> *> begin, utils::StructureOfArraysBase<utils::Arena<utils::HeapAllocator,utils::LockingPolicy::NoLock,utils::TrackingPolicy::Untracked,utils::AreaPolicy::HeapArea>,utils::EntityInstance<filament::RenderableManager,0>,filament::math::details::TMat44<float>,filament::FRenderableManager::Visibility,filament::FRenderableManager::SkinningBindingInfo,filament::FRenderableManager::MorphingBindingInfo,filament::math::details::TVec3<float>,unsigned short,unsigned char,unsigned short,unsigned char,filament::math::details::TVec3<float>,utils::Slice<filament::FRenderPrimitive,unsigned int>,unsigned int,filament::PerRenderableData,float>::Iterator<utils::StructureOfArraysBase<utils::Arena<utils::HeapAllocator,utils::LockingPolicy::NoLock,utils::TrackingPolicy::Untracked,utils::AreaPolicy::HeapArea>,utils::EntityInstance<filament::RenderableManager,0>,filament::math::details::TMat44<float>,filament::FRenderableManager::Visibility,filament::FRenderableManager::SkinningBindingInfo,filament::FRenderableManager::MorphingBindingInfo,filament::math::details::TVec3<float>,unsigned short,unsigned char,unsigned short,unsigned char,filament::math::details::TVec3<float>,utils::Slice<filament::FRenderPrimitive,unsigned int>,unsigned int,filament::PerRenderableData,float> *> end, unsigned char mask) Line 642	C++
    filament::FView::prepare(filament::FEngine & engine, filament::backend::CommandStream & driver, utils::ArenaScope<utils::Arena<utils::LinearAllocator,utils::LockingPolicy::NoLock,utils::TrackingPolicy::Untracked,utils::AreaPolicy::HeapArea>> & arena, const filament::Viewport & viewport, const filament::CameraInfo & cameraInfo, const filament::math::details::TVec4<float> & userTime, bool needsAlphaChannel) Line 535	C++
    
    
    opened by teub 1
  • assert fails in HwRenderPrimitiveFactory ctor

    assert fails in HwRenderPrimitiveFactory ctor

    Describe the bug Updating to the latest version of filament (1.23.2), I get a failed assert in in HwRenderPrimitiveFactory() in debug and a crash later in release which I suspect is related to that assert.

    To Reproduce Just create the engine with filament::Engine::create(filament::Engine::Backend::OPENGL). This is possibly a problem specific to visual studio ? See the notes below.

    Desktop (please complete the following information):

    • OS: Windows, VS 2022
    • Backend: OpenGL

    Additional context

    The assert that fails is in debug, and I have a crash later in release which I suspect is related to this assert. See at the bottom for the callstack of the assert. I suspect this is related to commit 7aa3b1a6eef7749059541d904ae0993daa445263 "merge identical backend RenderPrimitives together".

    Indeed in filament/src/HwRenderPrimitiveFactory.h I see this:

        // the std::set<T> node size is sizeof(std::set<T>::node_type) + sizeof(T), aligned.
        // we need this value for our pool allocator. On clang 64 bits this is 56 bytes.
    

    The assert that fails is "assert(size <= ELEMENT_SIZE);" in libs\utils\include\utils\Allocator.h, with size = 56 and I suspect ELEMENT_SIZE is 48 (and not 56). Isn't this related to the size of DummySetNode ? I'm not sure I understand all the template code yet.

    Callstack:

    utils::PoolAllocator<48,8,0,utils::FreeList>::alloc(unsigned __int64 size, unsigned __int64 alignment, unsigned __int64 offset) Line 332	C++
    utils::Arena<utils::PoolAllocator<48,8,0,utils::FreeList>,utils::LockingPolicy::NoLock,utils::TrackingPolicy::HighWatermark,utils::AreaPolicy::HeapArea>::alloc(unsigned __int64 size, unsigned __int64 alignment, unsigned __int64 extra) Line 588	C++
    >	utils::STLAllocator<std::_Tree_node<filament::HwRenderPrimitiveFactory::Entry,void *>,utils::Arena<utils::PoolAllocator<48,8,0,utils::FreeList>,utils::LockingPolicy::NoLock,utils::TrackingPolicy::HighWatermark,utils::AreaPolicy::HeapArea>>::allocate(unsigned __int64 n) Line 804	C++
    [External Code]	
    filament::HwRenderPrimitiveFactory::HwRenderPrimitiveFactory() Line 66	C++
    filament::FRenderableManager::FRenderableManager(filament::FEngine & engine) Line 311	C++
    
    windows 
    opened by teub 4
  • Renderer.getUserTime() is in nanoseconds on Android

    Renderer.getUserTime() is in nanoseconds on Android

    Looks like Renderer.getUserTime() on Android returns nanoseconds, but documentation says

    Returns a timestamp (in seconds) for the last call to beginFrame. Renderer.java

    Logs 19:58:52.468 ftn = 37074714295018 (37074.714295018 * 1e9), getUserTime() = 4.11718346E8 (0.411729615 * 1e9) 19:58:52.472 ftn = 37074722357826 (37074.722357826 * 1e9), getUserTime() = 4.15509346E8 (0.415516192 * 1e9) 19:58:52.564 ftn = 37074814580522 (37074.814580522 * 1e9), getUserTime() = 5.07590422E8 (0.507597346 * 1e9) 19:58:52.581 ftn = 37074831171449 (37074.831171449 * 1e9), getUserTime() = 5.24623846E8 (0.524630615 * 1e9) 19:58:52.598 ftn = 37074847760901 (37074.847760901 * 1e9), getUserTime() = 5.41059653E8 (0.541065961 * 1e9) 19:58:52.623 ftn = 37074872689244 (37074.872689244 * 1e9), getUserTime() = 5.66792307E8 (0.566798807 * 1e9) 19:58:52.648 ftn = 37074897674148 (37074.897674148 * 1e9), getUserTime() = 5.91162269E8 (0.591168961 * 1e9) 19:58:52.665 ftn = 37074914315643 (37074.914315643 * 1e9), getUserTime() = 6.08559307E8 (0.608565999 * 1e9) 19:58:52.683 ftn = 37074930998583 (37074.930998583 * 1e9), getUserTime() = 6.26575499E8 (0.62658873 * 1e9) 19:58:52.707 ftn = 37074955986300 (37074.9559863 * 1e9), getUserTime() = 6.50506692E8 (0.65051323 * 1e9) 19:58:52.750 ftn = 37074997694666 (37074.997694666 * 1e9), getUserTime() = 6.93165576E8 (0.693172653 * 1e9)

    where ftn is frameTimeNanos passed to Renderer.beginFrame().

    Context

    • Filament 1.23.1
    • Device: Samsung Galaxy S21
    • OS: Android 12
    opened by sdpopov-keyvariable 0
  • Conflict with glibc 2.35+ macro.

    Conflict with glibc 2.35+ macro.

    Build error due to conflict with glibc 2.35 macros

    filament/libs/image/src/ImageSampler.cpp:41:17: error: expected unqualified-id
    constexpr float M_PIf = float(filament::math::F_PI);
                    ^
    /usr/include/math.h:1168:17: note: expanded from macro 'M_PIf'
    # define M_PIf          3.14159265358979323846f /* pi */
                            ^
    1 error generated.
    

    conflict is caused by recently added macros in glibc 2.35, is there a way around this issue ? since downgrading glibc doesn't seems to be a good idea.

    To Reproduce run filament build.sh script, on clang-13 and glibc 2.35+

    Expected behavior filament release build for android and desktop

    Logs

    [23/1345] Building CXX object libs/image/CMakeFiles/image.dir/src/ImageSampler.cpp.o
    FAILED: libs/image/CMakeFiles/image.dir/src/ImageSampler.cpp.o 
    /usr/bin/clang++ -DFILAMENT_DRIVER_SUPPORTS_VULKAN -DFILAMENT_SUPPORTS_OPENGL -DFILAMENT_SUPPORTS_X11 -DFILAMENT_SUPPORTS_XCB -DFILAMENT_SUPPORTS_XLIB -I/home/machine/workspace/ar/filament/libs/image/include -I/home/machine/workspace/ar/filament/libs/math/include -I/home/machine/workspace/ar/filament/libs/utils/include -I/home/machine/workspace/ar/filament/third_party/robin-map/tnt/.. -stdlib=libc++ -std=c++17 -fstrict-aliasing -Wno-unknown-pragmas -Wno-unused-function -Wno-deprecated-declarations -stdlib=libc++ -fPIC -fcolor-diagnostics -fvisibility=hidden -O3 -DNDEBUG -fomit-frame-pointer -ffunction-sections -fdata-sections -ffast-math -Wno-deprecated-register -MD -MT libs/image/CMakeFiles/image.dir/src/ImageSampler.cpp.o -MF libs/image/CMakeFiles/image.dir/src/ImageSampler.cpp.o.d -o libs/image/CMakeFiles/image.dir/src/ImageSampler.cpp.o -c /home/machine/workspace/ar/filament/libs/image/src/ImageSampler.cpp
    /home/machine/workspace/ar/filament/libs/image/src/ImageSampler.cpp:41:17: error: expected unqualified-id
    constexpr float M_PIf = float(filament::math::F_PI);
                    ^
    /usr/include/math.h:1168:17: note: expanded from macro 'M_PIf'
    # define M_PIf          3.14159265358979323846f /* pi */
                            ^
    1 error generated.
    [32/1345] Building CXX object third_party/libgtest/tnt/CMakeFiles/gtest.dir/__/googletest/src/gtest-all.cc.o
    ninja: build stopped: subcommand failed.
    
    

    Desktop

    • OS: Manjaro Linux
    • GPU: NVIDIA GTX 1650
    opened by GokulDas027 1
Releases(v1.23.2)
Owner
Google
Google ❤️ Open Source
Google
An easy to build CO2 Monitor/Meter with Android and iOS App for real time visualization and charting of air data, data logger, a variety of communication options (BLE, WIFI, MQTT, ESP-Now) and many supported sensors.

CO2-Gadget An easy to build CO2 Monitor/Meter with cell phone App for real time visualization and charting of air data, datalogger, a variety of commu

Mariete 19 Jun 23, 2022
Oxygine is C++ engine and framework for 2D games on iOS, Android, Windows, Linux and Mac

BUILD AND RUN See oxygine-framework/readme/ folder. It has instructions on how to build and run oxygine on different platforms. Wiki available at http

Oxygine 728 Jun 17, 2022
An efficient, small mobile key-value storage framework developed by WeChat. Works on Android, iOS, macOS, Windows, and POSIX.

中文版本请参看这里 MMKV is an efficient, small, easy-to-use mobile key-value storage framework used in the WeChat application. It's currently available on Andr

Tencent 14.7k Jun 27, 2022
A cross-platform (Android/iOS/Windows/macOS) cronet plugin for Flutter via `dart:ffi`

cronet_flutter A cross-platform (Android/iOS/Windows/macOS) cronet plugin for Flutter via dart:ffi

null 20 Jun 15, 2022
Firmware, mechanical and electrical design files for the Inline Filament Diameter Estimator, Lowcost (InFiDEL).

Inline Filament Diameter Estimator, Lowcost (InFiDEL) Originally created by Thomas Sanladerer A cheap, yet precise filament diameter sensor, intended

Daniel Smullen 88 Jun 14, 2022
Sega Master System / Game Gear / SG-1000 emulator for iOS, macOS, Raspberry Pi, Windows, Linux, BSD and RetroArch.

Gearsystem is a very accurate, cross-platform Sega Master System / Game Gear / SG-1000 emulator written in C++ that runs on Windows, macOS, Linux, BSD, iOS, Raspberry Pi and RetroArch.

Ignacio Sanchez Gines 161 Jun 22, 2022
Signed - a 3D modeling and construction language based on Lua and SDFs. Signed will be available for macOS and iOS and is heavily optimized for Metal.

Signed - A 3D modeling language Abstract Signed is a Lua based 3D modeling language, it provides a unique way to create high quality 3D content for yo

Markus Moenig 88 May 26, 2022
MTEngineSDL is a SDL2+ImGui engine for macOS, Linux and MS Windows.

Hello and welcome to the MTEngineSDL! This is an application host framework for starting custom apps created using SDL2, ImGui and OpenGL. How to comp

null 3 Jan 10, 2022
Real-Time Rendering with Lighting Grid Hierarchy I3D 2019 Demo

Real-Time Rendering with Lighting Grid Hierarchy I3D 2019 Demo Daqi Lin This demo is for the I3D 2019 paper Real-Time Rendering with Lighting Grid Hie

Lin Daqi 108 Jun 27, 2022
An implementation of physically based shading & image based lighting in D3D11, D3D12, Vulkan, and OpenGL 4.

Physically Based Rendering (c) 2017 - 2018 Michał Siejak (@Nadrin) An implementation of physically based shading model & image based lighting in vario

Michał Siejak 995 Jun 10, 2022
Improved version of real-time physics engine that couples FEM-based deformables and rigid body dynamics

Enhanced version of coupled FEM and constrained rigid body simulation Description This little playground aimed to test our Conjugate Gradients based M

Andrey Voroshilov 25 Apr 11, 2022
Macos-arm64-emulation - A guide for emulating macOS arm64e on an x86-based host.

macos-arm64-emulation Use the following guide to download and configure all of the necessary tools and files for emulating the macOS arm64e kernel. Th

Cylance 216 Jun 23, 2022
Light probe generation and BRDF authoring for physically based shading.

IBLBaker About IBLBaker is provided under the MIT License(MIT) Copyright(c) 2015 Matt Davidson. Please see the LICENSE file for full details. Feel fre

MattD 633 Jun 23, 2022
Physically-based GPU and CPU ray-tracer emerging on a surface

etx-tracer Physically-based GPU and CPU ray-tracer emerging on a surface. Features Vertex Connection and Merging algorithm (CPU and GPU); Full-spectra

Serhii Rieznik 215 Jun 22, 2022
Utility to install kexts, Frameworks and PrivateFrameworks in the System of macOS. For macOS Monterey 12 and Big Sur 11

Command-Line-SnapShot-Mounter Credit: chris1111 Apple This utility uses the macOS terminal Command Line SnapShot Mounter is an utility that allows you

chris1111 18 May 24, 2022
Updates the Wii's current system time with the real world time.

Fix Wii System Time This is a homebrew tool I made for the Wii a while ago. It updates the current system time with the real world time via worldtimea

Puzzle 2 Dec 21, 2021
🗺️ OMAPS.APP — Offline OpenStreetMap maps for iOS and Android. A community-driven fork of MAPS.ME.

OMaps is an open source cross-platform offline maps application, built on top of crowd-sourced OpenStreetMap data. It was publicly released for iOS and Android.

OMaps 3.5k Jun 26, 2022
A beginner friendly desktop UI for Tasmota flashed devices for Windows, macOS and Linux.

TasmoManager A beginner friendly desktop UI for Tasmota flashed devices for Windows, macOS and Linux. Features Native Tasmota device discovery (via ta

Tom Butcher 43 Jun 16, 2022