Commit Graph

4035 Commits

Author SHA1 Message Date
Philip Rideout
0a2fa36d5a API CHANGE: honor user-defined precision, rename SamplerPrecision. (#4287)
* API CHANGE: honor user-defined precision, rename SamplerPrecision.

matc now honors 'precision' on non-samplers in mat files, and
the filamat API now allows clients to specify precision for
non-samplers.

This involved flattening a union that is internal to filamat.

* MaterialBuilder: Add Java bindings for precision.
2021-07-09 17:32:08 -07:00
Mathias Agopian
0c244bc2ac Fix colorgrading as subpass
We were inserting the colorgrading subpass command between the
refracted and blended objects, instead of after all of them.

Another bad side effect of this was to trigger the refraction pass for
no reason.
2021-07-09 16:41:55 -07:00
Ben Doherty
67a49e5770 Add signposts to Metal backend (#4289) 2021-07-09 15:47:16 -07:00
Benjamin Doherty
a98395bee7 Add back pointer 2021-07-09 15:04:27 -07:00
Benjamin Doherty
26c9732b4e Fix, MSVC's std::sort fails on Zip2Iterator 2021-07-09 15:04:27 -07:00
Mathias Agopian
62787de97b Don't store Handle<> debug state inline
We use a hashmap instead, which won't change the behavior of the
HandleAllocator (due to the increased size of the handles) between
debug and release modes.
2021-07-09 15:04:10 -07:00
Mathias Agopian
830c379958 reduce size of HwIndexBuffer
this limits the index count to 27 bits
2021-07-09 15:04:10 -07:00
Mathias Agopian
1a24de8735 cleanup handle size comments 2021-07-09 15:04:10 -07:00
Philip Rideout
121489f2af Work around Qualcomm issue with point lights. (#4278)
Fixes #3602.
2021-07-09 12:52:23 -07:00
Mathias Agopian
0e7295a469 fix a warning in release 2021-07-09 11:35:11 -07:00
Mathias Agopian
602b3d0796 Sort and discard lights early
We always may need to discard lights because we have a limited 
number we can use in the shader. We now do this earlier, in particular
before we set up the shadowmaps.

Because we also have a limited (smaller) number of shadowmap, this 
allows us to automatically select the ones that are closer to the 
camera, which gives better results.
2021-07-09 11:26:56 -07:00
Mathias Agopian
fda06fe8a0 fix a few easy "fixmes" and "todos" 2021-07-09 10:25:22 -07:00
Philip Rideout
92628ade8e Remote UI: auto load last loaded model. (#4277)
The most recently loaded model is now automatically re-loaded if you
re-start the sampler-gltf-viewer app.

Super useful in my case for `rgb-lights.glb` :)
2021-07-09 08:46:58 -07:00
Romain Guy
b399d64024 Update README.md 2021-07-08 20:46:34 -07:00
Mathias Agopian
a8e8c04c7b Skip lighting/shadowing when possible
We can skip lighting in the areas fully shadowed, we can also skip
shadowing outside the radius of punctual lights.
2021-07-08 16:37:06 -07:00
Romain Guy
313b9944fd When IOR=1.0, there should be no transmission roughness (#4276)
* When IOR=1.0, there should be no transmission roughness

See https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/TransmissionRoughnessTest
for details.

* Use a smoothsteph instead

* Don't modify roughness twice
2021-07-08 16:08:55 -07:00
Romain Guy
5a61d28eee Add Java bindings for transparent shadow (#4272)
* Add Java bindings for transparent shadow

* Fix JNI binding typo

* Fix typo
2021-07-08 12:50:18 -07:00
Ben Doherty
4eb0937d21 matc: log error when input material definition is empty (#4273) 2021-07-08 11:34:46 -07:00
Romain Guy
a082e94235 Update RELEASE_NOTES.md 2021-07-08 10:32:39 -07:00
Romain Guy
9bd3684893 Add support for transparent shadows (#3298)
* Add support for transparent shadows

This solution uses an 8x8 Bayer matrix. We could find a better
noise. We also need better filtering of the shadow maps. A PCF
is barely enough and VSM fails without blurring.

* Use a fixed Bayer matrix, fix pre-caching of depth shaders

* Use gradient noise instead of fixed bayer pattern

* Update docs
2021-07-08 10:31:52 -07:00
Philip Rideout
0cd9fd9ad9 sample-gltf-viewer: fix remote control of IndirectLight. (#4267) 2021-07-07 20:41:12 -07:00
Mathias Agopian
efcc690f42 update remote ui 2021-07-07 17:45:58 -07:00
Mathias Agopian
1ed1a5efb6 Allow MSAA when post-processing is disabled
There was no good reason not allow this.
Fixes #2533
2021-07-07 17:19:57 -07:00
Mathias Agopian
2d7de6ecc0 enable up to 6 spot shadows
This is a trivial change since we moved the lightspace computation
in the fragment shader. The limitation to 6 is due to how we're storing
the culling result.
2021-07-07 17:19:42 -07:00
Romain Guy
4a1edc4281 Add gltf_viewer and material_sandbox to release archives (#4264) 2021-07-07 17:19:12 -07:00
Romain Guy
d6b32e5923 Remove support for Java/desktop builds (#4263)
* Remove support for Java/desktop builds

These builds are never tested nor used on our end. We cannot
guarantee their proper support. It should also be possible
for an app to handle this itself.

* Remove Tungsten since it cannot be compiled anymore
2021-07-07 17:18:58 -07:00
Philip Rideout
105ae8abb6 Update prebuilt MoltenVK to 1.2.182. (#4260) 2021-07-07 17:16:44 -07:00
Philip Rideout
1f33dad675 Update glslang. (#4258) 2021-07-07 15:27:18 -07:00
Mathias Agopian
90ee59512b don't crash when refraction pass is empty 2021-07-07 14:28:48 -07:00
Romain Guy
7f2a189641 Update docs 2021-07-07 13:50:37 -07:00
Romain Guy
1ab59ca35a Update to the latest version of Markdeep for local use (#4257) 2021-07-07 13:49:38 -07:00
Philip Rideout
5c0826963e Update spirv-tools. (#4255) 2021-07-07 13:28:59 -07:00
Mathias Agopian
7555fe6196 enforce CLAMP_TO_EDGE for external textures
Fixes #2978
2021-07-07 13:28:21 -07:00
Mathias Agopian
1dbb9c7ded HandleArena now can deal with running out of space
When HandleArena is full, we now revert to a slower system-heap
based mechanism. The problem is logged once. This allows the
system to continue to run.
2021-07-07 12:07:25 -07:00
Mathias Agopian
ac798c1350 moved HandleAllocator outside of the OpenGL backend
This means it can easily be used by our other backend.

HandleAllocator uses 3 pool (which currently can't be configured),
and is very efficient in terms of memory overhead and handle to
pointer conversion.

A Handle<> is just an offset into a large heap managed by the 3 pools.
2021-07-07 12:07:25 -07:00
Philip Rideout
00682bd911 Add simple ReadPixels performance test. (#4248)
* Add simple ReadPixels performance test.

This simply lets the gtest framework report the total test time, which
includes startup and teardown.  However we perform 100 runs of the
render+readback code to reduce the run-to-run variance. For 100 runs of
a 2000x2000 buffer, I see the following results on my mac:

- Vulkan: 1881 ms
- Metal: 1625 ms
- OpenGL: 978 ms

The test can be built & invoked like this:

```
./build.sh release backend_test_mac && \
    ./out/cmake-release/filament/backend/backend_test_mac -a opengl --gtest_filter="*ReadPixelsPerformance"
```

See also issue #4246.

* ReadPixels test: minor refactor.
2021-07-07 12:00:04 -07:00
Benjamin Doherty
ceced43e93 Update RELEASE_NOTES for 1.10.6 2021-07-07 10:58:31 -07:00
Benjamin Doherty
55fdc47e66 Release Filament 1.10.6 2021-07-07 10:57:56 -07:00
Philip Rideout
53a92451e6 ShadowMapManager: fix MSAN use-of-uninitialized-value.
The operator!= in std::array compares SPLIT_COUNT elements, which
is potentially greater than cascadeCount, which was the number of
initialized elements in splitPercentages.
2021-07-07 07:51:28 -07:00
Mathias Agopian
77016f34a5 More simplifications of the ShadowMapManager code
- the ShadowMap cache is now inline and doesn't use unique_ptr<>

- reduced the size of ShadowMap significantly, it used some temporary
  storage as member, but now that we have many of those, we shouldn't
  do that.

- removed some duplication of fields

- fixed some headers inclusion
2021-07-02 10:08:09 -07:00
Mathias Agopian
19db911d46 Use a custom command to handle color-grading subpass
This is cleaner and what custom commands are for.
2021-07-02 10:08:09 -07:00
Mathias Agopian
46a88c7ed8 Rework RenderPass allocations
Instead of managing a GrowingSlice<> more or less shared between
several RenderPass, RenderPass now works directly with an Arena which
owns the commands. We do this so RenderPass can be copiable, which is
useful for creating a RenderPass from a "template" RenderPass
(usually empty, but with some scene parameters set).

RenderPass is now a lot more self contained.

Execution of the commands is now done with a RenderPass::Execcutor
which can be obtained from a RenderPass.

This change led to some code clean-up as well.

We also had to improve Arena<> to be able to take a custom Area.
2021-07-02 10:08:09 -07:00
Philip Rideout
ca3b841974 gltfio: Add fast path for native material providers. 2021-07-01 16:11:55 -07:00
Philip Rideout
e9ff2157bc gltfio: Cache the JNI field ids for MaterialKey. 2021-07-01 16:11:55 -07:00
Philip Rideout
d270c42109 gltfio: Allow Java / Kotlin clients to customize MaterialProvider.
This adds some significant JNI glue in order to make the Java API for
gltfio materials much more consistent with C++, and create feature
parity between the two languages.

The motivation is to allow Java clients to provide their own
ubershader-based solution or filamat-based solution.

- The `MaterialProvider` Java class is now an interface.
- The `UbershaderLoader` Java class is now a concrete implementation.
- Users can now write their own provider class using Java / Kotlin.

To streamline the amount of JNI work that occurs at run time, the
MaterialProvider Java interface uses ints in a couple spots instead
of enums. This sacrafices some readability for Java clients who wish
to write their own provider, but makes the JNI much simpler.

This replaces #3975.
2021-07-01 16:11:55 -07:00
Philip Rideout
f4558fee1d Update remote UI. 2021-06-30 09:44:05 -07:00
Philip Rideout
86461663d8 Settings UI: LightManager ShadowOptions now affect all lights. 2021-06-30 09:42:00 -07:00
Mathias Agopian
fcca62ec6a spotlight light-space position moved to the fragment shader
We have a limited number of interpolants, and 2 were used for spotlights,
but this is a fairly uncommon case, so we move the calculation to the
fragment shader. A side effect of this is that we are not limited to 
two spot-light anymore from the shader's point of view.

This essentially adds a vector transform per fragment, but on the other
hand, it removes communication between the vertex and fragment shader,
as well as interpolation of the position.
2021-06-29 17:19:43 -07:00
Mathias Agopian
f6dde81a16 workaround drivers that don't implement textureSize() properly
On some qualcomm drivers, textureSize() with a level != 0 aborts the
pixel shader.
2021-06-29 10:12:38 -07:00
Romain Guy
d77e66d1e8 Update README.md 2021-06-28 23:08:33 -07:00