Google Filament: Difference between revisions

From David's Wiki
Created page with "Notes on using [Filament](https://github.com/google/filament), the rendering engine for many Google applications. Note that Filament is not a replacement for Unity or Godot. ==Types== ==Materials== In filament, shaders are written as materials. The documentation for materials is available at https://google.github.io/filament/Materials.html ===Vertex shader=== Unlike standard OpenGL shaders, you cannot output arbitrary positions in the vertex shader. You can: 1. Mod..."
 
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
Notes on using [Filament](https://github.com/google/filament), the rendering engine for many Google applications.
Notes on using [https://github.com/google/filament Filament], the rendering engine for many Google applications.


Note that Filament is not a replacement for Unity or Godot.
Note that Filament is not a replacement for Unity or Godot.
Line 19: Line 19:


===Fragment shader===
===Fragment shader===
The fragment shader expects the output to be in premultiplied alpha.

Latest revision as of 04:33, 12 March 2025

Notes on using Filament, the rendering engine for many Google applications.

Note that Filament is not a replacement for Unity or Godot.

Types

Materials

In filament, shaders are written as materials. The documentation for materials is available at https://google.github.io/filament/Materials.html

Vertex shader

Unlike standard OpenGL shaders, you cannot output arbitrary positions in the vertex shader.

You can: 1. Modify the world position of the vertices. 2. Send interpolants, aka varyings, to the pixel shader. 3. Use a custom 4x4 matrix to transform coordinates from local to clip space.

Fragment shader

The fragment shader expects the output to be in premultiplied alpha.