Commit Graph

3239 Commits

Author SHA1 Message Date
Philip Rideout
094e7169cc Introduce a configurable test case generator.
This lets us generate long lists of settings permutations by writing a
simple JSON spec. For example, the following spec would generate six
`Settings` objects, all of which have SSAO enabled. See the unit test
for a larger example.

```
{
    "name": "viewopts",
    "base": { "view.ssao.enabled": true }
    "permute": {
        "view.dithering": ["NONE", "TEMPORAL"],
        "view.sampleCount": [1, 4, 8]
    }
}
```
2020-09-30 16:17:23 -07:00
Ben Doherty
44d4694c29 Add JNI binding for vsm msaa samples (#3139) 2020-09-30 16:12:45 -06:00
Ben Doherty
42862ddcde Fix RELEASE_NOTES 2020-09-30 14:53:01 -06:00
Ben Doherty
236ed9680c Add MSAA option to VSM (#3084) 2020-09-30 14:51:40 -06:00
Ben Doherty
229fdc9be5 Add View::setShadowType JNI binding (#3094) 2020-09-30 13:20:39 -06:00
Ben Doherty
4af0cdfd4d Use light space Z as VSM depth metric (#3131) 2020-09-30 12:31:03 -06:00
Philip Rideout
451fac7d7b Fix writeJson() for vectors and enums. 2020-09-30 11:12:10 -07:00
Philip Rideout
617dc932bb Fix unit test failure. 2020-09-29 19:59:53 -07:00
Pixelflinger
583c1c07cf SSCT optimizations and fixes
- Use lower depth LOD as the cone radius increases.
  This is the same technique we use for SAO.
  The better cache access significantly improve performance.
  On a test on Pixel4 at 585MHz, SAO pass improves by 30%.
  This also helps the algorithm scale with the shadow distance.

- Shadow direction/length no longer dependent on aspect-ratio and camera
  orientation.
  This is fixed by doing all the computations in screen-space instead of 
  normalized screen space.

- Shadow parameters are no longer dependent on the field of view.

- Also rename dominantLightShadowing.fs to ssct.fs

- remove zoom parameter, it wasn't very useful.
2020-09-29 17:00:32 -07:00
Benjamin Doherty
9e01348dd5 Fix CocoaPod Podspec for Xcode 12 2020-09-29 12:25:13 -06:00
Philip Rideout
ec2579bad5 Viewer Settings: remove SSCT scale. 2020-09-29 10:47:35 -07:00
Philip Rideout
e5a9a259de Fix build break. 2020-09-29 10:47:35 -07:00
Philip Rideout
6472f645fc viewer: add SCCT to JSON serializer. 2020-09-29 10:47:35 -07:00
Philip Rideout
e9ace4e5fb Add jsmn to third_party. 2020-09-29 10:47:35 -07:00
Philip Rideout
c119f9bdca gltf_viewer: Re-use ViewSettings structs. 2020-09-29 10:47:35 -07:00
Philip Rideout
7997e4aa21 Introduce libs/viewer and serializable view settings.
This introduces the `viewer::Settings` struct, and a JSON reader /
writer.

This will be used for automated testing and for client / server
communication.

Note that `viewer::Settings` is closely associated with the
`filament::View` API; when updating the latter we will often need to
update the former, as well as some serialization code. This increases
the maintenance burden and I think we should consider using a parser
library like libclang or a macro-based reflection utility.

This PR also migrates SimpleViewer into libs/viewer and un-inlines its
implementation. It does not belong in gltfio because it has an imgui
dependency.
2020-09-29 10:47:35 -07:00
Pixelflinger
cdb0f20c6c Save some ALU by assuming the shape of the projection matrix 2020-09-28 10:53:30 -07:00
Pixelflinger
4da58ecb29 Fix mediump issue on mobile 2020-09-28 10:53:30 -07:00
Pixelflinger
075486724f Add JNI support for SSCT 2020-09-28 10:53:30 -07:00
Pixelflinger
530f41c29c fix light vector transform 2020-09-28 10:53:30 -07:00
Pixelflinger
5cbd80136c control the number of rays per pixel 2020-09-28 10:53:30 -07:00
Pixelflinger
bfd1de809a Implement screen space cone tracing (SSCT)
This is a technique from Naughty Dog used in TLOU2, where we compute
the "ambient" shadowing of a dominant light in screen-space.

This is currently integrated to the SSAO pass.
2020-09-28 10:53:30 -07:00
Pixelflinger
0f2993aec7 Decouple SSAO bilateral filter from quality setting 2020-09-28 10:53:30 -07:00
Pixelflinger
e8bb895c58 refactor SSAO shader a bit
the main change here is that we now have ssaoUtils which contains
utilities that will soon be shared with other "ambiant" effects.
2020-09-28 10:53:30 -07:00
Benjamin Doherty
f7fc2a0af6 Update RELEASE_NOTES for 1.9.2 2020-09-28 11:34:32 -06:00
Benjamin Doherty
42733c10b7 Bump version to 1.9.2 2020-09-28 11:34:32 -06:00
Philip Rideout
d8c7bba403 gltfio: Fix animation by clamping the per-channel interpolant.
Tested with the model in #3124 as well as Fox, BusterDrone, CesiumMan,
InterpolationTest, and VC.

Fixes #3124.
2020-09-26 09:26:40 -07:00
Romain Guy
50e5db4347 Add tasks to manage Sonatype releases (#3127)
* Add tasks to manage Sonatype releases

* Edit comments
2020-09-25 16:07:12 -07:00
Philip Rideout
7019629bcb Vulkan: fix final image barrier used for swap chain.
The image barrier must wait until all write operations are complete;
this was not set up correctly but somehow did not cause problems.
Also tried to document this better, since using an image barrier for
the swap chain seems to be an unusual thing to do (e.g. the Sascha
Willems demos do not do this).
2020-09-25 09:40:12 -07:00
Philip Rideout
5549adc020 JavaScript bindings: fix TextureUsage bitmask.
There's no really good solution, so this just keeps it simple and makes
is so that embind consumes an integer rather than an embind enum object.

Tested by hacking _createTextureFromImageFile.

Fixes #3028.
2020-09-24 15:53:20 -07:00
Philip Rideout
947d178f2b matdbg: stable ordering for anonymous materials.
For example, this makes it so that the primary material in Sponza
is *always* "untitled 0", which makes it easier to figure out which
material to modify.
2020-09-24 10:23:58 -07:00
Philip Rideout
29cd7bb6b4 matdbg: use Shift+Ctrl for navigation.
This avoids interference with both the default VSCode bindings and
Mission Control.
2020-09-24 09:54:19 -07:00
Philip Rideout
eb5d346e60 matdbg: repair keyboard navigation.
Recall that Ctrl + Up / Down navigates between materials while
Left / Right navigates between variants.

- Make this behavior more explicit in the documentation.
- Shortcuts now use the same ordering as the displayed list.
- Shortcuts now use Cmd on macOS instead of Ctrl to avoid conflict with
  Mission Control defaults.
2020-09-24 09:54:19 -07:00
Philip Rideout
1afb0e2ea4 matdbg: allow edits without trailing newline. 2020-09-24 09:54:11 -07:00
Philip Rideout
89485ae0ae matdbg: fix edits for large shaders.
If the websocket message exceeds a certain size, we might receive it
in chunks and civetweb does not auto-consolidate for us.

Fixed this by adding a length prefix to the edit command.
2020-09-24 09:53:59 -07:00
Philip Rideout
92e1e91261 matdbg: warn user when editing unused variant. 2020-09-24 09:53:59 -07:00
Philip Rideout
ac07719414 CString should allow arbitrary data. 2020-09-24 09:53:59 -07:00
Philip Rideout
4a604c2513 matdbg: do not hide anonymous materials
This change also makes it so that matdbg shows a numeric suffix to help
with duplicated names, and fixes a bug with names that start with
non-alpha characters.
2020-09-23 16:03:03 -07:00
Philip Rideout
22312b2090 cmgen / mipgen: add opt-in for ASTC / ETC support.
Block compression is currently only used when we invoke mipgen for the
suzanne demo. This PR makes it easy to disable.

Block compression is still enabled in our CMake build, but other build
systems can simply omit BlockCompression.{h,cpp} from imageio (as well
as the two third_party libs) and it will "just work".
2020-09-23 11:17:27 -07:00
Philip Rideout
1ebdb18eae gltfio: add async cancellation API 2020-09-23 10:53:55 -07:00
Philip Rideout
450fe214f9 Flip the shading normal when det < 0.
This was tested by replacing the node 0 scale in BusterDrone with
[-1, 1, 1].

For future reference, commit f728776 shows when we switched from
transpose(inverse()) to cof(). This was a good change, but before that
particular change, we had a "two wrongs made a right" situation for
mirrored normals.

Fixes #3001.
2020-09-22 16:54:44 -07:00
Philip Rideout
97c1f99cab gltfio: Fix "uniform not found" errors.
The equality operator for MaterialKey was missing some fields (also, its
ordering was inconsistent with the struct), which caused faulty behavior
in the material cache.

I ran into this bug when testing against a Blender-exported model that
has some materials with texture transforms, and some without.
2020-09-22 14:12:47 -07:00
Romain Guy
9830925a96 Disable clear coat layer IOR change in glTF files (#3104)
The glTF spec doesn't call for this and there are extensions
to deal with this manually.
2020-09-21 20:40:35 -07:00
Pixelflinger
c3975f2640 APIs to enable/disable screen space refraction
Just like with shadows, this is a toggle to entirely disable
screen space refraction.

Added missing getters, and minor refactoring.
2020-09-21 16:30:56 -07:00
Pixelflinger
6c8e134d01 Random engine should be owned by Engine
This way it can be used elsewhere.
2020-09-21 11:01:58 -07:00
Benjamin Doherty
a0fb396ba4 Update RELEASE_NOTES headings 2020-09-21 11:08:57 -06:00
Benjamin Doherty
b3a79bf82b Update RELEASE_NOTES for 1.9.1 2020-09-21 11:02:20 -06:00
Benjamin Doherty
35ace36b7d Bump version to 1.9.1 2020-09-21 11:02:11 -06:00
Pixelflinger
73f1ddfebf ssao: reduce creases caused by geometry tessellation
We borrow a page from the HBAO book here and allow to limit the angle
with the horizon of SSAO samples. This can help reducing the effects
of low tessellation, which tend to create unwanted creases with SSAO.
2020-09-20 22:34:34 -07:00
Pixelflinger
ed8db2f58f fix a recent regression with contact shadows
contact shadows wouldn't work if shadowmap-based shadows were not
enabled, in this case the (unneeded) shadow pass would run and
attempt to create the shadow-map with an incorrect size (0), which
would later crash/assert in the backend.
2020-09-20 22:34:14 -07:00