Commit Graph

746 Commits

Author SHA1 Message Date
Romain Guy
ff74255e6e Use clang70 in CI (#622)
* Use clang70 in CI

* Use version 7 not 7.0

* Use libc++ 7.0.0
2018-12-11 17:46:45 -08:00
Pixelflinger
2529a34c36 code size optimizations
- make Profiler::readCounters() not inline as it didn't need to be, 
it's not performance critical and it's sufficiently large.

- don't inline hasExtensions(), same reason.
2018-12-11 17:44:03 -08:00
Romain Guy
b291e11b90 Try to switch to clang60 in CI 2018-12-11 16:30:36 -08:00
Romain Guy
85a649b239 Apparently we can't use -static-libstdc++ in CI on Debug builds 2018-12-11 15:53:24 -08:00
Romain Guy
b96867e03a Link statically against libc++abi 2018-12-11 15:51:05 -08:00
Romain Guy
23e2e2a9bd Always link libc++ statically on Linux 2018-12-11 15:40:44 -08:00
Pixelflinger
e624dff037 set cpu affinity of JobSystem's threads
this is to try to prevent threads from bouncing
between cores
2018-12-11 13:46:05 -08:00
Romain Guy
025f4a54f5 Use root utils namespace in Systrace.h 2018-12-11 13:45:37 -08:00
Philip Rideout
b375d029d2 Work around CMake issue on win32 with asm-only libs. 2018-12-11 11:23:33 -08:00
Philip Rideout
40298f3cc0 Add C++ sample for compressed textures.
This is similar to its WebGL and Android counterparts, we simply did not
have a version for desktop. This uses resgen to package the model's
textures (albedo, normal, roughness, metallic, ao) into a library that
is linked only to this sample.

This is a good test because it applies multiple textures to the model.
Moreover Aaron was asking me for a C++ example that uses compressed
textures.

For now this selects the OpenGL backend. We can change it to use Vulkan
after we add support for 3-band formats to VulkanDriver.
2018-12-11 11:23:33 -08:00
Romain Guy
a38c40cf11 Turn on shaders optimization by default (#614)
* Turn on shaders optimization by default

Release builds of Filament only work well with optimize shaders,
turning optimizations on by default will help avoid mismatches.

This change also adds -g to disable all optimizations, for debug
builds.

* Use -g on debug builds

* Use -g on debug builds

* Update tutorial_redball.md to remove matc's -O

* Update tutorial_suzanne.md to remove matc's -O

* Use -g in debug builds
2018-12-11 09:36:37 -08:00
shartte
3c8b7e537c Fixes an overflow issue when exactly 256 bones are used (#617) 2018-12-11 09:35:06 -08:00
Mathias Agopian
ab3dddeb78 add missing @public-api comment 2018-12-10 21:36:20 -08:00
Mathias Agopian
cd00c4bbe8 Add getUserTimeModulo() to materials
This calculates the modulo of the user time by a given value, using
the high precision user time. This is useful for animations without
having to worry about resetting the time.
2018-12-10 21:36:20 -08:00
Mathias Agopian
1dfc7fd5ae parallelize light and renderable culling
the code was structured so light culling and renderable culling could
be done in parallel, but this wasn't implemented.
Clean-up some methods to turn them to static and run light culling
in parallel with renderable culling.
2018-12-10 21:34:00 -08:00
Mathias Agopian
f9cc118bdb Always wake up a job queue when a job is ran
We used to only wake up a job-queue if there was already some jobs
running, the idea was that the current thread would handle the new job
as soon as calling wait(). However, there is no guarantee that wait() 
will be called anytime soon.

cv.signal() is not very expensive on Android/Linux, as we're using
a custom implementation.
2018-12-10 21:33:38 -08:00
Mathias Agopian
418aebb2a0 Run Froxelization during shadow pass
We can start the froxelization earlier so it happens during the
shadow pass.
2018-12-10 21:33:18 -08:00
Philip Rideout
96c0e999ae Vulkan: support 2D compressed textures. 2018-12-10 18:05:09 -08:00
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