Compare commits

..

111 Commits

Author SHA1 Message Date
Benjamin Doherty
8ed10d77de Begin to refactor test_LoadImage to use SharedShaders 2025-08-12 17:39:26 -04:00
Ben Doherty
e8e99a0de6 Fix: webgpu error regarding mismatched pipeline (#9056) 2025-08-11 17:30:07 -04:00
Ben Doherty
6630aa5f36 matp: Remove accidental switch fallthrough (#9082) 2025-08-11 17:26:46 -04:00
Powei Feng
bc83ffdcd1 vk: make default render target independent of call order (#9065) 2025-08-11 20:27:53 +00:00
Powei Feng
c21f211a13 Update java for Texture::Usage (#9055)
Also update samples and utils to use proper usage when
generating mipmaps.
2025-08-11 19:47:26 +00:00
Patrik Huber
58d4671c24 Fixes to frame_generator sample (#9050)
* [Fix] frame_generator sample: open ifstream with ios::binary
* [Fix] frame_generator sample: allocate storage for g_materialBuffer
   reserve() merely reserves memory, but does not actually change the size of the vector.
* [Fix] frame_generator sample: destroy materials/renderables during cleanup

Otherwise the sample crashes with a Filament error saying that the material is still associated with a renderable.
2025-08-11 19:21:05 +00:00
Mathias Agopian
93caca7245 fig materialparser assert when shader is not present 2025-08-11 11:11:42 -07:00
Mathias Agopian
bf77c023b9 correctly set STENCIL Usage on color pass texture
the framegraph didn't set the Usage::Stencil on textures it created
for the color pass if stencil was requested. On the GL backend it
didn't matter because that bit is unused.
2025-08-11 11:11:22 -07:00
yein
95128d5f55 Follow up of material parser PR (#9029)
- Fix CMakeLists to correctly include src files in matp test
- Replace std::string to std::string_view
- Also update the test_includer.cpp
2025-08-11 18:05:10 +00:00
Powei Feng
6d17d858de vk: Fix bad layouts/formats when doing generateMipmaps (#9058)
- After genMipmap, transition to shader read layout
- Ensure that the staging image format is TRANSFER_SRC.
2025-08-11 17:49:15 +00:00
Sungun Park
05003ea358 mat: Add CRC32 validation for material packages (#9053)
This commit introduces a CRC32 checksum to material packages to ensure
data integrity.

When a material is loaded, this checksum is verified. If the check
fails, an error is logged, and the material fails to load. For older
material packages without a CRC32 checksum, a warning is logged and
proceed.

BUGS=[373396840]
2025-08-09 00:03:56 +00:00
Matthew Hoffman
98847d6509 Simplify backend tests' EXPECT_IMAGE invocation. (#9052) 2025-08-08 21:55:37 +00:00
Mathias Agopian
d3828cdd1c fix the 3-parameters fresnel calculation
it would automatically degrade to the 2-parameters version in 
LOW_QUALITY mode, but some other code relied on the proper calculation,
in particular when specularFactor was used.


FIXES=[436866605]
2025-08-08 14:18:15 -07:00
Andy Hovingh
4beda6feee wgpu: fix Android build error 2025-08-08 15:32:18 -05:00
Juan Caldas
7cacef9509 Update GLSL for mip test (#9064) 2025-08-08 15:09:27 -04:00
Juan Caldas
5cd7de7318 Change fogReserved 2025-08-08 10:44:54 -07:00
Sungun Park
9c87e72a81 Correct warning message (#9059)
The subsequent call

`glGetShaderiv(shader, GL_COMPILE_STATUS, &status);`

will ensure the compilation is complete.
2025-08-07 22:35:26 -07:00
Filament Bot
652d973ad8 [automated] Updating /docs due to commit 8466177
Full commit hash is 84661777e7

DOCS_ALLOW_DIRECT_EDITS
2025-08-07 22:52:23 +00:00
Ben Doherty
84661777e7 Materials: add useDefaultDepthVariant flag (#9020) 2025-08-07 22:49:05 +00:00
Powei Feng
c8ab2f335e Fix places where generateMipmaps is called without proper usage (#9054) 2025-08-07 22:24:40 +00:00
Mathias Agopian
db14efc151 compress the DFG LUT with zstd
- use resgen to package the DFG LUT into filament, instead of using
  a large include of a C array.

- add a zstd compression step, which reduces the size from ~100KB to
  ~75KB.

The overhead of zstd is about 90KB uncompressed, however it will pay
for itself tenfold when we use it to compress material packages.
2025-08-07 14:58:18 -07:00
Mathias Agopian
d1ca059dad resgen: add compression options
- with `-z` each resource is compressed individually
- with `-Z` the whole package is compressed
2025-08-07 14:58:18 -07:00
Mathias Agopian
c71a22914f small improvements to cmgen
- when generating the DFG LUT as a text file, make sure to faithfully
  reproduce the command used in the comments

- add a "bin" format that will output a headerless raw binary of the
  LUT data.
2025-08-07 14:58:18 -07:00
Mathias Agopian
71d0723026 add zstd to the build 2025-08-07 14:58:18 -07:00
Powei Feng
5c371089f2 Add GEN_MIPMAPPABLE TextureUsage (#9042)
This will allow for more backend-specific usage mapping then before - where BLIT_SRC and BLIT_DST are assumed for textures whose mipmaps will be generated.

These mappings have been introduced in metal, vulkan, webgpu.
2025-08-07 18:14:49 +00:00
Konrad Piascik
2c7064e93d webgpu: skip PushConstants backend test for webgpu
We can revert this once dawn supports push constants
2025-08-07 11:07:02 -04:00
Filament Bot
3961989aca [automated] Updating /docs due to commit b92af35
Full commit hash is b92af357f7

DOCS_ALLOW_DIRECT_EDITS
2025-08-07 08:36:16 +00:00
Mathias Agopian
b92af357f7 add a material option to use linear fog calculations (#9030)
The new `linearFog` material property, when set to `true` enables a
simplified fog calculation. The fog equation becomes linear which is
unrealistic, but more efficient to compute. In some situations with
a shallow fog range, it doesn't make a huge difference visually.

In this mode, height falloff and in-scattering are ignored.

The linear equation slope is calculated from the regular parameters to
match the slope of the real equation at a camera height. If 
`heightFalloff` is disabled, set to 0, the `density` parameter 
exactly corresponds to the slope of the equation in [1/m] units.
2025-08-07 01:33:36 -07:00
Mathias Agopian
f2a1051df9 add CanonicalizePass optimization
this makes all spirv IDs much more stable which greatly improve the
utilization of the line dictionary.
2025-08-07 01:32:31 -07:00
Mathias Agopian
594ab3e9e3 spirv-tools update to vulkan-sdk-1.4.321.0 2025-08-07 01:32:31 -07:00
Mathias Agopian
7f18c7fd43 fix -d (matdbg) build option
There was two problems:
- tint was needed regardless of webgpu support
- libfilamat wasn't built on the android side
  (I don't know how it ever worked)
2025-08-06 17:29:51 -07:00
Powei Feng
9c1a252ba5 Fix two compilation errors (#9041)
- Include <limits> in bitset.h
- The type could not be inferred for Scene.cpp's `SharedState`
  line.  The failure came from clang version 1:14.0-55~exp2
2025-08-06 22:22:40 +00:00
Juan Caldas
bf8e798b60 webgpu: Set Layercount to 1 instead of 0 (#9038)
part of BUGS = [424157731]
2025-08-06 22:00:25 +00:00
Eliza Velasquez
b94e90416a Fix build breakage 2025-08-06 14:33:53 -07:00
Andy Hovingh
e9fde8346e wgpu: fix test seg fault due to null descriptor set layout label 2025-08-06 16:31:44 -05:00
Andy Hovingh
3ae747b544 wgpu: remove assumption default render target is present in makeCurrent(...) 2025-08-06 16:31:44 -05:00
Eliza
5924633085 gl: amortize shader compilation over N frames (#8964)
* gl: amortize shader compilation over N frames

On platforms which don't support parallel shader compilation (e.g. Firefox), we
can sort of emulate it by queueing up any requests to `Material::compile()` and
compiling each shader over multiple frames.

Compiling over consecutive frames slows things quite noticeably. Instead, space
each compilation over a number of ticks (16 chosen arbitrarily).

If we need a program NOW, we can bump a program queued for much later to the
front. We also avoid compiling any queued programs on this same frame to limit
stuttering.

* gl: add flag to disable amortized shader compile

If this flag is on, the new amortized compile code should theoretically never be
executed.

* gl: add CompilerPriorityQueue docs, Java API

* gl: amortize shaders, z3moon feedback

* gl: update CompilerThreadPool
2025-08-06 21:09:27 +00:00
Juan Caldas
a07c19e5b7 Add missing WebGPU checks (#9037)
part of BUGS = [424157731]
2025-08-06 16:18:18 -04:00
Filament Bot
59f4d1ba20 [automated] Updating /docs due to commit ac076e8
Full commit hash is ac076e872e

DOCS_ALLOW_DIRECT_EDITS
2025-08-06 06:03:06 +00:00
Powei Feng
ac076e872e Release Filament 1.63.0 2025-08-05 22:59:34 -07:00
Matthew Hoffman
9e55331801 Backend tests using webgpu (#8823)
BUGS = [424157731]
2025-08-06 00:19:13 +00:00
Powei Feng
f70a11ced4 Feature flag guard compat check of material instance and desc-set (#9035)
This will allow clients more time to correct their code.
2025-08-05 16:34:53 -07:00
Andy Hovingh
455545f024 wgpu: fix ssao bent normals 2025-08-05 16:35:25 -05:00
Andy Hovingh
f35ec42125 bilateral blur & shadow map materials require unfilterable samplers
This fixes the Display Shader Texture with the WebGPU implementation.
2025-08-05 16:05:07 -05:00
Powei Feng
4242bc43fd utils: add precond/postcond macro guarded by feature flags
We link the behavior of certain precondition/postcondition checks to feature flag states.

- If provided *flag* is true, then this macro will assert when the *condition* is false.
- If provided *flag* is fase, then this macro will output a warning when the condition is false.
- If the condition is true, then neither of the above will happen

These two macros will enable us to provide less restrictive behavior for certain correctness assertions, allowing clients to modify their before enabling these assertions by default.
2025-08-05 20:48:13 +00:00
Mathias Agopian
bbe6d35bf2 fix typo in gtao material 2025-08-05 12:59:24 -07:00
Andy Hovingh
c8894521c8 webgpu: add visibility for debugging bind groups via logging (compile-time flag option) 2025-08-05 12:42:40 -05:00
Ben Doherty
a2475b5dcb Use default descriptor set for shared material variants (#9025) 2025-08-04 10:27:05 -07:00
Andy Hovingh
b7b89168a7 webgpu: support depth in blit + copy when we can. 2025-08-04 10:02:09 -05:00
Powei Feng
79551eacb2 Update MATERIAL_VERSION to 63 2025-08-03 22:56:09 -07:00
Powei Feng
e181c74b6c Fix matp test typo 2025-08-01 16:27:35 -07:00
Powei Feng
418704dbb1 Test matp instead matc 2025-08-01 16:25:41 -07:00
Yein Jo
eeb4fe219b Restore test files and moved to matp 2025-08-01 15:57:23 -07:00
Yein Jo
7d227630fc fix max line 2025-08-01 15:57:23 -07:00
Yein Jo
d84e42861c Fix includes 2025-08-01 15:57:23 -07:00
Yein Jo
3a75dc6d2d Move some classes to private 2025-08-01 15:57:23 -07:00
Yein Jo
66b67849af Extract material parse logic to filament-matp 2025-08-01 15:57:23 -07:00
Powei Feng
ba5900efcf webgpu: descriptor set unbind on null handle 2025-08-01 14:42:58 -07:00
Powei Feng
2d518b5fd1 ppm: ensure a renderable descriptor set is bound
- We set a dummy set at the renderable bind point for
   post-processing passes, since it is not used.
2025-08-01 14:42:58 -07:00
Mathias Agopian
ee8d0e6ebf remove fake dependencies on the PER_VIEW UBO
The PER_VIEW UBO was updated by different render passes at different
times, which created synchronizations on the GPU, between unrelated
passes and prevented the vertex shader to run on parallel with another
pass for instance.

In the PR, we fix this by moving ALL the UBO set-up outside of 
render passes. It's now done early, just before creating the framegraph.

The PER_VIEW UBO is shared between several passes, themselves using
different descriptor sets; so we need to make sure all the data
necessary for these passes is computed and set in the UBO (e.g. SSR
passes).

The passes themselves (like the color pass) still set the textures and
UBOs in their descriptor sets, but then no longer updated the content
of the UBO itself.

In this PR we also remove some "fake" dependencies between passes due
to descriptor sets straddling between passes. This is done by unbinding
all descriptor sets at the end of each pass. The PER_MATERIAL descriptor
set is a bit special because it should be unbound between full screen
quads draws.

Additionally, there some places in the code attempting to update
UBOs only when the content was dirty were missing a "clean" call, to
reset the dirty bit to the unset state.

The main change here is to move the code that set the UBO content out
of the ColorPassDescriptorSet (and a few other) into View and instead of
updating the content in the color pass (and a few other), do that at
the beginning of Renderer::render().
2025-08-01 14:01:17 -07:00
Mathias Agopian
b4c9b9f489 renderStandaloneView() needs a driver and engine flush 2025-07-31 12:10:23 -07:00
Mathias Agopian
e59972b41f unbind descriptor-sets after renderpasses
this prevents a false dependency with the next pass and keeps us
honest about what resources we're using.
2025-07-31 12:10:06 -07:00
Powei Feng
5fb9fad3ce vk: fix broken iblprefilter path (#9019)
The issue is that we need to reset the bound info in
VulkanDescriptorSetCache when the current command buffer completes
recording.
2025-07-31 10:45:34 -07:00
Filament Bot
44bbab158b [automated] Updating /docs due to commit bbced6d
Full commit hash is bbced6d59d

DOCS_ALLOW_DIRECT_EDITS
2025-07-31 17:31:35 +00:00
Benjamin Doherty
bbced6d59d Release Filament 1.62.2 2025-07-31 10:27:23 -07:00
Doris Wu
433fded025 Workaround the skybox issue on webgl build (#8974) (BUGS=419664914)
* duplicate the material instance in webgl

* Use default instance

* Update comments

* Update

* Address the comments

* Update the naming
2025-07-31 01:56:07 +00:00
Sungun Park
86d19e53ea gl: Cleanup code flow in ShaderCompilerService (#9014) 2025-07-31 01:02:24 +00:00
Mathias Agopian
70d41664b5 Add Renderer::shouldRenderFrame() API
FIXES=[410463814]
2025-07-30 15:32:23 -07:00
Juan Caldas
08c783e05f Pass extent for non headless 2025-07-30 13:03:33 -05:00
Ben Doherty
ce5c6e3aec Fix incorrect buffer size and memory free issue with prefilter mipmap (#9009) 2025-07-30 10:31:41 -07:00
Juan Caldas
2e6ac18d03 webgpu: support blit 2025-07-30 11:52:35 -05:00
Powei Feng
4b4dd3b70e ppm: add fixed material instance references (#9008)
In the introduction of MaterialInstanceManager, the assumption is
that everytime PostprocessManager wants an instance, we can just
provide a "new" one since all of the instance's content - UBOS,
textures - will not be shared between passes.  But this is not
the right assumption. For `colorGradingPrepareSubpass` and
`customResolvePrepareSubpass`, they are filling in an instance
for later passes to use.

To address this, we add a way to identify a fixed instance in
MaterialInstanceManager. This will allow us to refer to specific
instances of a material across passes (for the duration of a
frame).

This address the following crashes:
 - Enabling custom resolve for MSAA for the metal backend
 - Resizing the gltf_viewer window

Also move the dof instance into the loop to prevent UBO reuse.

Remove instance dependencies in Gaussian Blur Pass (separable).
2025-07-30 05:02:30 +00:00
Mathias Agopian
0976542d67 remove the explicit command queue flushes
Filament used to issue command queue flushes (E.g. glFlush()) after
large passes like the color pass in order to kick the gpu into action
sooner and reduce latency.  This however comes at a high cost on the
gpu timeline as command queue flushes are expensive on vulkan and 
metal. Moreover GL drivers are allowed to ignore glFlush().

So we just remove all these calls.
2025-07-29 16:35:22 -07:00
Sungun Park
b51e7f8b50 gl: Expedite shader cancellation in THREAD_POOL mode (#9002)
Previously, cancelling shader compilation tokens in THREAD_POOL mode
would block the engine thread until GL resource loading completed. This
led to unexpected application stalls when numerous shaders were
simultaneously cancelled.

This change moves the token cancellation logic to the compiler thread.
By marking tokens for asynchronous cancellation, we prevent unwanted
main thread stalls, ensuring a smoother user experience during bulk
shader cancellation.

BUGS=[430068776]
2025-07-29 21:38:23 +00:00
Powei Feng
b0e2f3a91a ppm: remove incorrectly checked in files 2025-07-29 13:04:25 -07:00
Ben Doherty
c25ac68a3a Better set default shader stages for samplers (#8992) 2025-07-29 10:01:36 -07:00
Powei Feng
0f572f797d utils: add method for index of first set bit in bitset (#9006) 2025-07-28 19:58:40 +00:00
Powei Feng
8600295ba4 webgpu: flush before reading pixels (#9003)
- Implement finish() to block until GPU work is done.
 - Implement flush() has the old finish() logic
 - Add flush() before reading pixels
2025-07-28 17:44:23 +00:00
Powei Feng
e4aeca28ec matdbg: update monaco dep (#8997)
- Update the monaco editor to the latest available version
   (0.52.2)
- Disable formatting for webgpu since it's already formatted
2025-07-26 00:07:47 +00:00
Filament Bot
f14ff6606a [automated] Updating /docs due to commit 5628b8b
Full commit hash is 5628b8b6e7

DOCS_ALLOW_DIRECT_EDITS
2025-07-25 23:31:26 +00:00
Powei Feng
5628b8b6e7 docs: add framegraph to notes (#8987) 2025-07-25 23:28:22 +00:00
Filament Bot
c7b919a065 [automated] Updating /docs due to commit 45e74c2
Full commit hash is 45e74c279f

DOCS_ALLOW_DIRECT_EDITS
2025-07-25 23:10:16 +00:00
Powei Feng
45e74c279f docs: add material properties page (#8980)
This is to replace the original "Material Properties.pdf".
2025-07-25 23:07:40 +00:00
Powei Feng
26b68d9654 PPM: add material instance caching (#8988)
We add a class to manage a cache of material instances mapped by
materials. This allows us to re-use instances across frames. Note
hat also it's possible for the same frame to want to use the same
instance multiple times (for example for bilateral blurring or
upsampling), but we allocate separate instances for that case so
that UBOs are not shared across render passes. This allows for
bubble-reduction for vulkan (and possibly other backends).
2025-07-25 22:47:50 +00:00
Powei Feng
8e8f6ad8a4 Update remote UI 2025-07-25 15:27:33 -07:00
Mathias Agopian
9b4ddb9353 update remote UI 2025-07-25 15:24:08 -07:00
Mathias Agopian
d7ef6665cc a hybrid instancing sample 2025-07-25 15:03:12 -07:00
chenriji
7048a9847a fixbug: The material Material_MR has not been compiled to include the required GLSL or SPIR-V chunks for the vertex shader (variant=5, filtered=5)
Because the member variable mVariantFilter is not initialized, random values will appear on Windows 10 or others platform, which eventually causes some variants to be filtered out by this mVariantFilter. (#9000)
2025-07-25 11:07:02 -07:00
Powei Feng
ff13035aab vk: fix leak in VulkanDescriptorSetCache (#9001)
PR #8946 fixed the caching logic in commit(), but in turn, created
a leak on terminate(). We proplery clean-up on terminate().
2025-07-25 17:19:16 +00:00
bridgewaterrobbie
a530497755 webgpu: Implement readPixels 2025-07-25 12:52:11 -04:00
Mathias Agopian
de6f7b56da move the management of the InstanceBuffer's UBO into InstanceBuffer
For some reason the UBO was managed by RenderableManager, but it's a
lot cleaner and easier to have this done by InstanceBuffer itself.
2025-07-25 00:36:05 -07:00
Mathias Agopian
2c60740edd cleanup and missing includes 2025-07-25 00:36:05 -07:00
granade-work
660bb5f8fe Add per-byte image comparison to backend tests (#8949)
BUGS=[398199436]
2025-07-24 11:53:19 -07:00
Powei Feng
514ad6ad16 vk: better choice for semaphore wait stage (#8993)
Previously we always waited on the semaphore at
VK_PIPELINE_STAGE_ALL_COMMANDS_BIT. If we be a little bit more
specific for the "in-frame" wait (between two command buffers
within a frame), we can allow for better parallelism.
2025-07-24 17:15:03 +00:00
Powei Feng
d339c9d8ca ppm: Use structure descriptor per-view set where appropriate (#8991)
We use it in
 - StructureMipMap
 - Separable Blur Pass
 - Depth Blit (Shader)

These two passes come before the color pass, but the color pass
needs to write the buffer that is referenced by the post-processing
descriptor set. So we set these passes to use the
StructureDescriptorSet (which has its own UBO). This removes a
synchronization dependency between these two passes and the color
pass.
2025-07-24 16:48:33 +00:00
Mathias Agopian
8d88abacf4 add unit tests for CommandBufferQueue and CircularBuffer 2025-07-24 09:29:33 -07:00
Mathias Agopian
8982d7161e add a unit test for Bimap
- rename find(Value&) to findValue() to avoid issues if the key and
values have the same type.

- fix a leak if Bitmap is destroyed and not empty (thankfully this
didn't happen in practice in filament, because the Bimap was always
empty when destroyed)

- fix a use after free in erase. we were destroying the Key before
removing it from the maps, which theoretically could need to access
them.

- slightly improved the API and added some comments about preconditions.
2025-07-24 09:29:06 -07:00
Ben Doherty
1f8248ba99 Metal: re-enable fastmath (#8911) 2025-07-23 13:46:43 -07:00
Doris Wu
04f7837439 Set the blend enabled field (#8983) 2025-07-23 04:57:42 +00:00
Mathias Agopian
85d00831bc minor cleanup and missing includes 2025-07-22 16:53:42 -07:00
Mathias Agopian
4d8f92f087 per-material globals weren't set when generating shadow maps 2025-07-22 16:53:42 -07:00
Mathias Agopian
5850a7eee4 use a separate UBO for the postfx user passes
some of the postfx passes (picking, ssao, structure) are user passes
because they call user materials; these now use their own ubo, which 
should prevent us from having to update a UBO mid frame.
2025-07-22 16:53:42 -07:00
Mathias Agopian
1b2620cdf3 cleanup-up how we update the per-view UBO
The per-view UBO is used in several different contexts, for instance:
- during the color pass
- during the shadow pass
- during the structure pass
- during app postfx passes

For shadows and other passes, its content is actually different because
the camera is very different. In that case, we use a different buffer.

However, the code that was used to set the values into the UBO was
duplicated and did slightly different things. In addition some
UBO values were (and are still) probably missing (e.g. the per-material
data).

To improve this situation we new use a utility class that does the
UBO set up of those "shared" values.

It turns out that the structure, ssr and ssao passes also need a 
slightly different content (because they run at half res) and currently
are sharing the color pass UBO, which causes mid-frame updates.

We introduce a new StructureDescriptorSet which is managing a new UBO,
it too is now implemented in terms of the new utility class. 
StructureDescriptorSet Is not used yet.
2025-07-22 16:53:42 -07:00
Mathias Agopian
ddca795cc9 cleanup resgen code
A test for how Gemini can clean-up code. Changes:

- Configuration Struct: Global variables have been grouped into an 
AppConfig struct. This makes the program's configuration explicit and 
avoids polluting the global namespace.

- Clearer Argument Parsing: The handleArguments function now returns an 
AppConfig object, encapsulating all parsing logic and making the main 
function cleaner.

- Helper Functions: Repetitive tasks like string replacement, file I/O, 
and writing file entries have been extracted into small, well-defined 
helper functions (replaceAll, openOutputFile, readFile, etc.).

- Simplified main Function: The main function is now a high-level 
coordinator, delegating work to helper functions. This makes the overall
 program flow much easier to follow.

- Modern C++ Idioms: The code now consistently uses C++ streams 
(std::cout, std::ofstream) and std::string objects, which is more 
idiomatic than a mix of C and C++ styles.

- added short comments
2025-07-22 16:52:11 -07:00
Powei Feng
3a5f558874 vk: VulkanBuffer cannot skip staging buffer after a read (#8946)
The previous introduction of VulkanBufferProxy uses the refcount of
the backing VulkanBuffer as an indication whether there's a write
in progress or not. But we also want to make sure there is no
read in progress (i.e. not referenced in a descriptor set). This
commit fixes the bookkeeping while trying to clean up the relevant
structs.

We add logic to track whether a UBO is actively been read (i.e.
bound to a descriptor set that is itself bound to a command buffer).
2025-07-22 21:47:45 +00:00
Powei Feng
13629ed93a vk: add feature flag for staging buffer bypass (#8958)
- Add a feature flag for bypassing staging buffer for buffer
   updates.  Note that this was assumed on for UMA devices, but
   can cause issue with post-processing.  So now we default the
   path to off and clients can enable it via feature flag.
 - Remove FVK_FORCE_STAGING_FOR_BUFFER_UPDATES since it's intended
   use is subsumed by vulkan_enable_staging_buffer_bypass.
 - Small refactor of FEngine for creating
   backend::Platform::DriverConfig.
2025-07-22 19:33:08 +00:00
Powei Feng
b129e5df4a renderdiff: fix upload issue second try (#8972)
- Move upload step to later so that comparison result is also
    included in the upload
 - Fix the wrong relative paths in the comparison_result.json
 - Fix viewer logic to pick only the latest run for a PR.
2025-07-22 18:47:18 +00:00
Mathias Agopian
2abacaa030 the ssr-history texture is not an array
the descriptor used for SSR is different depending on the pass. In
the color pass, it's used as the source of the SSRs buffers and is an
array (refraction & reflection). In the SSR pass it's the history
buffer and is just a 2D texture.
2025-07-22 10:08:22 -07:00
Powei Feng
9a88537e08 Fix dangling material reference after desctruction (#8977)
The invocable sent to Program::diagnostic contains a reference
to Material, which could be destroyed by the time the invocable
is called. We make sure that invocable does not have a reference.
2025-07-22 05:34:52 +00:00
Powei Feng
9640f2656f Make sure structure textures are unfilterable 2025-07-21 21:22:47 -07:00
Powei Feng
2811b064a9 vk: fix include for Definitions (#8954)
be more specific in the `utils` include.
2025-07-21 20:51:56 +00:00
1344 changed files with 209049 additions and 11372 deletions

View File

@@ -130,7 +130,8 @@ jobs:
run: |
bash build/common/get-mesa.sh
pip install tifffile numpy
- name: Render
- name: Render and compare
id: render_compare
run: |
TEST_DIR=test/renderdiff
source ${TEST_DIR}/src/preamble.sh
@@ -140,20 +141,32 @@ jobs:
python3 ${TEST_DIR}/src/golden_manager.py \
--branch=${GOLDEN_BRANCH} \
--output=${GOLDEN_OUTPUT_DIR}
# Note that we need to upload the output even if comparison fails
# Note that we need to upload the output even if comparison fails, so we undo `set -ex`
end_
python3 ${TEST_DIR}/src/compare.py \
--src=${GOLDEN_OUTPUT_DIR} \
--dest=${RENDER_OUTPUT_DIR} \
--out=${DIFF_OUTPUT_DIR} 2>&1 | tee compare_output.txt
if grep "Failed" compare_output.txt > /dev/null; then
DELIMITER="EOF_FILE_CONTENT_$(date +%s)" # Using timestamp to make it more unique
echo "err<<$DELIMITER" >> "$GITHUB_OUTPUT"
cat compare_output.txt >> "$GITHUB_OUTPUT"
echo "$DELIMITER" >> "$GITHUB_OUTPUT"
fi
- uses: actions/upload-artifact@v4
with:
name: presubmit-renderdiff-result
path: ./out/renderdiff
- name: Compare output
- name: Compare result
run: |
TEST_DIR=test/renderdiff
source ${TEST_DIR}/src/preamble.sh
python3 ${TEST_DIR}/src/compare.py \
--src=${GOLDEN_OUTPUT_DIR} \
--dest=${RENDER_OUTPUT_DIR} \
--out=${DIFF_OUTPUT_DIR}
end_
ERROR_STR="${{ steps.render_compare.outputs.err }}"
if [ -n "${ERROR_STR}" ]; then
echo "${ERROR_STR}"
exit 1
fi
validate-wgsl-webgpu:
name: validate-wgsl-webgpu

View File

@@ -22,7 +22,6 @@ project(TNT)
option(FILAMENT_USE_EXTERNAL_GLES3 "Experimental: Compile Filament against OpenGL ES 3" OFF)
option(FILAMENT_ENABLE_LTO "Enable link-time optimizations if supported by the compiler" OFF)
option(FILAMENT_SKIP_SAMPLES "Don't build samples" OFF)
option(FILAMENT_SUPPORTS_XCB "Include XCB support in Linux builds" ON)
@@ -819,6 +818,7 @@ add_subdirectory(${EXTERNAL}/jsmn/tnt)
add_subdirectory(${EXTERNAL}/stb/tnt)
add_subdirectory(${EXTERNAL}/getopt)
add_subdirectory(${EXTERNAL}/perfetto/tnt)
add_subdirectory(${EXTERNAL}/zstd/tnt)
# Note that this has to be placed after mikktspace in order for combine_static_libs to work.
add_subdirectory(${LIBRARIES}/geometry)
@@ -871,6 +871,7 @@ if (IS_HOST_PLATFORM)
add_subdirectory(${LIBRARIES}/filamentapp)
endif()
add_subdirectory(${LIBRARIES}/imageio)
add_subdirectory(${LIBRARIES}/filament-matp)
add_subdirectory(${FILAMENT}/samples)

View File

@@ -8,4 +8,9 @@ appropriate header in [RELEASE_NOTES.md](./RELEASE_NOTES.md).
## Release notes for next branch cut
- Rename `sampler` parameter `unfilterable` to `filterable` [⚠️ **New Material Version**]
- engine: add a `linearFog` material parameter. [⚠️ **New Material Version**]
- opengl: When `Material::compile()` is called on a platform which doesn't support parallel compilation, shaders are automatically compiled over a number of frames
- engine: Added `useDefaultDepthVariant` material parameter to force Filament to use its default variant for
depth-only passes. [**Requires recompiling materials**]
- material: fix specularFactor in `LOW_QUALITY` mode. [**Requires recompiling materials**] to take effect.
- material: Add CRC32 validation for material packages [⚠️ **New Material Version**]

View File

@@ -31,7 +31,7 @@ repositories {
}
dependencies {
implementation 'com.google.android.filament:filament-android:1.62.1'
implementation 'com.google.android.filament:filament-android:1.63.0'
}
```
@@ -51,7 +51,7 @@ Here are all the libraries available in the group `com.google.android.filament`:
iOS projects can use CocoaPods to install the latest release:
```shell
pod 'Filament', '~> 1.62.1'
pod 'Filament', '~> 1.63.0'
```
## Documentation
@@ -63,7 +63,7 @@ pod 'Filament', '~> 1.62.1'
- [Materials](https://google.github.io/filament/Materials.html), 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](https://google.github.io/filament/Material%20Properties.pdf), a reference
- [Material Properties](https://google.github.io/filament/notes/material_properties.html), a reference
sheet for the standard material model.
## Examples
@@ -331,6 +331,7 @@ and tools.
- `filamesh`: Mesh converter
- `glslminifier`: Minifies GLSL source code
- `matc`: Material compiler
- `filament-matp`: Material parser
- `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

View File

@@ -7,6 +7,14 @@ A new header is inserted each time a *tag* is created.
Instead, if you are authoring a PR for the main branch, add your release note to
[NEW_RELEASE_NOTES.md](./NEW_RELEASE_NOTES.md).
## v1.63.1
## v1.63.0
- Rename `sampler` parameter `unfilterable` to `filterable` [⚠️ **New Material Version**]
- Added `Renderer::shouldRenderFrame()`
## v1.62.2
- Metal: fix, respect alpha to coverage rasterization

View File

@@ -67,6 +67,10 @@ add_library(abseil STATIC IMPORTED)
set_target_properties(abseil PROPERTIES IMPORTED_LOCATION
${FILAMENT_DIR}/lib/${ANDROID_ABI}/libabseil.a)
add_library(zstd STATIC IMPORTED)
set_target_properties(zstd PROPERTIES IMPORTED_LOCATION
${FILAMENT_DIR}/lib/${ANDROID_ABI}/libzstd.a)
if (FILAMENT_ENABLE_FGVIEWER)
add_library(fgviewer STATIC IMPORTED)
set_target_properties(fgviewer PROPERTIES IMPORTED_LOCATION
@@ -74,6 +78,10 @@ if (FILAMENT_ENABLE_FGVIEWER)
endif()
if (FILAMENT_ENABLE_MATDBG)
add_library(filamat STATIC IMPORTED)
set_target_properties(filamat PROPERTIES IMPORTED_LOCATION
${FILAMENT_DIR}/lib/${ANDROID_ABI}/libfilamat.a)
add_library(matdbg STATIC IMPORTED)
set_target_properties(matdbg PROPERTIES IMPORTED_LOCATION
${FILAMENT_DIR}/lib/${ANDROID_ABI}/libmatdbg.a)
@@ -138,6 +146,7 @@ target_link_libraries(filament-jni
PRIVATE utils
PRIVATE perfetto
PRIVATE abseil
PRIVATE zstd
# libgeometry is PUBLIC because gltfio uses it.
PUBLIC geometry

View File

@@ -36,6 +36,12 @@ Java_com_google_android_filament_Renderer_nSkipFrame(JNIEnv *, jclass, jlong nat
renderer->skipFrame(uint64_t(vsyncSteadyClockTimeNano));
}
extern "C" JNIEXPORT jboolean JNICALL
Java_com_google_android_filament_Renderer_nShouldRenderFrame(JNIEnv *, jclass, jlong nativeRenderer) {
Renderer *renderer = (Renderer *) nativeRenderer;
return (jboolean) renderer->shouldRenderFrame();
}
extern "C" JNIEXPORT jboolean JNICALL
Java_com_google_android_filament_Renderer_nBeginFrame(JNIEnv *, jclass, jlong nativeRenderer,
jlong nativeSwapChain, jlong frameTimeNanos) {

View File

@@ -239,8 +239,25 @@ public class Material {
FRONT_AND_BACK
}
/**
* Shader compiler priority queue
*
* On platforms which support parallel shader compilation, compilation requests will be
* processed in order of priority, then insertion order.
*
* See {@link #compile(CompilerPriorityQueue, int, Object, Runnable)}.
*/
public enum CompilerPriorityQueue {
/** We need this program NOW.
*
* When passed as an argument to {@link #compile(CompilerPriorityQueue, int, Object,
* Runnable)}, if the platform doesn't support parallel compilation, but does support
* amortized shader compilation, the given shader program will be synchronously compiled.
*/
CRITICAL,
/** We will need this program soon. */
HIGH,
/** We will need this program eventually. */
LOW
}

View File

@@ -311,6 +311,21 @@ public class Renderer {
nSkipFrame(getNativeObject(), vsyncSteadyClockTimeNano);
}
/**
* Returns true if the current frame should be rendered.
*
* This is a convenience method that returns the same value as {@link #beginFrame}.
*
* @return
* <code>false</code> the current frame should be skipped<br>
* <code>true</code> the current frame can be rendered
*
* @see #beginFrame
*/
public boolean shouldRenderFrame() {
return nShouldRenderFrame(getNativeObject());
}
/**
* Sets up a frame for this <code>Renderer</code>.
* <p><code>beginFrame</code> manages frame pacing, and returns whether or not a frame should be
@@ -731,6 +746,7 @@ public class Renderer {
private static native void nSetPresentationTime(long nativeObject, long monotonicClockNanos);
private static native void nSetVsyncTime(long nativeObject, long steadyClockTimeNano);
private static native void nSkipFrame(long nativeObject, long vsyncSteadyClockTimeNano);
private static native boolean nShouldRenderFrame(long nativeObject);
private static native boolean nBeginFrame(long nativeRenderer, long nativeSwapChain, long frameTimeNanos);
private static native void nEndFrame(long nativeRenderer);
private static native void nRender(long nativeRenderer, long nativeView);

View File

@@ -911,6 +911,10 @@ public class Texture {
public static final int BLIT_SRC = 0x40;
/** Texture can be used the destination of a blit() */
public static final int BLIT_DST = 0x80;
/** Texture can be used for protected content */
public static final int PROTECTED = 0x0100;
/** Texture can be used with generateMipmaps() */
public static final int GEN_MIPMAPPABLE = 0x0200;
/** by default textures are <code>UPLOADABLE</code> and <code>SAMPLEABLE</code>*/
public static final int DEFAULT = UPLOADABLE | SAMPLEABLE;
}

View File

@@ -1561,7 +1561,9 @@ public class View {
}
/**
* Options to control large-scale fog in the scene
* Options to control large-scale fog in the scene. Materials can enable the `linearFog` property,
* which uses a simplified, linear equation for fog calculation; in this mode, the heightFalloff
* is ignored as well as the mipmap selection in IBL or skyColor mode.
*/
public static class FogOptions {
/**
@@ -1578,7 +1580,7 @@ public class View {
*/
public float cutOffDistance = Float.POSITIVE_INFINITY;
/**
* fog's maximum opacity between 0 and 1
* fog's maximum opacity between 0 and 1. Ignored in `linearFog` mode.
*/
public float maximumOpacity = 1.0f;
/**
@@ -1586,12 +1588,15 @@ public class View {
*/
public float height = 0.0f;
/**
* How fast the fog dissipates with altitude. heightFalloff has a unit of [1/m].
* How fast the fog dissipates with the altitude. heightFalloff has a unit of [1/m].
* It can be expressed as 1/H, where H is the altitude change in world units [m] that causes a
* factor 2.78 (e) change in fog density.
*
* A falloff of 0 means the fog density is constant everywhere and may result is slightly
* faster computations.
*
* In `linearFog` mode, only use to compute the slope of the linear equation. Completely
* ignored if set to 0.
*/
public float heightFalloff = 1.0f;
/**
@@ -1612,7 +1617,7 @@ public class View {
@NonNull @Size(min = 3)
public float[] color = {1.0f, 1.0f, 1.0f};
/**
* Extinction factor in [1/m] at altitude 'height'. The extinction factor controls how much
* Extinction factor in [1/m] at an altitude 'height'. The extinction factor controls how much
* light is absorbed and out-scattered per unit of distance. Each unit of extinction reduces
* the incoming light to 37% of its original value.
*
@@ -1621,10 +1626,15 @@ public class View {
* the composition of the fog/atmosphere.
*
* For historical reason this parameter is called `density`.
*
* In `linearFog` mode this is the slope of the linear equation if heightFalloff is set to 0.
* Otherwise, heightFalloff affects the slope calculation such that it matches the slope of
* the standard equation at the camera height.
*/
public float density = 0.1f;
/**
* Distance in world units [m] from the camera where the Sun in-scattering starts.
* Ignored in `linearFog` mode.
*/
public float inScatteringStart = 0.0f;
/**
@@ -1632,6 +1642,7 @@ public class View {
* is scattered (by the fog) towards the camera.
* Size of the Sun in-scattering (>0 to activate). Good values are >> 1 (e.g. ~10 - 100).
* Smaller values result is a larger scattering size.
* Ignored in `linearFog` mode.
*/
public float inScatteringSize = -1.0f;
/**
@@ -1657,6 +1668,8 @@ public class View {
*
* `fogColorFromIbl` is ignored when skyTexture is specified.
*
* In `linearFog` mode mipmap level 0 is always used.
*
* @see Texture
* @see fogColorFromIbl
*/
@@ -1671,7 +1684,7 @@ public class View {
/**
* Options to control Depth of Field (DoF) effect in the scene.
*
* cocScale can be used to set the depth of field blur independently from the camera
* cocScale can be used to set the depth of field blur independently of the camera
* aperture, e.g. for artistic reasons. This can be achieved by setting:
* cocScale = cameraAperture / desiredDoFAperture
*

View File

@@ -60,6 +60,7 @@ jlong nCreateHDRTexture(JNIEnv* env, jclass,
.height(image->getHeight())
.levels(0xff)
.sampler(Texture::Sampler::SAMPLER_2D)
.usage(Texture::Usage::DEFAULT | Texture::Usage::GEN_MIPMAPPABLE)
.format(textureFormat)
.build(*engine);

View File

@@ -46,8 +46,8 @@ fun loadTexture(engine: Engine, resources: Resources, resourceId: Int, type: Tex
.height(bitmap.height)
.sampler(Texture.Sampler.SAMPLER_2D)
.format(internalFormat(type))
// This tells Filament to figure out the number of mip levels
.levels(0xff)
.levels(0xff) // This tells Filament to figure out the number of mip levels
.usage(Texture.Usage.DEFAULT or Texture.Usage.GEN_MIPMAPPABLE)
.build(engine)
// TextureHelper offers a method that skips the copy of the bitmap into a ByteBuffer

View File

@@ -120,7 +120,7 @@ set(GLTFIO_INCLUDE_DIRS
${FILAMENT_DIR}/include
../../filament/backend/include
../../libs/gltfio/include
../../third_party/basisu/zstd
../../third_party/zstd/lib
../../third_party/cgltf
../../third_party/meshoptimizer/src
../../third_party/robin-map

View File

@@ -1,5 +1,5 @@
GROUP=com.google.android.filament
VERSION_NAME=1.62.1
VERSION_NAME=1.63.0
POM_DESCRIPTION=Real-time physically based rendering engine for Android.

View File

@@ -276,6 +276,7 @@ public class MainActivity extends Activity
.width(bitmap.getWidth())
.height(bitmap.getHeight())
.sampler(Texture.Sampler.SAMPLER_2D)
.usage(Texture.Usage.DEFAULT | Texture.Usage.GEN_MIPMAPPABLE)
.format(Texture.InternalFormat.SRGB8_A8) // It is crucial to use an SRGB format.
.levels(0xff) // tells Filament to figure out the number of mip levels
.build(engine);

View File

@@ -5,7 +5,7 @@ libs/math/test_math
libs/image/test_image compare libs/image/tests/reference/
libs/utils/test_utils
libs/filamat/test_filamat
tools/matc/test_matc
libs/filament-matp/test_matp
tools/cmgen/test_cmgen compare
tools/glslminifier/test_glslminifier
libs/filameshio/test_filameshio

View File

@@ -1199,6 +1199,24 @@ material {
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
### General: linearFog
Type
: `boolean`
Value
: `true` or `false`. Defaults to `false`.
Description
: When set to `true`, a simplified fog equation is used for large-scale fog calculations. In this mode,
in-scattering is ignored as well as height falloff.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ JSON
material {
linearFog : true
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
### General: quality
Type
@@ -1263,6 +1281,45 @@ material {
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
### General: useDefaultDepthVariant
Type
: `boolean`
Value
: `true` or `false`. Defaults to `false`.
Description
: This parameter forces Filament to use its default variant for depth passes, such as those used
in shadow rendering. This provides an optimization for materials with expensive custom vertex
shaders. For example, custom vertex shader computations intended to be consumed by the fragment
stage can be skipped during the depth-only pass. This parameter is only meaningful if the
material has a vertex block.
This parameter should not be set to `true` for vertex blocks that modify geometry (i.e.,
modifying `worldPosition`), otherwise shadows may render incorrectly.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ JSON
material {
variables : [
customColor
],
useDefaultDepthVariant : true
}
vertex {
void materialVertex(inout MaterialVertexInputs material) {
material.customColor = /* expensive computation that can be skipped for depth-only passes */
}
}
fragment {
void material(inout MaterialInputs material) {
prepareMaterial(material);
material.baseColor = variable_customColor;
}
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
### Vertex and attributes: requires
Type

View File

@@ -181,7 +181,7 @@ important for <code>matc</code> (material compiler).</p>
}
dependencies {
implementation 'com.google.android.filament:filament-android:1.62.1'
implementation 'com.google.android.filament:filament-android:1.63.0'
}
</code></pre>
<p>Here are all the libraries available in the group <code>com.google.android.filament</code>:</p>
@@ -196,7 +196,7 @@ dependencies {
</div>
<h3 id="ios"><a class="header" href="#ios">iOS</a></h3>
<p>iOS projects can use CocoaPods to install the latest release:</p>
<pre><code class="language-shell">pod 'Filament', '~&gt; 1.62.1'
<pre><code class="language-shell">pod 'Filament', '~&gt; 1.63.0'
</code></pre>
<h2 id="documentation"><a class="header" href="#documentation">Documentation</a></h2>
<ul>
@@ -207,7 +207,7 @@ good introduction to PBR for graphics programmers.</li>
<li><a href="https://google.github.io/filament/Materials.html">Materials</a>, the full reference
documentation for our material system. This document explains our different material models, how
to use the material compiler <code>matc</code> and how to write custom materials.</li>
<li><a href="https://google.github.io/filament/Material%20Properties.pdf">Material Properties</a>, a reference
<li><a href="https://google.github.io/filament/notes/material_properties.html">Material Properties</a>, a reference
sheet for the standard material model.</li>
</ul>
<h2 id="examples"><a class="header" href="#examples">Examples</a></h2>
@@ -501,6 +501,7 @@ and tools.</p>
<li><code>filamesh</code>: Mesh converter</li>
<li><code>glslminifier</code>: Minifies GLSL source code</li>
<li><code>matc</code>: Material compiler</li>
<li><code>filament-matp</code>: Material parser</li>
<li><code>matinfo</code> Displays information about materials compiled with <code>matc</code></li>
<li><code>mipgen</code> Generates a series of miplevels from a source image</li>
<li><code>normal-blending</code>: Tool to blend normal maps</li>

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 KiB

BIN
docs/images/framegraph.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 KiB

BIN
docs/images/metallic_00.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 KiB

BIN
docs/images/metallic_01.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 KiB

BIN
docs/images/metallic_02.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

BIN
docs/images/metallic_03.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 KiB

BIN
docs/images/metallic_04.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 KiB

BIN
docs/images/metallic_05.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 KiB

BIN
docs/images/metallic_06.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 KiB

BIN
docs/images/metallic_07.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 KiB

BIN
docs/images/metallic_08.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 KiB

BIN
docs/images/metallic_09.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 KiB

BIN
docs/images/metallic_10.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 291 KiB

View File

@@ -181,7 +181,7 @@ important for <code>matc</code> (material compiler).</p>
}
dependencies {
implementation 'com.google.android.filament:filament-android:1.62.1'
implementation 'com.google.android.filament:filament-android:1.63.0'
}
</code></pre>
<p>Here are all the libraries available in the group <code>com.google.android.filament</code>:</p>
@@ -196,7 +196,7 @@ dependencies {
</div>
<h3 id="ios"><a class="header" href="#ios">iOS</a></h3>
<p>iOS projects can use CocoaPods to install the latest release:</p>
<pre><code class="language-shell">pod 'Filament', '~&gt; 1.62.1'
<pre><code class="language-shell">pod 'Filament', '~&gt; 1.63.0'
</code></pre>
<h2 id="documentation"><a class="header" href="#documentation">Documentation</a></h2>
<ul>
@@ -207,7 +207,7 @@ good introduction to PBR for graphics programmers.</li>
<li><a href="https://google.github.io/filament/Materials.html">Materials</a>, the full reference
documentation for our material system. This document explains our different material models, how
to use the material compiler <code>matc</code> and how to write custom materials.</li>
<li><a href="https://google.github.io/filament/Material%20Properties.pdf">Material Properties</a>, a reference
<li><a href="https://google.github.io/filament/notes/material_properties.html">Material Properties</a>, a reference
sheet for the standard material model.</li>
</ul>
<h2 id="examples"><a class="header" href="#examples">Examples</a></h2>
@@ -501,6 +501,7 @@ and tools.</p>
<li><code>filamesh</code>: Mesh converter</li>
<li><code>glslminifier</code>: Minifies GLSL source code</li>
<li><code>matc</code>: Material compiler</li>
<li><code>filament-matp</code>: Material parser</li>
<li><code>matinfo</code> Displays information about materials compiled with <code>matc</code></li>
<li><code>mipgen</code> Generates a series of miplevels from a source image</li>
<li><code>normal-blending</code>: Tool to blend normal maps</li>

View File

@@ -235,36 +235,38 @@ counter-increment: h6;margin-right:10px}
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/general:constants" target="_self" class="level3"><span class="tocNumber">4.2.5&nbsp; </span>General: constants</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/general:variantfilter" target="_self" class="level3"><span class="tocNumber">4.2.6&nbsp; </span>General: variantFilter</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/general:flipuv" target="_self" class="level3"><span class="tocNumber">4.2.7&nbsp; </span>General: flipUV</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/general:quality" target="_self" class="level3"><span class="tocNumber">4.2.8&nbsp; </span>General: quality</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/general:instanced" target="_self" class="level3"><span class="tocNumber">4.2.9&nbsp; </span>General: instanced</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/general:vertexdomaindevicejittered" target="_self" class="level3"><span class="tocNumber">4.2.10&nbsp; </span>General: vertexDomainDeviceJittered</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/vertexandattributes:requires" target="_self" class="level3"><span class="tocNumber">4.2.11&nbsp; </span>Vertex and attributes: requires</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/vertexandattributes:variables" target="_self" class="level3"><span class="tocNumber">4.2.12&nbsp; </span>Vertex and attributes: variables</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/vertexandattributes:vertexdomain" target="_self" class="level3"><span class="tocNumber">4.2.13&nbsp; </span>Vertex and attributes: vertexDomain</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/vertexandattributes:interpolation" target="_self" class="level3"><span class="tocNumber">4.2.14&nbsp; </span>Vertex and attributes: interpolation</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/blendingandtransparency:blending" target="_self" class="level3"><span class="tocNumber">4.2.15&nbsp; </span>Blending and transparency: blending</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/blendingandtransparency:blendfunction" target="_self" class="level3"><span class="tocNumber">4.2.16&nbsp; </span>Blending and transparency: blendFunction</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/blendingandtransparency:postlightingblending" target="_self" class="level3"><span class="tocNumber">4.2.17&nbsp; </span>Blending and transparency: postLightingBlending</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/blendingandtransparency:transparency" target="_self" class="level3"><span class="tocNumber">4.2.18&nbsp; </span>Blending and transparency: transparency</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/blendingandtransparency:maskthreshold" target="_self" class="level3"><span class="tocNumber">4.2.19&nbsp; </span>Blending and transparency: maskThreshold</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/blendingandtransparency:refractionmode" target="_self" class="level3"><span class="tocNumber">4.2.20&nbsp; </span>Blending and transparency: refractionMode</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/blendingandtransparency:refractiontype" target="_self" class="level3"><span class="tocNumber">4.2.21&nbsp; </span>Blending and transparency: refractionType</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/rasterization:culling" target="_self" class="level3"><span class="tocNumber">4.2.22&nbsp; </span>Rasterization: culling</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/rasterization:colorwrite" target="_self" class="level3"><span class="tocNumber">4.2.23&nbsp; </span>Rasterization: colorWrite</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/rasterization:depthwrite" target="_self" class="level3"><span class="tocNumber">4.2.24&nbsp; </span>Rasterization: depthWrite</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/rasterization:depthculling" target="_self" class="level3"><span class="tocNumber">4.2.25&nbsp; </span>Rasterization: depthCulling</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/rasterization:doublesided" target="_self" class="level3"><span class="tocNumber">4.2.26&nbsp; </span>Rasterization: doubleSided</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/rasterization:alphatocoverage" target="_self" class="level3"><span class="tocNumber">4.2.27&nbsp; </span>Rasterization: alphaToCoverage</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/lighting:reflections" target="_self" class="level3"><span class="tocNumber">4.2.28&nbsp; </span>Lighting: reflections</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/lighting:shadowmultiplier" target="_self" class="level3"><span class="tocNumber">4.2.29&nbsp; </span>Lighting: shadowMultiplier</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/lighting:transparentshadow" target="_self" class="level3"><span class="tocNumber">4.2.30&nbsp; </span>Lighting: transparentShadow</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/lighting:clearcoatiorchange" target="_self" class="level3"><span class="tocNumber">4.2.31&nbsp; </span>Lighting: clearCoatIorChange</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/lighting:multibounceambientocclusion" target="_self" class="level3"><span class="tocNumber">4.2.32&nbsp; </span>Lighting: multiBounceAmbientOcclusion</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/lighting:specularambientocclusion" target="_self" class="level3"><span class="tocNumber">4.2.33&nbsp; </span>Lighting: specularAmbientOcclusion</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/anti-aliasing:specularantialiasing" target="_self" class="level3"><span class="tocNumber">4.2.34&nbsp; </span>Anti-aliasing: specularAntiAliasing</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/anti-aliasing:specularantialiasingvariance" target="_self" class="level3"><span class="tocNumber">4.2.35&nbsp; </span>Anti-aliasing: specularAntiAliasingVariance</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/anti-aliasing:specularantialiasingthreshold" target="_self" class="level3"><span class="tocNumber">4.2.36&nbsp; </span>Anti-aliasing: specularAntiAliasingThreshold</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/shading:customsurfaceshading" target="_self" class="level3"><span class="tocNumber">4.2.37&nbsp; </span>Shading: customSurfaceShading</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/general:linearfog" target="_self" class="level3"><span class="tocNumber">4.2.8&nbsp; </span>General: linearFog</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/general:quality" target="_self" class="level3"><span class="tocNumber">4.2.9&nbsp; </span>General: quality</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/general:instanced" target="_self" class="level3"><span class="tocNumber">4.2.10&nbsp; </span>General: instanced</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/general:vertexdomaindevicejittered" target="_self" class="level3"><span class="tocNumber">4.2.11&nbsp; </span>General: vertexDomainDeviceJittered</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/general:usedefaultdepthvariant" target="_self" class="level3"><span class="tocNumber">4.2.12&nbsp; </span>General: useDefaultDepthVariant</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/vertexandattributes:requires" target="_self" class="level3"><span class="tocNumber">4.2.13&nbsp; </span>Vertex and attributes: requires</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/vertexandattributes:variables" target="_self" class="level3"><span class="tocNumber">4.2.14&nbsp; </span>Vertex and attributes: variables</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/vertexandattributes:vertexdomain" target="_self" class="level3"><span class="tocNumber">4.2.15&nbsp; </span>Vertex and attributes: vertexDomain</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/vertexandattributes:interpolation" target="_self" class="level3"><span class="tocNumber">4.2.16&nbsp; </span>Vertex and attributes: interpolation</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/blendingandtransparency:blending" target="_self" class="level3"><span class="tocNumber">4.2.17&nbsp; </span>Blending and transparency: blending</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/blendingandtransparency:blendfunction" target="_self" class="level3"><span class="tocNumber">4.2.18&nbsp; </span>Blending and transparency: blendFunction</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/blendingandtransparency:postlightingblending" target="_self" class="level3"><span class="tocNumber">4.2.19&nbsp; </span>Blending and transparency: postLightingBlending</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/blendingandtransparency:transparency" target="_self" class="level3"><span class="tocNumber">4.2.20&nbsp; </span>Blending and transparency: transparency</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/blendingandtransparency:maskthreshold" target="_self" class="level3"><span class="tocNumber">4.2.21&nbsp; </span>Blending and transparency: maskThreshold</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/blendingandtransparency:refractionmode" target="_self" class="level3"><span class="tocNumber">4.2.22&nbsp; </span>Blending and transparency: refractionMode</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/blendingandtransparency:refractiontype" target="_self" class="level3"><span class="tocNumber">4.2.23&nbsp; </span>Blending and transparency: refractionType</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/rasterization:culling" target="_self" class="level3"><span class="tocNumber">4.2.24&nbsp; </span>Rasterization: culling</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/rasterization:colorwrite" target="_self" class="level3"><span class="tocNumber">4.2.25&nbsp; </span>Rasterization: colorWrite</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/rasterization:depthwrite" target="_self" class="level3"><span class="tocNumber">4.2.26&nbsp; </span>Rasterization: depthWrite</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/rasterization:depthculling" target="_self" class="level3"><span class="tocNumber">4.2.27&nbsp; </span>Rasterization: depthCulling</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/rasterization:doublesided" target="_self" class="level3"><span class="tocNumber">4.2.28&nbsp; </span>Rasterization: doubleSided</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/rasterization:alphatocoverage" target="_self" class="level3"><span class="tocNumber">4.2.29&nbsp; </span>Rasterization: alphaToCoverage</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/lighting:reflections" target="_self" class="level3"><span class="tocNumber">4.2.30&nbsp; </span>Lighting: reflections</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/lighting:shadowmultiplier" target="_self" class="level3"><span class="tocNumber">4.2.31&nbsp; </span>Lighting: shadowMultiplier</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/lighting:transparentshadow" target="_self" class="level3"><span class="tocNumber">4.2.32&nbsp; </span>Lighting: transparentShadow</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/lighting:clearcoatiorchange" target="_self" class="level3"><span class="tocNumber">4.2.33&nbsp; </span>Lighting: clearCoatIorChange</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/lighting:multibounceambientocclusion" target="_self" class="level3"><span class="tocNumber">4.2.34&nbsp; </span>Lighting: multiBounceAmbientOcclusion</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/lighting:specularambientocclusion" target="_self" class="level3"><span class="tocNumber">4.2.35&nbsp; </span>Lighting: specularAmbientOcclusion</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/anti-aliasing:specularantialiasing" target="_self" class="level3"><span class="tocNumber">4.2.36&nbsp; </span>Anti-aliasing: specularAntiAliasing</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/anti-aliasing:specularantialiasingvariance" target="_self" class="level3"><span class="tocNumber">4.2.37&nbsp; </span>Anti-aliasing: specularAntiAliasingVariance</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/anti-aliasing:specularantialiasingthreshold" target="_self" class="level3"><span class="tocNumber">4.2.38&nbsp; </span>Anti-aliasing: specularAntiAliasingThreshold</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/materialblock/shading:customsurfaceshading" target="_self" class="level3"><span class="tocNumber">4.2.39&nbsp; </span>Shading: customSurfaceShading</a><br/>
&nbsp;&nbsp;<a href="#materialdefinitions/vertexblock" target="_self" class="level2"><span class="tocNumber">4.3&nbsp; </span>Vertex block</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/vertexblock/materialvertexinputs" target="_self" class="level3"><span class="tocNumber">4.3.1&nbsp; </span>Material vertex inputs</a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#materialdefinitions/vertexblock/customvertexattributes" target="_self" class="level3"><span class="tocNumber">4.3.2&nbsp; </span>Custom vertex attributes</a><br/>
@@ -731,7 +733,7 @@ Note that the <code>normal</code> property affects the <em class="underscore">ba
<p>
<p>The <code>bentNormal</code> property defines the average unoccluded direction at a point on the surface. It is
used to improve the accuracy of indirect lighting. Bent normals can also improve the quality of
specular ambient occlusion (see section <a href="#toc4.2.33" target="_self">4.2.33</a> about
specular ambient occlusion (see section <a href="#toc4.2.35" target="_self">4.2.35</a> about
<code>specularAmbientOcclusion</code>).</p>
</p><p>
Bent normals can greatly increase the visual fidelity of an asset with various cavities and concave
@@ -810,7 +812,7 @@ light to bend further away from the initial path.
</table><center><div class="tablecaption"><b style="font-style:normal;">Table&nbsp;6:</b> Index of refraction of common materials</div></center></div>
</p><p>
The appearance of a refractive material will greatly depend on the <code>refractionType</code> and
<code>refractionMode</code> settings of the material. Refer to section <a href="#toc4.2.21" target="_self">4.2.21</a> and section <a href="#toc4.2.20" target="_self">4.2.20</a>
<code>refractionMode</code> settings of the material. Refer to section <a href="#toc4.2.23" target="_self">4.2.23</a> and section <a href="#toc4.2.22" target="_self">4.2.22</a>
for more information.
</p><p>
The effect of <code>ior</code> when <code>refractionMode</code> is set to <code>cubemap</code> and <code>refractionType</code> is set to <code>solid</code>
@@ -1400,7 +1402,16 @@ non-shader data.</p>
</p></dd></dl></p><pre class="listing tilde"><code><span class="line"></span>material <span class="hljs-punctuation">{</span>
<span class="line"></span> flipUV <span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">false</span></span>
<span class="line"></span><span class="hljs-punctuation">}</span></code></pre>
<a class="target" name="general:quality">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/general:quality">&nbsp;</a><a class="target" name="toc4.2.8">&nbsp;</a><h3 id="general-quality"><a class="header" href="#general-quality">General: quality</a></h3>
<a class="target" name="general:linearfog">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/general:linearfog">&nbsp;</a><a class="target" name="toc4.2.8">&nbsp;</a><h3 id="general-linearfog"><a class="header" href="#general-linearfog">General: linearFog</a></h3>
<p>
<dl><dt>Type</dt><dd><p> <code>boolean</code>
</p></dd><dt>Value</dt><dd><p> <code>true</code> or <code>false</code>. Defaults to <code>false</code>.
</p></dd><dt>Description</dt><dd><p> When set to <code>true</code>, a simplified fog equation is used for large-scale fog calculations. In this mode,
in-scattering is ignored as well as height falloff.
</p></dd></dl></p><pre class="listing tilde"><code><span class="line"></span>material <span class="hljs-punctuation">{</span>
<span class="line"></span> linearFog <span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">true</span></span>
<span class="line"></span><span class="hljs-punctuation">}</span></code></pre>
<a class="target" name="general:quality">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/general:quality">&nbsp;</a><a class="target" name="toc4.2.9">&nbsp;</a><h3 id="general-quality"><a class="header" href="#general-quality">General: quality</a></h3>
<p>
<dl><dt>Type</dt><dd><p> <code>string</code>
</p></dd><dt>Value</dt><dd><p> Any of <code>low</code>, <code>normal</code>, <code>high</code>, <code>default</code>. Defaults to <code>default</code>.
@@ -1411,7 +1422,7 @@ non-shader data.</p>
</p></dd></dl></p><pre class="listing tilde"><code><span class="line"></span>material <span class="hljs-punctuation">{</span>
<span class="line"></span> quality <span class="hljs-punctuation">:</span> default
<span class="line"></span><span class="hljs-punctuation">}</span></code></pre>
<a class="target" name="general:instanced">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/general:instanced">&nbsp;</a><a class="target" name="toc4.2.9">&nbsp;</a><h3 id="general-instanced"><a class="header" href="#general-instanced">General: instanced</a></h3>
<a class="target" name="general:instanced">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/general:instanced">&nbsp;</a><a class="target" name="toc4.2.10">&nbsp;</a><h3 id="general-instanced"><a class="header" href="#general-instanced">General: instanced</a></h3>
<p>
<dl><dt>Type</dt><dd><p> <code>boolean</code>
</p></dd><dt>Value</dt><dd><p> <code>true</code> or <code>false</code>. Defaults to <code>false</code>.
@@ -1423,7 +1434,7 @@ non-shader data.</p>
</p></dd></dl></p><pre class="listing tilde"><code><span class="line"></span>material <span class="hljs-punctuation">{</span>
<span class="line"></span> instanced <span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">true</span></span>
<span class="line"></span><span class="hljs-punctuation">}</span></code></pre>
<a class="target" name="general:vertexdomaindevicejittered">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/general:vertexdomaindevicejittered">&nbsp;</a><a class="target" name="toc4.2.10">&nbsp;</a><h3 id="general-vertexdomaindevicejittered"><a class="header" href="#general-vertexdomaindevicejittered">General: vertexDomainDeviceJittered</a></h3>
<a class="target" name="general:vertexdomaindevicejittered">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/general:vertexdomaindevicejittered">&nbsp;</a><a class="target" name="toc4.2.11">&nbsp;</a><h3 id="general-vertexdomaindevicejittered"><a class="header" href="#general-vertexdomaindevicejittered">General: vertexDomainDeviceJittered</a></h3>
<p>
<dl><dt>Type</dt><dd><p> <code>boolean</code>
</p></dd><dt>Value</dt><dd><p> <code>true</code> or <code>false</code>. Defaults to <code>false</code>.
@@ -1437,7 +1448,37 @@ non-shader data.</p>
</p></dd></dl></p><pre class="listing tilde"><code><span class="line"></span>material <span class="hljs-punctuation">{</span>
<span class="line"></span> vertexDomainDeviceJittered <span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">true</span></span>
<span class="line"></span><span class="hljs-punctuation">}</span></code></pre>
<a class="target" name="vertexandattributes:requires">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/vertexandattributes:requires">&nbsp;</a><a class="target" name="toc4.2.11">&nbsp;</a><h3 id="vertex-and-attributes-requires"><a class="header" href="#vertex-and-attributes-requires">Vertex and attributes: requires</a></h3>
<a class="target" name="general:usedefaultdepthvariant">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/general:usedefaultdepthvariant">&nbsp;</a><a class="target" name="toc4.2.12">&nbsp;</a><h3 id="general-usedefaultdepthvariant"><a class="header" href="#general-usedefaultdepthvariant">General: useDefaultDepthVariant</a></h3>
<p>
<dl><dt>Type</dt><dd><p> <code>boolean</code>
</p></dd><dt>Value</dt><dd><p> <code>true</code> or <code>false</code>. Defaults to <code>false</code>.
</p></dd><dt>Description</dt><dd><p> This parameter forces Filament to use its default variant for depth passes, such as those used
in shadow rendering. This provides an optimization for materials with expensive custom vertex
shaders. For example, custom vertex shader computations intended to be consumed by the fragment
stage can be skipped during the depth-only pass. This parameter is only meaningful if the
material has a vertex block.
This parameter should not be set to <code>true</code> for vertex blocks that modify geometry (i.e.,
modifying <code>worldPosition</code>), otherwise shadows may render incorrectly.
</p></dd></dl></p><pre class="listing tilde"><code><span class="line"></span>material <span class="hljs-punctuation">{</span>
<span class="line"></span> variables <span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
<span class="line"></span> customColor
<span class="line"></span> <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>
<span class="line"></span> useDefaultDepthVariant <span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">true</span></span>
<span class="line"></span><span class="hljs-punctuation">}</span>
<span class="line"></span>
<span class="line"></span>vertex <span class="hljs-punctuation">{</span>
<span class="line"></span> void materialVertex(inout MaterialVertexInputs material) <span class="hljs-punctuation">{</span>
<span class="line"></span> material.customColor = <span class="hljs-comment">/* expensive computation that can be skipped for depth-only passes */</span>
<span class="line"></span> <span class="hljs-punctuation">}</span>
<span class="line"></span><span class="hljs-punctuation">}</span>
<span class="line"></span>
<span class="line"></span>fragment <span class="hljs-punctuation">{</span>
<span class="line"></span> void material(inout MaterialInputs material) <span class="hljs-punctuation">{</span>
<span class="line"></span> prepareMaterial(material);
<span class="line"></span> material.baseColor = variable_customColor;
<span class="line"></span> <span class="hljs-punctuation">}</span>
<span class="line"></span><span class="hljs-punctuation">}</span></code></pre>
<a class="target" name="vertexandattributes:requires">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/vertexandattributes:requires">&nbsp;</a><a class="target" name="toc4.2.13">&nbsp;</a><h3 id="vertex-and-attributes-requires"><a class="header" href="#vertex-and-attributes-requires">Vertex and attributes: requires</a></h3>
<p>
<dl><dt>Type</dt><dd><p> array of <code>string</code>
</p></dd><dt>Value</dt><dd><p> Each entry must be any of <code>uv0</code>, <code>uv1</code>, <code>color</code>, <code>position</code>, <code>tangents</code>, <code>custom0</code>
@@ -1470,7 +1511,7 @@ non-shader data.</p>
<span class="line"></span> material.baseColor.rgb *= getCustom0().rgb;
<span class="line"></span> <span class="hljs-punctuation">}</span>
<span class="line"></span><span class="hljs-punctuation">}</span></code></pre>
<a class="target" name="vertexandattributes:variables">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/vertexandattributes:variables">&nbsp;</a><a class="target" name="toc4.2.12">&nbsp;</a><h3 id="vertex-and-attributes-variables"><a class="header" href="#vertex-and-attributes-variables">Vertex and attributes: variables</a></h3>
<a class="target" name="vertexandattributes:variables">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/vertexandattributes:variables">&nbsp;</a><a class="target" name="toc4.2.14">&nbsp;</a><h3 id="vertex-and-attributes-variables"><a class="header" href="#vertex-and-attributes-variables">Vertex and attributes: variables</a></h3>
<p>
<dl><dt>Type</dt><dd><p> array of <code>string</code>
</p></dd><dt>Value</dt><dd><p> Up to 5 strings, each must be a valid GLSL identifier.
@@ -1525,7 +1566,7 @@ non-shader data.</p>
<span class="line"></span> material.eyeDirection.xyz = mulMat3x3Float3(getWorldFromViewMatrix()<span class="hljs-punctuation">,</span> u);
<span class="line"></span> <span class="hljs-punctuation">}</span>
<span class="line"></span><span class="hljs-punctuation">}</span></code></pre>
<a class="target" name="vertexandattributes:vertexdomain">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/vertexandattributes:vertexdomain">&nbsp;</a><a class="target" name="toc4.2.13">&nbsp;</a><h3 id="vertex-and-attributes-vertexdomain"><a class="header" href="#vertex-and-attributes-vertexdomain">Vertex and attributes: vertexDomain</a></h3>
<a class="target" name="vertexandattributes:vertexdomain">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/vertexandattributes:vertexdomain">&nbsp;</a><a class="target" name="toc4.2.15">&nbsp;</a><h3 id="vertex-and-attributes-vertexdomain"><a class="header" href="#vertex-and-attributes-vertexdomain">Vertex and attributes: vertexDomain</a></h3>
<p>
<dl><dt>Type</dt><dd><p> <code>string</code>
</p></dd><dt>Value</dt><dd><p> Any of <code>object</code>, <code>world</code>, <code>view</code>, <code>device</code>. Defaults to <code>object</code>.
@@ -1547,7 +1588,7 @@ non-shader data.</p>
</p></dd></dl></p><pre class="listing tilde"><code><span class="line"></span>material <span class="hljs-punctuation">{</span>
<span class="line"></span> vertexDomain <span class="hljs-punctuation">:</span> device
<span class="line"></span><span class="hljs-punctuation">}</span></code></pre>
<a class="target" name="vertexandattributes:interpolation">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/vertexandattributes:interpolation">&nbsp;</a><a class="target" name="toc4.2.14">&nbsp;</a><h3 id="vertex-and-attributes-interpolation"><a class="header" href="#vertex-and-attributes-interpolation">Vertex and attributes: interpolation</a></h3>
<a class="target" name="vertexandattributes:interpolation">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/vertexandattributes:interpolation">&nbsp;</a><a class="target" name="toc4.2.16">&nbsp;</a><h3 id="vertex-and-attributes-interpolation"><a class="header" href="#vertex-and-attributes-interpolation">Vertex and attributes: interpolation</a></h3>
<p>
<dl><dt>Type</dt><dd><p> <code>string</code>
</p></dd><dt>Value</dt><dd><p> Any of <code>smooth</code>, <code>flat</code>. Defaults to <code>smooth</code>.
@@ -1558,7 +1599,7 @@ non-shader data.</p>
</p></dd></dl></p><pre class="listing tilde"><code><span class="line"></span>material <span class="hljs-punctuation">{</span>
<span class="line"></span> interpolation <span class="hljs-punctuation">:</span> flat
<span class="line"></span><span class="hljs-punctuation">}</span></code></pre>
<a class="target" name="blendingandtransparency:blending">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/blendingandtransparency:blending">&nbsp;</a><a class="target" name="toc4.2.15">&nbsp;</a><h3 id="blending-and-transparency-blending"><a class="header" href="#blending-and-transparency-blending">Blending and transparency: blending</a></h3>
<a class="target" name="blendingandtransparency:blending">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/blendingandtransparency:blending">&nbsp;</a><a class="target" name="toc4.2.17">&nbsp;</a><h3 id="blending-and-transparency-blending"><a class="header" href="#blending-and-transparency-blending">Blending and transparency: blending</a></h3>
<p>
<dl><dt>Type</dt><dd><p> <code>string</code>
</p></dd><dt>Value</dt><dd><p> Any of <code>opaque</code>, <code>transparent</code>, <code>fade</code>, <code>add</code>, <code>masked</code>, <code>multiply</code>, <code>screen</code>, <code>custom</code>. Defaults to <code>opaque</code>.
@@ -1597,7 +1638,7 @@ non-shader data.</p>
</p><pre class="listing tilde"><code><span class="line"></span>material <span class="hljs-punctuation">{</span>
<span class="line"></span> blending <span class="hljs-punctuation">:</span> transparent
<span class="line"></span><span class="hljs-punctuation">}</span></code></pre>
<a class="target" name="blendingandtransparency:blendfunction">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/blendingandtransparency:blendfunction">&nbsp;</a><a class="target" name="toc4.2.16">&nbsp;</a><h3 id="blending-and-transparency-blendfunction"><a class="header" href="#blending-and-transparency-blendfunction">Blending and transparency: blendFunction</a></h3>
<a class="target" name="blendingandtransparency:blendfunction">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/blendingandtransparency:blendfunction">&nbsp;</a><a class="target" name="toc4.2.18">&nbsp;</a><h3 id="blending-and-transparency-blendfunction"><a class="header" href="#blending-and-transparency-blendfunction">Blending and transparency: blendFunction</a></h3>
<p>
<dl><dt>Type</dt><dd><p> <code>object</code>
</p></dd><dt>Fields</dt><dd><p> <code>srcRGB</code>, <code>srcA</code>, <code>dstRGB</code>, <code>dstA</code>
@@ -1618,7 +1659,7 @@ non-shader data.</p>
<span class="line"></span> dstA<span class="hljs-punctuation">:</span> oneMinusSrcAlpha
<span class="line"></span> <span class="hljs-punctuation">}</span>
<span class="line"></span> <span class="hljs-punctuation">}</span></code></pre>
<a class="target" name="blendingandtransparency:postlightingblending">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/blendingandtransparency:postlightingblending">&nbsp;</a><a class="target" name="toc4.2.17">&nbsp;</a><h3 id="blending-and-transparency-postlightingblending"><a class="header" href="#blending-and-transparency-postlightingblending">Blending and transparency: postLightingBlending</a></h3>
<a class="target" name="blendingandtransparency:postlightingblending">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/blendingandtransparency:postlightingblending">&nbsp;</a><a class="target" name="toc4.2.19">&nbsp;</a><h3 id="blending-and-transparency-postlightingblending"><a class="header" href="#blending-and-transparency-postlightingblending">Blending and transparency: postLightingBlending</a></h3>
<p>
<dl><dt>Type</dt><dd><p> <code>string</code>
</p></dd><dt>Value</dt><dd><p> Any of <code>opaque</code>, <code>transparent</code>, <code>add</code>. Defaults to <code>transparent</code>.
@@ -1641,7 +1682,7 @@ non-shader data.</p>
</p></dd></dl></p><pre class="listing tilde"><code><span class="line"></span>material <span class="hljs-punctuation">{</span>
<span class="line"></span> postLightingBlending <span class="hljs-punctuation">:</span> add
<span class="line"></span><span class="hljs-punctuation">}</span></code></pre>
<a class="target" name="blendingandtransparency:transparency">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/blendingandtransparency:transparency">&nbsp;</a><a class="target" name="toc4.2.18">&nbsp;</a><h3 id="blending-and-transparency-transparency"><a class="header" href="#blending-and-transparency-transparency">Blending and transparency: transparency</a></h3>
<a class="target" name="blendingandtransparency:transparency">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/blendingandtransparency:transparency">&nbsp;</a><a class="target" name="toc4.2.20">&nbsp;</a><h3 id="blending-and-transparency-transparency"><a class="header" href="#blending-and-transparency-transparency">Blending and transparency: transparency</a></h3>
<p>
<dl><dt>Type</dt><dd><p> <code>string</code>
</p></dd><dt>Value</dt><dd><p> Any of <code>default</code>, <code>twoPassesOneSide</code> or <code>twoPassesTwoSides</code>. Defaults to <code>default</code>.
@@ -1674,7 +1715,7 @@ non-shader data.</p>
<center><div class="image" style=""><a class="target" name="figure_transparencytwopassestwosides">&nbsp;</a><a href="../images/screenshot_twopasses_twosides.png" target="_blank"><img class="markdeep" src="../images/screenshot_twopasses_twosides.png" /></a><center><span class="imagecaption"><b style="font-style:normal;">Figure&nbsp;35:</b> In <code>twoPassesTwoSides</code> mode, both set of faces are visible
</span></center></div></center>
</p>
<a class="target" name="blendingandtransparency:maskthreshold">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/blendingandtransparency:maskthreshold">&nbsp;</a><a class="target" name="toc4.2.19">&nbsp;</a><h3 id="blending-and-transparency-maskthreshold"><a class="header" href="#blending-and-transparency-maskthreshold">Blending and transparency: maskThreshold</a></h3>
<a class="target" name="blendingandtransparency:maskthreshold">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/blendingandtransparency:maskthreshold">&nbsp;</a><a class="target" name="toc4.2.21">&nbsp;</a><h3 id="blending-and-transparency-maskthreshold"><a class="header" href="#blending-and-transparency-maskthreshold">Blending and transparency: maskThreshold</a></h3>
<p>
<dl><dt>Type</dt><dd><p> <code>number</code>
</p></dd><dt>Value</dt><dd><p> A value between <code>0.0</code> and <code>1.0</code>. Defaults to <code>0.4</code>.
@@ -1686,7 +1727,7 @@ non-shader data.</p>
<span class="line"></span> blending <span class="hljs-punctuation">:</span> masked<span class="hljs-punctuation">,</span>
<span class="line"></span> maskThreshold <span class="hljs-punctuation">:</span> <span class="hljs-number">0.5</span>
<span class="line"></span><span class="hljs-punctuation">}</span></code></pre>
<a class="target" name="blendingandtransparency:refractionmode">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/blendingandtransparency:refractionmode">&nbsp;</a><a class="target" name="toc4.2.20">&nbsp;</a><h3 id="blending-and-transparency-refractionmode"><a class="header" href="#blending-and-transparency-refractionmode">Blending and transparency: refractionMode</a></h3>
<a class="target" name="blendingandtransparency:refractionmode">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/blendingandtransparency:refractionmode">&nbsp;</a><a class="target" name="toc4.2.22">&nbsp;</a><h3 id="blending-and-transparency-refractionmode"><a class="header" href="#blending-and-transparency-refractionmode">Blending and transparency: refractionMode</a></h3>
<p>
<dl><dt>Type</dt><dd><p> <code>string</code>
</p></dd><dt>Value</dt><dd><p> Any of <code>none</code>, <code>cubemap</code>, <code>screenspace</code>. Defaults to <code>none</code>.
@@ -1702,7 +1743,7 @@ non-shader data.</p>
</p></dd></dl></p><pre class="listing tilde"><code><span class="line"></span>material <span class="hljs-punctuation">{</span>
<span class="line"></span> refractionMode <span class="hljs-punctuation">:</span> cubemap<span class="hljs-punctuation">,</span>
<span class="line"></span><span class="hljs-punctuation">}</span></code></pre>
<a class="target" name="blendingandtransparency:refractiontype">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/blendingandtransparency:refractiontype">&nbsp;</a><a class="target" name="toc4.2.21">&nbsp;</a><h3 id="blending-and-transparency-refractiontype"><a class="header" href="#blending-and-transparency-refractiontype">Blending and transparency: refractionType</a></h3>
<a class="target" name="blendingandtransparency:refractiontype">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/blendingandtransparency:refractiontype">&nbsp;</a><a class="target" name="toc4.2.23">&nbsp;</a><h3 id="blending-and-transparency-refractiontype"><a class="header" href="#blending-and-transparency-refractiontype">Blending and transparency: refractionType</a></h3>
<p>
<dl><dt>Type</dt><dd><p> <code>string</code>
</p></dd><dt>Value</dt><dd><p> Any of <code>solid</code>, <code>thin</code>. Defaults to <code>solid</code>.
@@ -1716,7 +1757,7 @@ non-shader data.</p>
<span class="line"></span> refractionMode <span class="hljs-punctuation">:</span> cubemap<span class="hljs-punctuation">,</span>
<span class="line"></span> refractionType <span class="hljs-punctuation">:</span> thin<span class="hljs-punctuation">,</span>
<span class="line"></span><span class="hljs-punctuation">}</span></code></pre>
<a class="target" name="rasterization:culling">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/rasterization:culling">&nbsp;</a><a class="target" name="toc4.2.22">&nbsp;</a><h3 id="rasterization-culling"><a class="header" href="#rasterization-culling">Rasterization: culling</a></h3>
<a class="target" name="rasterization:culling">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/rasterization:culling">&nbsp;</a><a class="target" name="toc4.2.24">&nbsp;</a><h3 id="rasterization-culling"><a class="header" href="#rasterization-culling">Rasterization: culling</a></h3>
<p>
<dl><table><tr valign=top><td><dt>Type</dt></td><td><dd><p> <code>string</code>
</p></dd></td></tr><tr valign=top><td><dt>Value</dt></td><td><dd><p> Any of <code>none</code>, <code>front</code>, <code>back</code>, <code>frontAndBack</code>. Defaults to <code>back</code>.
@@ -1725,7 +1766,7 @@ non-shader data.</p>
</p></dd></td></tr></table></dl></p><pre class="listing tilde"><code><span class="line"></span>material <span class="hljs-punctuation">{</span>
<span class="line"></span> culling <span class="hljs-punctuation">:</span> none
<span class="line"></span><span class="hljs-punctuation">}</span></code></pre>
<a class="target" name="rasterization:colorwrite">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/rasterization:colorwrite">&nbsp;</a><a class="target" name="toc4.2.23">&nbsp;</a><h3 id="rasterization-colorwrite"><a class="header" href="#rasterization-colorwrite">Rasterization: colorWrite</a></h3>
<a class="target" name="rasterization:colorwrite">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/rasterization:colorwrite">&nbsp;</a><a class="target" name="toc4.2.25">&nbsp;</a><h3 id="rasterization-colorwrite"><a class="header" href="#rasterization-colorwrite">Rasterization: colorWrite</a></h3>
<p>
<dl><table><tr valign=top><td><dt>Type</dt></td><td><dd><p> <code>boolean</code>
</p></dd></td></tr><tr valign=top><td><dt>Value</dt></td><td><dd><p> <code>true</code> or <code>false</code>. Defaults to <code>true</code>.
@@ -1733,7 +1774,7 @@ non-shader data.</p>
</p></dd></td></tr></table></dl></p><pre class="listing tilde"><code><span class="line"></span>material <span class="hljs-punctuation">{</span>
<span class="line"></span> colorWrite <span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">false</span></span>
<span class="line"></span><span class="hljs-punctuation">}</span></code></pre>
<a class="target" name="rasterization:depthwrite">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/rasterization:depthwrite">&nbsp;</a><a class="target" name="toc4.2.24">&nbsp;</a><h3 id="rasterization-depthwrite"><a class="header" href="#rasterization-depthwrite">Rasterization: depthWrite</a></h3>
<a class="target" name="rasterization:depthwrite">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/rasterization:depthwrite">&nbsp;</a><a class="target" name="toc4.2.26">&nbsp;</a><h3 id="rasterization-depthwrite"><a class="header" href="#rasterization-depthwrite">Rasterization: depthWrite</a></h3>
<p>
<dl><table><tr valign=top><td><dt>Type</dt></td><td><dd><p> <code>boolean</code>
</p></dd></td></tr><tr valign=top><td><dt>Value</dt></td><td><dd><p> <code>true</code> or <code>false</code>. Defaults to <code>true</code> for opaque materials, <code>false</code> for transparent materials.
@@ -1741,7 +1782,7 @@ non-shader data.</p>
</p></dd></td></tr></table></dl></p><pre class="listing tilde"><code><span class="line"></span>material <span class="hljs-punctuation">{</span>
<span class="line"></span> depthWrite <span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">false</span></span>
<span class="line"></span><span class="hljs-punctuation">}</span></code></pre>
<a class="target" name="rasterization:depthculling">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/rasterization:depthculling">&nbsp;</a><a class="target" name="toc4.2.25">&nbsp;</a><h3 id="rasterization-depthculling"><a class="header" href="#rasterization-depthculling">Rasterization: depthCulling</a></h3>
<a class="target" name="rasterization:depthculling">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/rasterization:depthculling">&nbsp;</a><a class="target" name="toc4.2.27">&nbsp;</a><h3 id="rasterization-depthculling"><a class="header" href="#rasterization-depthculling">Rasterization: depthCulling</a></h3>
<p>
<dl><dt>Type</dt><dd><p> <code>boolean</code>
</p></dd><dt>Value</dt><dd><p> <code>true</code> or <code>false</code>. Defaults to <code>true</code>.
@@ -1750,7 +1791,7 @@ non-shader data.</p>
</p></dd></dl></p><pre class="listing tilde"><code><span class="line"></span>material <span class="hljs-punctuation">{</span>
<span class="line"></span> depthCulling <span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">false</span></span>
<span class="line"></span><span class="hljs-punctuation">}</span></code></pre>
<a class="target" name="rasterization:doublesided">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/rasterization:doublesided">&nbsp;</a><a class="target" name="toc4.2.26">&nbsp;</a><h3 id="rasterization-doublesided"><a class="header" href="#rasterization-doublesided">Rasterization: doubleSided</a></h3>
<a class="target" name="rasterization:doublesided">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/rasterization:doublesided">&nbsp;</a><a class="target" name="toc4.2.28">&nbsp;</a><h3 id="rasterization-doublesided"><a class="header" href="#rasterization-doublesided">Rasterization: doubleSided</a></h3>
<p>
<dl><dt>Type</dt><dd><p> <code>boolean</code>
</p></dd><dt>Value</dt><dd><p> <code>true</code> or <code>false</code>. Defaults to <code>false</code>.
@@ -1770,7 +1811,7 @@ non-shader data.</p>
<span class="line"></span> material.baseColor = materialParams.albedo;
<span class="line"></span> <span class="hljs-punctuation">}</span>
<span class="line"></span><span class="hljs-punctuation">}</span></code></pre>
<a class="target" name="rasterization:alphatocoverage">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/rasterization:alphatocoverage">&nbsp;</a><a class="target" name="toc4.2.27">&nbsp;</a><h3 id="rasterization-alphatocoverage"><a class="header" href="#rasterization-alphatocoverage">Rasterization: alphaToCoverage</a></h3>
<a class="target" name="rasterization:alphatocoverage">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/rasterization:alphatocoverage">&nbsp;</a><a class="target" name="toc4.2.29">&nbsp;</a><h3 id="rasterization-alphatocoverage"><a class="header" href="#rasterization-alphatocoverage">Rasterization: alphaToCoverage</a></h3>
<p>
<dl><dt>Type</dt><dd><p> <code>boolean</code>
</p></dd><dt>Value</dt><dd><p> <code>true</code> or <code>false</code>. Defaults to <code>false</code>.
@@ -1792,7 +1833,7 @@ non-shader data.</p>
<span class="line"></span> material.baseColor = materialParams.albedo;
<span class="line"></span> <span class="hljs-punctuation">}</span>
<span class="line"></span><span class="hljs-punctuation">}</span></code></pre>
<a class="target" name="lighting:reflections">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/lighting:reflections">&nbsp;</a><a class="target" name="toc4.2.28">&nbsp;</a><h3 id="lighting-reflections"><a class="header" href="#lighting-reflections">Lighting: reflections</a></h3>
<a class="target" name="lighting:reflections">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/lighting:reflections">&nbsp;</a><a class="target" name="toc4.2.30">&nbsp;</a><h3 id="lighting-reflections"><a class="header" href="#lighting-reflections">Lighting: reflections</a></h3>
<p>
<dl><dt>Type</dt><dd><p> <code>string</code>
</p></dd><dt>Value</dt><dd><p> <code>default</code> or <code>screenspace</code>. Defaults to <code>default</code>.
@@ -1804,7 +1845,7 @@ non-shader data.</p>
<span class="line"></span> name <span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;Glossy metal&quot;</span><span class="hljs-punctuation">,</span>
<span class="line"></span> reflections <span class="hljs-punctuation">:</span> screenspace
<span class="line"></span><span class="hljs-punctuation">}</span></code></pre>
<a class="target" name="lighting:shadowmultiplier">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/lighting:shadowmultiplier">&nbsp;</a><a class="target" name="toc4.2.29">&nbsp;</a><h3 id="lighting-shadowmultiplier"><a class="header" href="#lighting-shadowmultiplier">Lighting: shadowMultiplier</a></h3>
<a class="target" name="lighting:shadowmultiplier">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/lighting:shadowmultiplier">&nbsp;</a><a class="target" name="toc4.2.31">&nbsp;</a><h3 id="lighting-shadowmultiplier"><a class="header" href="#lighting-shadowmultiplier">Lighting: shadowMultiplier</a></h3>
<p>
<dl><dt>Type</dt><dd><p> <code>boolean</code>
</p></dd><dt>Value</dt><dd><p> <code>true</code> or <code>false</code>. Defaults to <code>false</code>.
@@ -1826,7 +1867,7 @@ non-shader data.</p>
<span class="line"></span> material.baseColor = vec4(<span class="hljs-number">0.0</span><span class="hljs-punctuation">,</span> <span class="hljs-number">0.0</span><span class="hljs-punctuation">,</span> <span class="hljs-number">0.0</span><span class="hljs-punctuation">,</span> <span class="hljs-number">0.7</span>);
<span class="line"></span> <span class="hljs-punctuation">}</span>
<span class="line"></span><span class="hljs-punctuation">}</span></code></pre>
<a class="target" name="lighting:transparentshadow">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/lighting:transparentshadow">&nbsp;</a><a class="target" name="toc4.2.30">&nbsp;</a><h3 id="lighting-transparentshadow"><a class="header" href="#lighting-transparentshadow">Lighting: transparentShadow</a></h3>
<a class="target" name="lighting:transparentshadow">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/lighting:transparentshadow">&nbsp;</a><a class="target" name="toc4.2.32">&nbsp;</a><h3 id="lighting-transparentshadow"><a class="header" href="#lighting-transparentshadow">Lighting: transparentShadow</a></h3>
<p>
<dl><dt>Type</dt><dd><p> <code>boolean</code>
</p></dd><dt>Value</dt><dd><p> <code>true</code> or <code>false</code>. Defaults to <code>false</code>.
@@ -1852,7 +1893,7 @@ non-shader data.</p>
<center><div class="image" style=""><a class="target" name="figure_transparentshadow">&nbsp;</a><a href="../images/screenshot_transparent_shadows.jpg" target="_blank"><img class="markdeep" src="../images/screenshot_transparent_shadows.jpg" /></a><center><span class="imagecaption"><b style="font-style:normal;">Figure&nbsp;36:</b> Objects rendered with transparent shadows and blurry VSM with a
</span></center></div></center>
</p>
<a class="target" name="lighting:clearcoatiorchange">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/lighting:clearcoatiorchange">&nbsp;</a><a class="target" name="toc4.2.31">&nbsp;</a><h3 id="lighting-clearcoatiorchange"><a class="header" href="#lighting-clearcoatiorchange">Lighting: clearCoatIorChange</a></h3>
<a class="target" name="lighting:clearcoatiorchange">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/lighting:clearcoatiorchange">&nbsp;</a><a class="target" name="toc4.2.33">&nbsp;</a><h3 id="lighting-clearcoatiorchange"><a class="header" href="#lighting-clearcoatiorchange">Lighting: clearCoatIorChange</a></h3>
<p>
<dl><dt>Type</dt><dd><p> <code>boolean</code>
</p></dd><dt>Value</dt><dd><p> <code>true</code> or <code>false</code>. Defaults to <code>true</code>.
@@ -1866,7 +1907,7 @@ non-shader data.</p>
<center><div class="image" style=""><a class="target" name="figure_clearcoatiorchange">&nbsp;</a><a href="../images/screenshot_clear_coat_ior_change.jpg" target="_blank"><img class="markdeep" src="../images/screenshot_clear_coat_ior_change.jpg" /></a><center><span class="imagecaption"><b style="font-style:normal;">Figure&nbsp;37:</b> The same rough metallic ball with a clear coat layer rendered
</span></center></div></center>
</p>
<a class="target" name="lighting:multibounceambientocclusion">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/lighting:multibounceambientocclusion">&nbsp;</a><a class="target" name="toc4.2.32">&nbsp;</a><h3 id="lighting-multibounceambientocclusion"><a class="header" href="#lighting-multibounceambientocclusion">Lighting: multiBounceAmbientOcclusion</a></h3>
<a class="target" name="lighting:multibounceambientocclusion">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/lighting:multibounceambientocclusion">&nbsp;</a><a class="target" name="toc4.2.34">&nbsp;</a><h3 id="lighting-multibounceambientocclusion"><a class="header" href="#lighting-multibounceambientocclusion">Lighting: multiBounceAmbientOcclusion</a></h3>
<p>
<dl><dt>Type</dt><dd><p> <code>boolean</code>
</p></dd><dt>Value</dt><dd><p> <code>true</code> or <code>false</code>. Defaults to <code>false</code> on mobile, <code>true</code> on desktop.
@@ -1886,7 +1927,7 @@ non-shader data.</p>
<center><div class="image" style=""><a class="target" name="figure_multibounceaoanimated">&nbsp;</a><a href="../images/screenshot_multi_bounce_ao.gif" target="_blank"><img class="markdeep" src="../images/screenshot_multi_bounce_ao.gif" /></a><center><span class="imagecaption"><b style="font-style:normal;">Figure&nbsp;39:</b> Brick texture rendered with multi-bounce ambient
</span></center></div></center>
</p>
<a class="target" name="lighting:specularambientocclusion">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/lighting:specularambientocclusion">&nbsp;</a><a class="target" name="toc4.2.33">&nbsp;</a><h3 id="lighting-specularambientocclusion"><a class="header" href="#lighting-specularambientocclusion">Lighting: specularAmbientOcclusion</a></h3>
<a class="target" name="lighting:specularambientocclusion">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/lighting:specularambientocclusion">&nbsp;</a><a class="target" name="toc4.2.35">&nbsp;</a><h3 id="lighting-specularambientocclusion"><a class="header" href="#lighting-specularambientocclusion">Lighting: specularAmbientOcclusion</a></h3>
<p>
<dl><dt>Type</dt><dd><p> <code>string</code>
</p></dd><dt>Value</dt><dd><p> <code>none</code>, <code>simple</code> or <code>bentNormals</code>. Defaults to <code>none</code> on mobile, <code>simple</code> on desktop. For
@@ -1905,7 +1946,7 @@ non-shader data.</p>
<center><div class="image" style=""><a class="target" name="figure_specularao">&nbsp;</a><a href="../images/screenshot_specular_ao.gif" target="_blank"><img class="markdeep" src="../images/screenshot_specular_ao.gif" /></a><center><span class="imagecaption"><b style="font-style:normal;">Figure&nbsp;40:</b> Comparison of specular ambient occlusion on and off. The effect is
</span></center></div></center>
</p>
<a class="target" name="anti-aliasing:specularantialiasing">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/anti-aliasing:specularantialiasing">&nbsp;</a><a class="target" name="toc4.2.34">&nbsp;</a><h3 id="anti-aliasing-specularantialiasing"><a class="header" href="#anti-aliasing-specularantialiasing">Anti-aliasing: specularAntiAliasing</a></h3>
<a class="target" name="anti-aliasing:specularantialiasing">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/anti-aliasing:specularantialiasing">&nbsp;</a><a class="target" name="toc4.2.36">&nbsp;</a><h3 id="anti-aliasing-specularantialiasing"><a class="header" href="#anti-aliasing-specularantialiasing">Anti-aliasing: specularAntiAliasing</a></h3>
<p>
<dl><dt>Type</dt><dd><p> <code>boolean</code>
</p></dd><dt>Value</dt><dd><p> <code>true</code> or <code>false</code>. Defaults to <code>false</code>.
@@ -1917,7 +1958,7 @@ non-shader data.</p>
</p></dd></dl></p><pre class="listing tilde"><code><span class="line"></span>material <span class="hljs-punctuation">{</span>
<span class="line"></span> specularAntiAliasing <span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">true</span></span>
<span class="line"></span><span class="hljs-punctuation">}</span></code></pre>
<a class="target" name="anti-aliasing:specularantialiasingvariance">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/anti-aliasing:specularantialiasingvariance">&nbsp;</a><a class="target" name="toc4.2.35">&nbsp;</a><h3 id="anti-aliasing-specularantialiasingvariance"><a class="header" href="#anti-aliasing-specularantialiasingvariance">Anti-aliasing: specularAntiAliasingVariance</a></h3>
<a class="target" name="anti-aliasing:specularantialiasingvariance">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/anti-aliasing:specularantialiasingvariance">&nbsp;</a><a class="target" name="toc4.2.37">&nbsp;</a><h3 id="anti-aliasing-specularantialiasingvariance"><a class="header" href="#anti-aliasing-specularantialiasingvariance">Anti-aliasing: specularAntiAliasingVariance</a></h3>
<p>
<dl><dt>Type</dt><dd><p> <code>float</code>
</p></dd><dt>Value</dt><dd><p> A value between 0 and 1, set to 0.15 by default.
@@ -1927,7 +1968,7 @@ non-shader data.</p>
</p></dd></dl></p><pre class="listing tilde"><code><span class="line"></span>material <span class="hljs-punctuation">{</span>
<span class="line"></span> specularAntiAliasingVariance <span class="hljs-punctuation">:</span> <span class="hljs-number">0.2</span>
<span class="line"></span><span class="hljs-punctuation">}</span></code></pre>
<a class="target" name="anti-aliasing:specularantialiasingthreshold">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/anti-aliasing:specularantialiasingthreshold">&nbsp;</a><a class="target" name="toc4.2.36">&nbsp;</a><h3 id="anti-aliasing-specularantialiasingthreshold"><a class="header" href="#anti-aliasing-specularantialiasingthreshold">Anti-aliasing: specularAntiAliasingThreshold</a></h3>
<a class="target" name="anti-aliasing:specularantialiasingthreshold">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/anti-aliasing:specularantialiasingthreshold">&nbsp;</a><a class="target" name="toc4.2.38">&nbsp;</a><h3 id="anti-aliasing-specularantialiasingthreshold"><a class="header" href="#anti-aliasing-specularantialiasingthreshold">Anti-aliasing: specularAntiAliasingThreshold</a></h3>
<p>
<dl><dt>Type</dt><dd><p> <code>float</code>
</p></dd><dt>Value</dt><dd><p> A value between 0 and 1, set to 0.2 by default.
@@ -1936,7 +1977,7 @@ non-shader data.</p>
</p></dd></dl></p><pre class="listing tilde"><code><span class="line"></span>material <span class="hljs-punctuation">{</span>
<span class="line"></span> specularAntiAliasingThreshold <span class="hljs-punctuation">:</span> <span class="hljs-number">0.1</span>
<span class="line"></span><span class="hljs-punctuation">}</span></code></pre>
<a class="target" name="shading:customsurfaceshading">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/shading:customsurfaceshading">&nbsp;</a><a class="target" name="toc4.2.37">&nbsp;</a><h3 id="shading-customsurfaceshading"><a class="header" href="#shading-customsurfaceshading">Shading: customSurfaceShading</a></h3>
<a class="target" name="shading:customsurfaceshading">&nbsp;</a><a class="target" name="materialdefinitions/materialblock/shading:customsurfaceshading">&nbsp;</a><a class="target" name="toc4.2.39">&nbsp;</a><h3 id="shading-customsurfaceshading"><a class="header" href="#shading-customsurfaceshading">Shading: customSurfaceShading</a></h3>
<p>
<dl><dt>Type</dt><dd><p> <code>bool</code>
</p></dd><dt>Value</dt><dd><p> <code>true</code> or <code>false</code>. Defaults to <code>false</code>.

View File

@@ -250,7 +250,7 @@ execution profile data.</p>
<i class="fa fa-angle-left"></i>
</a>
<a rel="next prefetch" href="../notes/libs.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
<a rel="next prefetch" href="../notes/framegraph.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
<i class="fa fa-angle-right"></i>
</a>
@@ -264,7 +264,7 @@ execution profile data.</p>
<i class="fa fa-angle-left"></i>
</a>
<a rel="next prefetch" href="../notes/libs.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
<a rel="next prefetch" href="../notes/framegraph.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
<i class="fa fa-angle-right"></i>
</a>
</nav>

Some files were not shown because too many files have changed in this diff Show More