Commit Graph

728 Commits

Author SHA1 Message Date
Philip Rideout
8dda07bf2c mipgen: support generation of 4-band KTX files
This is useful because our Vulkan backend currently does not accept
3-band texture data. (although we intend to fix that soon)
2018-12-10 18:04:52 -08:00
Mathias Agopian
76b15e895a [MATERIALS BREAK] higher period clock
THIS CHANGE BREAKS MATERIALS.

This adds getUserTime() in shaders/materials, which returns the time
in second since Renderer::resetUserTime() was called.
Two values are provided, the time in second encoded as a float and
the difference between that and the double value, which together allows
to perform high precision time computation when needed.

This change allows longer running animations in materials. Using only
the float value, give millisecond resolution for more than 4h.
2018-12-10 16:28:07 -08:00
Philip Rideout
e3d0630704 Vulkan: fix mipmapping for 2D textures.
The dimensions passed into the VkBuffer-to-VkImage copy utility
specify a subregion for the copy, not the dimensions of the base level.

We were handling mipmapped cubemaps correctly, but mipmapped 2D images
were incorrect.
2018-12-10 16:23:55 -08:00
Romain Guy
e41dd027ab Enable optimization passes on materials with external samplers (#605)
* Enable optimization passes on materials with external samplers

Because external samplers are not properly supported by SPIRV and
associated library (spirv-cross and spirv-tools) we currently disable
all optimizations when we encounter a material with external samplers.

This however causes issues on some misbehaved drivers (not running
the optimizations has a side effect which causes a crash). To enable
the optimization pass we simply rely on the Vulkan codegen target to
substitute samplerExternal with sampler2D. We then analyze the output
GLSL (post-optimization) and revert the relevants sampler2D declarations
to samplerExternal declarations.

This fixup only occurs after optimization and for mobile targets and
if external samplers were declared.

* Address review comments
2018-12-10 12:02:59 -08:00
Romain Guy
3c89f901af Remove key fetch 2018-12-07 17:37:42 -08:00
Romain Guy
6ae21d3825 Add View::setFrontFaceWindingInverted() API (#602)
* Add View::setFrontFaceWindingInverted() API

This API can be used to flip all meshes in a render pass
inside out. This is useful for mirrored rendering.

This change also disables face culling on the default skybox
renderable. Since it is unlit, there is no downside to this
and the mesh being in the device vertex domain it can never
be backfacing unless front face winding is inverted.

* Track face winding state in Vulkan
2018-12-07 16:36:03 -08:00
Romain Guy
866c694977 Fix Linux build 2018-12-07 16:33:06 -08:00
Romain Guy
c11d6e549a Use the proper domain for the key 2018-12-07 16:19:27 -08:00
Romain Guy
4789e81ebc Require API level 21, not 24 (#599)
* Require API level 21, not 24

Fixes #594

* Update README.md
2018-12-07 16:17:57 -08:00
Romain Guy
a042cc7b8b Fix apt-get key issue 2018-12-07 16:16:52 -08:00
Mathias Agopian
4d9788ffb9 improve skinning memory usage and udpates
- use the exact required size for bone data instead of always the max
of 256 bones. This also reduces the amount of data to update and
copy into the command stream.

- also get rid of the "reuse component" optimization, which is less
needed now that renderables don't have their own transform UBO.
2018-12-07 16:07:49 -08:00
Romain Guy
5bbdc673f2 Remove CMake warning 2018-12-07 15:11:24 -08:00
magicwhale
4be93cbdd6 Added warning about textures using the pbrSpecularGlossiness gltf extension in MeshAssimp (#597) 2018-12-07 14:33:00 -08:00
shartte
556baee70c Allow for the use of a shared CRT when compiling for release mode on Windows (#581) 2018-12-07 13:32:09 -08:00
magicwhale
2633edf2c4 Changed MeshAssimp to use snorm16 if uv values are in the range [-1, 1] (#592)
* grouped MeshAssimp arguments into struct

* added snormuv optimization to MeshAssimp and changed snormuv optimization range from [0, 1] to [-1, 1] in filamesh
2018-12-07 13:03:18 -08:00
Philip Rideout
1feb07ba8b Add webpack / TypeScript demo. 2018-12-07 09:50:06 -08:00
Philip Rideout
083a60938e Update web site to v1.1.0 (includes KTX fixes) 2018-12-07 09:43:30 -08:00
Philip Rideout
f4f6fb75dc Support JPEG textures in the JS API.
This restores the canvas-based decoding method that was removed in #214,
but only for JPEG images. We continue to decode PNG images in C because
canvas-decoding mucks with alpha and prevents us from reading 16-bit
PNG.
v1.1.0
2018-12-07 08:15:54 -08:00
Philip Rideout
71e9c13b94 Add TypeScript annotations file (hand authored for now) 2018-12-06 15:43:11 -08:00
Romain Guy
2cdac665db Rename debug APIs 2018-12-06 14:23:20 -08:00
Philip Rideout
c9752d8310 Update zeux/meshoptimizer 2018-12-06 13:33:22 -08:00
Benjamin Doherty
79764e7e02 Use -mssse3 flag with clang-cl 2018-12-06 13:33:22 -08:00
Philip Rideout
33383ab7fb Update zeux/meshoptimizer 2018-12-06 13:33:22 -08:00
Philip Rideout
6f601e6021 Update KTX files and allow glFormat = LUMINANCE 2018-12-06 10:33:49 -08:00
Sebastian Hartte
aaf2909194 Correctly set glTypeSize in the tools, and use sized formats for internalFormat 2018-12-06 10:33:49 -08:00
Sebastian Hartte
339483b8e2 Consider the correct KTX header attribute to determine the data format 2018-12-06 10:33:49 -08:00
Mathias Agopian
669c962d2b Fix CommandStream logging build 2018-12-06 08:53:48 -08:00
Sebastian Hartte
cfa486275a Install the image library as well 2018-12-05 17:57:20 -08:00
Mathias Agopian
c205499695 port filament_benchmark to google benchmark framework 2018-12-05 17:19:47 -08:00
Mathias Agopian
7ab25ff4a2 improve libmath benchmark 2018-12-05 17:19:47 -08:00
Philip Rideout
8bb68b3c55 Rename MeshIO class to MeshReader.
This makes the name symmetrical with MeshWriter.
2018-12-05 17:15:52 -08:00
Philip Rideout
beaf751604 filamesh: Compress attributes individually.
This further reduces compressed suzanne from 333489 bytes to 272761.

Tested with vk_hellopbr and tutorial_suzanne.html

Issue #558
2018-12-05 17:15:52 -08:00
Philip Rideout
6c55b3b989 filamesh: Add support for COMPRESSION.
Note that the WebGL build uses filameshio, but Android does not. Our
Android samples therefore do not yet understand the compressed format.
For web, I measured the before / after:

```
BEFORE: filament.wasm = 505796, suzanne.filamesh = 521476
 AFTER: filament.wasm = 510915, suzanne.filamesh = 333489
```

Issue #558
2018-12-05 13:20:55 -08:00
magicwhale
27f8dbef21 Added support to gltf_viewer for multiple UV coordinates (#578)
gltf_viewer can now display models that use both UV0 and UV1 coordinates for textures.
2018-12-05 12:35:26 -08:00
Philip Rideout
b4b12914a1 Add bitcast to utils. 2018-12-04 17:56:37 -08:00
Philip Rideout
ff2da6e3b4 Add zeux/meshoptimizer to third_party.
This also adds it as a dependency to filameshio. This does not seem to
increase the size of the WebGL build even though filameshio is a
dependency, perhaps because we are not using it yet.
2018-12-04 16:36:56 -08:00
Romain Guy
f8ac76f62a Fix typo in CMakeLists for glslang 2018-12-04 16:26:49 -08:00
Philip Rideout
fff76bfa3e Resurrect the NOOP driver. 2018-12-04 14:34:16 -08:00
magicwhale
8aa52575fa updated assimp (#577) 2018-12-04 13:46:32 -08:00
Ben Doherty
f05b2f47a8 Fix use of UV0 and UV1 coordinates (#576)
* Fix use of UV1

* Add a test case

* Spelling
2018-12-04 13:23:01 -08:00
Ben Doherty
2b6499fb18 Deprecate MaterialBuilder::postprocessor (#569)
* Deprecate postprocessor

* Remove unimplemented method
2018-12-04 10:11:52 -08:00
Philip Rideout
1ec037aeca filamesh: Remove duplicated code. 2018-12-03 14:18:12 -08:00
Philip Rideout
a7d6af8d22 filamesh: Add support for TEXCOORD_SNORM16. 2018-12-03 14:18:12 -08:00
Philip Rideout
0af274fe0e filamesh: introduce MeshWriter class.
This simplifies main.cpp so that it only does assimp stuff.
2018-12-03 14:18:12 -08:00
गोपालः शर्माः
99301c6287 Fixed typo (#571)
* Removed extra slash

* Fixed typo
2018-12-03 12:30:55 -08:00
गोपालः शर्माः
97dfd1ea95 Removed extra slash (#570) 2018-12-03 12:13:41 -08:00
Mathias Agopian
6d68a4a4c6 libmath benchmarks 2018-12-03 11:58:30 -08:00
magicwhale
b902a90285 Changed MeshAssimp to dynamically generate materials with filamat (#563) 2018-12-03 10:15:47 -08:00
Philip Rideout
ab4e9b5787 Disable test_filameshio, it requires OpenGL. 2018-12-03 02:12:52 -08:00
Philip Rideout
6a82d942cf Fix typo in test_list.txt 2018-12-02 19:34:30 -08:00