Commit Graph

593 Commits

Author SHA1 Message Date
Philip Rideout
0d476b9f6d Fix debug builds. 2018-11-19 15:45:40 -08:00
prideout
694eab703c Remove usage of std::string in VulkanDriver. 2018-11-19 14:18:39 -08:00
Philip Rideout
b3dce967eb Rollback MeshAssimp enhancements.
This caused regressions with some of our samples like vk_hellopbr:

- For the new 1x1 textures, RGB isn't accepted by Vulkan and Metal.
  Currently these platforms require RGBA, although we plan on adding
  reshaping functionality for the future.
- Too many texture samplers in a single shader, this causes a run time
  error. This could be alleviated by creating an atlas.
- vk_hellopbr assumes that all materials have a "metallic" param.

Going forward, we plan on creating a new library that avoids MeshAssimp,
so for now let's just disable gltf_viewer.
2018-11-19 14:18:12 -08:00
Philip Rideout
1413b4d622 Fix path in vk_texturedquad 2018-11-19 14:17:13 -08:00
magicwhale
fc0d587b40 Added support for more features in gltf_viewer sample 2018-11-19 09:27:08 -08:00
magicwhale
1d392d38bd updated assimp 2018-11-19 09:27:08 -08:00
magicwhale
bc38c8a773 Edited MeshAssimp and added gltf_viewer sample code 2018-11-19 09:27:08 -08:00
Philip Rideout
84d2fb222b Flesh out JS bindings a bit. 2018-11-16 17:21:44 -08:00
Philip Rideout
1ed8618cca Refresh website to publish new tutorial. 2018-11-16 17:21:18 -08:00
Philip Rideout
edb545919a Fix regression with non-Vulkan backends.
This fixes the "shader is not ASCII" error seen with GL backend,
introduced when we changed blob ownership semantics to accommodate
shader compression. It was due to missing null terminators.

We actually never bothered including the trailing null in blob length,
which was wrong but happened to work because the BlobDictionary held a
weak reference to chunk data. SInce it now holds an actual copy, the
lack of null caused our strings to contain garbage memory.
2018-11-16 15:43:41 -08:00
Philip Rideout
e652507315 Tutorial fixups per code review feedback. 2018-11-16 14:09:41 -08:00
Philip Rideout
ffff8437ba Add tutorial that describes compression and async loading. 2018-11-16 14:09:41 -08:00
Philip Rideout
b2a2da532a Fix Android-with-Vulkan build. 2018-11-16 12:07:23 -08:00
Philip Rideout
e3a20e0dfe Fix Linux build failure. 2018-11-16 12:07:23 -08:00
Philip Rideout
2d0b2050fc Fix iOS build failure. 2018-11-16 12:07:23 -08:00
Philip Rideout
b83c82ea9b Enable SMOLV compression. 2018-11-16 12:07:23 -08:00
Romain Guy
0938051579 Fix docs 2018-11-15 16:57:16 -08:00
Philip Rideout
e0fd196530 Exclude SMOL from Vulkan-free builds. 2018-11-15 16:55:40 -08:00
Philip Rideout
55eaad9450 Add smol-v to third_party.
Since we use this for decoding, this adds a dependency to the core
filament renderer which in practice is only used for Vulkan. However
this is a tiny library, so it's simplest just to always include it.

The next PR will add the actual compression / decompression code to
filaflat and filamat. Here are the preliminary results.

   102K =>  29K  aiDefaultMat.filamat
   102K =>  29K  aiDefaultTrans.filamat
    21K => 5.0K  bakedColor.filamat
    22K => 5.2K  bakedTexture.filamat
    21K => 5.0K  depthVisualizer.filamat
    40K =>  10K  groundShadow.filamat
   102K =>  29K  sandboxCloth.filamat
   125K =>  36K  sandboxLit.filamat
   126K =>  36K  sandboxLitFade.filamat
   126K =>  36K  sandboxLitTransparent.filamat
   109K =>  31K  sandboxSubsurface.filamat
    21K => 4.9K  sandboxUnlit.filamat
    21K => 4.9K  transparentColor.filamat

Both the "before" and "after" numbers are excluding non-Vulkan targets,
and I also changed our CMakeLists to build filamat instead of inc.
2018-11-15 16:55:40 -08:00
Philip Rideout
d94a1610a5 Fix minor Vulkan warning. 2018-11-15 14:49:17 -08:00
Philip Rideout
307645c7ce Add Vulkan support for depth offset and face culling. 2018-11-15 08:29:29 -08:00
Philip Rideout
a5cdb89107 Handle Vulkan ClipSpace in GLSL rather than C++.
Recall that Vulkan has a right-handed NDC system. Currently, our Vulkan
backend is not handling VERTEX_DOMAIN_DEVICE correctly, but we didn't
notice because the culling mode is not honored yet (a separate PR is on
the way for that).

To fix this, we considered adding a shader-based fixup only for the
device domain and keeping our Vulkanish projection matrix as-is.
However, this would cause the skybox shader to compute an incorrect
wrong eye vector due to in the inconsistent definition of clip space.

After discussion with Mathias and Ben, we decided that the most elegant
fix is for Filament to have only one canonical clip space, which for
now is the clip space that OpenGL requires.

