Commit Graph
804 Commits
Author SHA1 Message Date
Romain Guy cebc83e8fa Fix the Android filamesh file loader (#709)
* Fix the Android filamesh file loader

The loader was not updated to support the SNORM16 format now sometimes
used to encode UV sets in filamesh files.

Fixes #708

* Update android/samples/image-based-lighting/app/src/main/java/com/google/android/filament/ibl/MeshLoader.kt
2019-01-15 16:11:34 -08:00
Ben Doherty b3cd6a7f59 Add initial MaterialBuilder JNI (#707)
* Add initial MaterialBuilder JNI

* Move into android/filamat-android
2019-01-15 16:07:42 -08:00
Romain Guy c8f5190099 Fix Windows build 2019-01-15 15:13:13 -08:00
Romain Guy 28ab087f79 Revert doubleSided hack in glTF loading 2019-01-15 14:17:22 -08:00
Romain Guy e66aeb0c94 Fix a couple of glTF issues: (#706)
- baseColorFactor.a was not taken into account
- Some glTF files do not set `doubleSided` properly, so here we assume
  that non-opaque materials are double-sided. We may need to revisit
  this decision later...
2019-01-15 10:26:20 -08:00
Philip Rideout 749817b64b Add the official TypeScript annotations for gl-matrix to third_party.
Filament supports (but does not require) gl-matrix, and our TypeScript
annotations will need to use this file to support clients that use
gl-matrix.
2019-01-15 23:22:06 +05:30
Philip Rideout 1b18724b6b Add TypeScript to Kokoro for web for testing.
This preps for an upcoming regression test that ensures our TypeScript
annotations are valid.
2019-01-15 23:21:57 +05:30
Romain Guy ff5a2a7a99 Peek the right dimensions for the IBL in Android samples (#704)
Fixes #701
2019-01-15 09:47:41 -08:00
Philip Rideout 125f79e5e0 Allow Java / Kotlin to enable the experimental Vulkan backend.
We still do not compile the Vulkan backend for Android by default, this
simply makes it possible to use the samples on Vulkan with a one-line
change, which is useful for testing purposes.

This change also makes it so that the materials used for the samples
include SPIR-V. This makes them fatter but they are merely samples.

I still consider Vulkan on Android to be experimental, there are some
features that need to be implemented.
2019-01-15 23:00:18 +05:30
Romain Guy fac084dfdf Update Markdeep to latest version (2018/12) 2019-01-14 15:53:14 -08:00
Romain Guy f8ebc047e0 Fix the build 2019-01-14 15:31:17 -08:00
Romain Guy 00f6fa24f7 Code cleanup 2019-01-14 14:57:23 -08:00
Romain Guy 0394aeb23b Add specular anti-aliasing properties to materials (#697)
* Add specular anti-aliasing properties to materials

curvatureToRoughness
limitOverInterpolation

These techiques were supposed to be enabled by default on
desktop but it turns out they were broken. They must now
be enabled manually on each material instead (and work on
mobile).

* Update docs/Materials.md.html
2019-01-14 12:25:51 -08:00
Romain Guy c4989da047 Upgrade sample projects to Android Studio 3.3 (#700) 2019-01-14 11:50:44 -08:00
Ben Doherty 60363e518d Remove Metal layer hack for MoltenVK (#693)
* Remove Metal layer hack for MoltenVK

* Remove define

* Remove call to displaySyncEnabled
2019-01-14 10:35:26 -08:00
Damianno19 2a74397101 Incorrect order of arguments in glBlendFuncSeparate function call (#698) 2019-01-12 11:56:30 -08:00
Ben Doherty 0cccbda9b9 Move call to endFrame after commit (#696) 2019-01-11 15:42:34 -08:00
Ben Doherty 0c1fdc88ec Fix iOS hello-triangle sample (#694) 2019-01-11 13:48:00 -08:00
Philip Rideout 8228deb209 Add a multi-material model and JS demo.
This is a more complex test than suzanne because it has multiple
materials and exercises the named materials functionality in
loadFilamesh.

This also exercises our glTF-to-Filamesh pipeline at build time.

See issue #663
2019-01-11 09:18:41 +05:30
Romain Guy 8029ad5cc3 Add missing getWorldFromClip() API (#692)
Fixes #671
2019-01-10 16:35:00 -08:00
Ben Doherty 045274bbdb Use glslminifier to minifiy shaders for Release builds (#690) 2019-01-10 10:23:23 -08:00
Pixelflinger 206512add0 this fix clean builds when using make 2019-01-10 09:04:58 -08:00
Philip Rideout f876171239 filamesh tool now generates dummy UV's if necessary.
filamesh requires UV's but some glTF test models, like CesiumMilkTruck,
do not provide UV's on nonlit parts (e.g. the truck windows). This makes
it so that these assets can be converted to filamesh somewhat more
gracefully.
2019-01-10 10:27:29 +05:30
Philip Rideout f96501215b Reduce number of texture lookups in gltf_viewer. 2019-01-10 08:17:30 +05:30
Philip Rideout 0158e7e858 JS API: loadFilamesh can now return material names.
See issue #663
2019-01-10 07:48:19 +05:30
Ben Doherty c6444fb502 Move sampler bindings outside of material blobs (#682) 2019-01-09 11:25:51 -08:00
Ben Doherty 60d304a83b Add glslminifier tool (#683) 2019-01-09 10:59:39 -08:00
Philip Rideout 422bf8631b Small assimp fixups for glTF => filamesh conversion.
This fixes some crashes when trying to convert CesiumMilkTruck.
2019-01-09 07:57:41 +05:30
Ben Doherty 013d735242 Destroy engine's default material (#681) 2019-01-08 13:40:02 -08:00
Romain Guy 3be10d816a Cleanup recent change to ImageOps (#678)
* Cleanup recent change to ImageOps

* Add missing sign
2019-01-08 07:20:20 -08:00
Romain Guy 9ce88e6e23 Improve skygen (#679)
Bring back the normalization and gamma correction command line flags,
render the ground in the lower half of the image.
2019-01-08 07:19:50 -08:00
nicebyte 83c40e6664 Make 4-channel versions of certain image operations. (#676)
Background: with the Vulkan backend, RGB8 textures do
not work (at least not on my hadrware). This makes me unable to run some
examples, because they use normal maps in RGB8 format.

It appears that the following commit addresses the problem by adding a
special command line option to mipgen:
https://github.com/google/filament/commit/8dda07bf2c19f9ebd8ab499ca2c3849d7b1f031f

However, processing normal maps with this option does not work: certain
assertions in the image library fail.

This PR changes these functions in the image library to handle 4-channel
images instead of failing.
2019-01-07 15:16:00 -08:00
gstanlo 28f2806beb Improves linear to srgb conversion functions (#675)
* Improves linear to s/rgb

Adds rounding to nearest whole integer, supports copying over an alpha channel for linear to srgb conversion. Code would previously incorrectly apply sRGB conversion to alpha.

* reformatting previous change
2019-01-04 10:46:20 -08:00
shartte d37e21f4ea Use different capacities for lights and renderables since there's always gonna be a light, even if there are no entities (#666) 2019-01-04 08:11:37 -08:00
Ben Doherty d113af8afb Add return 0 to main functions to avoid crashes on Windows (#674) 2019-01-03 16:59:34 -08:00
shartte f676d3d3ea Add constexpr constructor to StaticString (#659)
Fixes a header usage problem for MSVC, which complains about StaticString not having a constexpr constructor thus making the "make" method not constexpr.
2018-12-24 08:51:18 +01:00
shartte cd2786a2ef Fixes #653: Skin normals/tangents before applying world space transform (#656) 2018-12-24 08:50:29 +01:00
shartte 5ea35ab87e Removed outdated documentation about static lights (#662) 2018-12-22 15:57:15 +01:00
gstanlo c21d11e20f Fixes LinearImage memory leak (#658)
LinearImage leaks memory if assigned to itself, this ensures the old LinearImage::SharedReference object will be deleted first
2018-12-21 06:42:52 +01:00
Ben Doherty 8fe11a067d Include unwindows in Frustum and DriverEnums (#649)
* Include unwindows in Frustum and DriverEnums

* Distribute unwindows.h
2018-12-17 18:20:32 -08:00
Ben Doherty 67ffa91843 Fix Windows Debug builds (#648)
* Fix Windows Debug builds

* Use NDEBUG for Noop driver files
2018-12-17 17:15:22 -08:00
Ben Doherty 55fbb300ca Update README for VS 2017 (#647) 2018-12-17 14:00:43 -08:00
Romain Guy 4901f6f72a Fix FXAA computations in mediump (#643)
* Fix FXAA computations in mediump

UV coordinates computed in highp should be passed to the FXAA function
in highp as well. This change also fixes a potential division by 0 which
was causing dir1 to have components set to inifinity, thus breaking the
texture sampling calls below. We fix this with an early exit when a
potential division by 0 is detected. The original code contained a bias
to try to avoid this problem but that bias was not always enough. It
was frequent in mediump to cancel out the bias.

* Update shaders/src/fxaa.fs

Co-Authored-By: romainguy <romainguy@curious-creature.com>
2018-12-14 22:48:26 -08:00
Mathias Agopian cfb9c03226 Improve JobSystem, especially under contention
- only signal waitAndRelease() when the corresponding job finishes and
only if there is waitAndRelease() active -- instead of signaling 
every time a job ends.

- don't surrender time slice when attempting to steal a job and it fails
as long as some queue has jobs.

- check that we have to wait, because taking the lock

- add a benchmark

This change more than doubles the amount of jobs we can handle per
second (~965,000 jobs/s on Pixel3)
2018-12-14 16:01:17 -08:00
Mathias Agopian d6de2bf426 get rid of JobSystem::reset()
It was only used to clear the master job, instead the master job is
cleared when waited on.
2018-12-14 14:48:33 -08:00
Ben Doherty b5eb00bdb1 Fix shaders compilation with VS (#641) 2018-12-14 14:03:35 -08:00
Romain Guy ede9f7fdbb Speedup Android builds
We don't need libfilamat/spirv*/glslang for now. They greatly
reduce the time it takes to build our Android targets. We
may want to create a separate CI profile for filamat actually.
2018-12-13 16:03:39 -08:00
Romain Guy eaf790aaa7 Improve rendering to TextureView (#635)
* Improve rendering to TextureView

UiHelper wasn't calling the resize callback at init time when attaching
to a TextureView, but it was for a SurfaceView. This makes both code
paths consistent and fixes the standard samples if they are modified to
render to a TextureView.

This change also adds a new sample app that shows how to render into
a TextureView.

* Suppress warning

* Suppress another warning
2018-12-13 15:57:15 -08:00
Mathias Agopian 02b0eb3ae2 fix a potential crasher when copying the camera stream
there was a very small race, where we would dereference a pointer
that might not be set yet.
sceneform-1.7pr2
2018-12-13 10:51:28 -08:00
Mathias Agopian e38870ebf5 Improve JobSystem::wait
JobSystem::waitAndRelease used to spin to wait for the job to finish,
usually this wasn't a problem because the spinning thread was
able to handle other jobs. However, in cases where no job was
available it would actually spin in burn cpu cycles.

we now use a (separate) condition variable to handle that case.
2018-12-13 10:50:52 -08:00