Ben pointed out that spirv-cross has a flag for injecting shader-based
fixups. However we don't invoke spirv-cross for the Vulkan target, and
it's easy just to do this on our own.
2018-11-15 08:08:16 -08:00
Romain Guy
f1c2c39a3d Cleanup matc a little bit (#488) 2018-11-14 11:58:06 -08:00
Vallentin
81e8035cbb Fixed typos (#487) 2018-11-14 09:19:04 -08:00
Mathias Agopian
870d15b9ab Add MaterialInstance::setPolygonOffset()
The polygon offset can now be set through MaterialInstance. 
USE WITH CAUTION, this impacts performance negatively.
2018-11-13 19:27:52 -08:00
Mathias Agopian
87d66b41d5 Add polygon offset to the driver API 2018-11-13 19:27:52 -08:00
Mathias Agopian
825a72df10 The driver Draw() command now takes a PipelineState
PipelineState contains the program and raster state, more
state might be added in the future. Currently it is passed by value
and doesn't have a HwHandle, but this may change in the future.
2018-11-13 19:27:52 -08:00
Ben Doherty
74573c7ce4 Fix undefined symbols issue with web builds (#482) 2018-11-13 18:11:03 -08:00
Philip Rideout
17003106d2 Prep for new JavaScript tutorial.
This adds a few new functions to the JavaScript bindings. It also adds
our JavaScript docs into the CMake build system for machines that meet
the Python requirements.
2018-11-13 17:27:34 -08:00
Mathias Agopian
f011a212bd Minor clean-ups of Program 2018-11-13 16:02:44 -08:00
Philip Rideout
73a2ef7944 Add favicon. 2018-11-13 12:07:57 -08:00
Philip Rideout
7c2c4f3b11 Fix parquet wrap mode. 2018-11-13 12:07:47 -08:00
Philip Rideout
0faf7bbcb6 Publish Hugo site and web tutorials.
This performs the steps described in site/README in order to publish
the Hugo site to GitHub Pages:

    https://google.github.io/filament
2018-11-13 11:24:41 -08:00
Philip Rideout
904573b374 Incorporate feedback into Hugo site. 2018-11-13 10:57:20 -08:00
Philip Rideout
df3c2b74fd Add two-column mobile-friendly Hugo site.
This is a simple place to host WebGL demos and tutorials, we can prettify later. It will show up at:

    https://google.github.io/filament/

The hugo config specifies the output holder to be ../docs which is where our GitHub Pages site is located.

Note that this commit adds the *source* to the site, it does not publish the actual site. When we're ready to publish the actual site, we'll do:

```terminal
cd site ; hugo ; cd ..
git add docs ; git commit
```
2018-11-13 10:57:20 -08:00
Philip Rideout
037a0007c2 Disable depth prepass for WebGL.
WebGL does not always honor the invariant GLSL decoration, so we cannot
allow the depth prepass on web.

This fixes the black flakes seen with the Intel HD Graphics 615 in
Pixelbook laptops.
2018-11-13 09:22:08 -08:00
Mathias Agopian
bc3aee118a code size and performance optimizations (#472)
* Clean-up EntityManager a bit

- use tsl::robin_set instead of std::set (which should have been unordered::set
  anyways).

- getListeners() now returns a vector which avoids to traverse a set twice.
  Turns out that copying the set wasn't as efficient as I thought.

* Improve jobsystem a bit

We recently added a job reference counting mechanism, but we were a bit
too aggressive about taking/release references.

Also make the API more complete by adding explicit retain/release,
which is needed to allow several threads to wait on the same job.

Also improve futex code by inlining it.
2018-11-12 14:11:31 -08:00
Philip Rideout
3407302954 Minor suzanne cleanup. 2018-11-08 16:21:54 -08:00
Philip Rideout
f4806461ee Fix JavaScript leaks with BufferDescriptor.
Fixes #429
2018-11-08 16:17:29 -08:00
Philip Rideout
207d4ea4c1 Fix JS API leaks by auto-deleting builders, etc.
While this solves the builder leak, it does not solve the tiny leak
incurred every time you call `getInstance` on a component manager
without calling embind's `delete` method afterwards. Since there's no
way to auto-delete component instances, this CL fixes up our sample
code and docstrings.

Fixes #429
2018-11-08 16:17:29 -08:00
Mathias Agopian
f8f24f492f minor typo / spelling / clang-tidy fixes (#468)
* Minor clean-ups

- fix a couple usage of std::function
- fix a couple usage of std::string
- remove ALIGN_LOOP, which didn't work
- fix a couple explicit/noexcept
- virtual -> override

* Fix spelling typos and other minor clang-tidy
sceneform-1.6pr6
2018-11-08 11:50:00 -08:00
Philip Rideout
5fb0696fb7 Resurrect the JS memory leak test (#429) 2018-11-08 11:16:41 -08:00
Philip Rideout
75ffbe13be Fix typos. 2018-11-07 16:28:57 -08:00
Philip Rideout
bf77a33e1f Include filament-js README in npm package. 2018-11-07 16:14:39 -08:00
Philip Rideout
b9bfda5704 The JS API now supports compressed textures. 2018-11-07 16:12:55 -08:00
Philip Rideout
ee5b0268fd Introduce KtxUtility to make it easier to translate enum values. 2018-11-07 16:12:55 -08:00
Philip Rideout
5f05180d0f Update "Directory structure" in toplevel README.
I don't think it's useful to indent the entire tree, so this removes
the redundant root. More importantly, it adds the "web" folder. :)
2018-11-07 10:48:22 -08:00
Ben Doherty
cf7e49f96a Fix max anisotropy in Vulkan backend (#466) 2018-11-07 10:46:49 -08:00
Philip Rideout
a052d6cf49 Fix STREAM uniform buffers for web. v1.0.0 2018-11-06 13:50:49 -08:00
Mathias Agopian
591c9f2454 Fix a crasher when allocating the last Job
Instead of returning nullptr, the pool allocator returned an
invalid pointer.
2018-11-06 13:44:35 -08:00