Commit Graph
906 Commits
Author SHA1 Message Date
Mathias Agopian ac679e0da4 FrameGraph API change
Resources are now single textures (generally buffers in the future),
but no longer a render target + a set of texture.
Instead, render target need to be declared and are associated to a pass.
2019-02-13 17:43:28 -08:00
Philip Rideout be18155996 Build web docs only when opting in.
See #807.
2019-02-13 10:28:51 -08:00
Philip Rideout 691daeb45d JNI enhancement: allow mutation of non-direct buffers.
The bug was reproduced and the fix was verified by copying the following
code snippet into one of our Android samples:

    val norm = floatArrayOf(1.0f, 0.0f, 0.0f)
    val tang = floatArrayOf(0.0f, 1.0f, 0.0f, 1.0f)
    val expected = floatArrayOf(0.5f, 0.5f, 0.5f, 0.5f)
    val resultBuffer = FloatBuffer.allocate(4)
    val qtc = VertexBuffer.QuatTangentContext()
    qtc.quatCount = 1
    qtc.quatType = VertexBuffer.QuatType.FLOAT4
    qtc.outBuffer = resultBuffer
    qtc.normals = FloatBuffer.wrap(norm)
    qtc.tangents = FloatBuffer.wrap(tang)
    VertexBuffer.populateTangentQuaternions(qtc)
    Log.e("Filament", "${expected[0]} == ${resultBuffer[0]}")

Fixes #695.
2019-02-11 14:50:14 -08:00
Philip Rideout 40fe6628d0 Expose tangent utility to Java / Kotlin.
This also improves the comments and allows 0 for output stride.
2019-02-11 12:50:19 -08:00
Caleb Leak d2f8fa5a36 Fixed printing of wrong file names
In multiple samples when a file didn't exist, it printed the first file as being the offending argument, regardless of which actually was.
2019-02-11 09:04:21 +01:00
Caleb Leak 32287aea7f Fixed README.md giving an invalid Windows command
The `./` and file separator in the executable path prevented the program from running. The other changes are just cleanup for conformity. This is the last of the Windows doc changes as far as I can tell.
2019-02-11 00:51:03 +09:00
François Guthmann 8253006899 Typo correction
Switched arguments in prefilteredDFG_LUT call to align with function definition in the documentation and in the code.
2019-02-08 10:24:15 -08:00
Ben Doherty e5eb29dc92 Add desktop JNI bindings for filamat (#791) 2019-02-08 09:59:35 -08:00
Ben Doherty a2caea7e88 Metal / Vulkan swapchain (#792) 2019-02-08 09:59:05 -08:00
prideout 5ee359cf40 Move math namespace to fix #746. 2019-02-07 09:23:07 -08:00
Ben Doherty 6089be6de6 Add Metal handles (#790) 2019-02-06 16:05:58 -08:00
prideout 72a987057e Move MeshReader into filamesh namespace.
This class will not extend well to glTF so this cordons it off into the
filamesh namespace, which is an already-existing namespace that we use
for the things related to the filamesh file format.

For glTF we might create a new library with its own MeshReader so
this will mitigate confusion.
2019-02-06 12:59:48 -08:00
Ben Doherty 4b0f1e8247 Add Metal state creation logic (#782) 2019-02-06 12:57:19 -08:00
prideout 60d17fff2e Minor Vulkan fixup. 2019-02-06 10:17:13 -08:00
Caleb Leak 846f21ce51 Fix example running a different app than built 2019-02-06 16:16:17 +09:00
Romain Guy 4327612159 Remove unnecessary function parameter
Our visibility terms don't make use of roughness, only of
roughness^2. This change simplifies the shaders, which will
help for specular AA.
2019-02-06 10:14:05 +09:00
Philip Rideout 714b431cf9 Vulkan: use a longer swap chain to avoid stalls.
This is consistent with the Willems demos, the Overvoorde tutorials,
as well as Intel's "API without Secrets" guidance.

Fixes #778
2019-02-05 15:26:32 -08:00
Mathias Agopian 83d9ba91e5 fix a possible crash in the gl backend
we could crash by dereferencing something that's 
not a pointer when blitting to a rendertarget not
backed by a texture (i.e. renderbuffer).

also there was a case where we couldn't disambiguate
between the two cases.
2019-02-05 14:31:25 -08:00
Ben Doherty 7381475321 Compile material during build for iOS sample (#779) 2019-02-04 20:38:41 -08:00
Ben Doherty d127a718ab Add Metal enums (#774) 2019-02-04 11:09:51 -08:00
Ben Doherty a827f4528a Install filamat and dependencies as single static library (#775) 2019-02-04 11:08:45 -08:00
Philip Rideout 9fd69ec7a9 Add skinning demo.
Motivated by #764.
2019-02-02 09:02:32 -08:00
Philip Rideout 16088760c8 Update VulkanTexture constructor for TextureUsage. 2019-02-01 17:10:45 -08:00
Mathias Agopian 8298520f0a TextureUsage is now a bitmask, which makes it more flexible. 2019-02-01 17:10:45 -08:00
Philip Rideout 0595e8f7a6 Fix GL error seen with skinning due to UBO size.
This fixes an INVALID_OPERATION at draw call time with skinned
renderables. We do not see this error with Adreno drivers, but we saw it
with WebGL, and technically our usage was not spec compliant.
2019-02-01 16:56:06 -08:00
Ben Doherty 2972060cd0 Add scripts for combining static libraries (#769) 2019-02-01 15:38:48 -08:00
Philip Rideout 69de626ead Rename built-in shader inputs to "inputs" instead of "variables".
In the public docs and materials API, Filament "variables" are custom
interpolants (outputs of VS, inputs of FS). However we internally used
"variables" to also refer to built-in VS inputs.

CodeGenerator had a generateVariable method and a generateVariables
method, which did something completely different. :)
2019-02-01 13:20:13 -08:00
Adrian Perez 694d5a397e Typo fixes 2019-02-01 11:26:58 -08:00
Philip Rideout 92098d2610 Fix vk_imgui crash by allowing zero-sized uniform buffers.
The vk_imgui sample regressed in December or so, after some changes in
how Filament manages uniform buffers. This commit makes the Vulkan
driver more consistent with the GL driver, which does a check for
zero-sized buffers.
2019-02-01 09:55:23 -08:00
Philip Rideout 0b71691a61 Simplify VkCommandBuffer management. 2019-02-01 09:55:23 -08:00
Philip Rideout 6556345941 Vulkan: support WaitForIdle before swap chain construction. 2019-02-01 09:55:23 -08:00
Mathias Agopian d1aecf864f allocator's free() must take 2 parameters 2019-01-31 17:36:19 -08:00
Philip Rideout 01c2d31484 Implement blit in VulkanDriver.
Fixes #749.
2019-01-31 15:23:54 -08:00
Philip Rideout 18bff7ef5e Repair generateMipmaps for cubemaps.
This functionality regressed when we replaced the OpenGL implementation
with our own.

I proved both the regression and the fix by running suzanne with the
following hacks.

```
--- a/libs/image/include/image/KtxUtility.h
+++ b/libs/image/include/image/KtxUtility.h
@@ -129,8 +129,9 @@ namespace KtxUtility {
             for (uint32_t level = 0; level < nmips; ++level) {
                 ktx.getBlob({level, 0, 0}, &data, &size);
                 PixelBufferDescriptor pbd(data, size * 6, dataformat, datatype, cb, cbuser);
-                texture->setImage(*engine, level, std::move(pbd), Texture::FaceOffsets(size));
+                if (level == 0) texture->setImage(*engine, level, std::move(pbd), Texture::FaceOffsets(size));
             }
+            texture->generateMipmaps(*engine);
             return texture;
         }

--- a/samples/app/IBL.cpp
+++ b/samples/app/IBL.cpp
@@ -54,7 +54,7 @@ IBL::~IBL() {
 bool IBL::loadFromKtx(const std::string& prefix) {
     // First check for compressed variants of the environment.
     Path iblPath(prefix + "_ibl_s3tc.ktx");
-    if (!iblPath.exists()) {
+    if (true || !iblPath.exists()) {
```
2019-01-31 13:57:30 -08:00
Philip Rideout 41a1250598 Skinning: fix buffer overrun for non-zero bone offsets.
Fixes #764
2019-01-31 12:39:16 -08:00
Philip Rideout 2800f58aa1 Add jniLibs search path to filament-android for Vulkan.
This allows Filament to find validation layers in debug builds.
2019-01-30 16:33:54 -08:00
Adrian Perez 7ba46ef5f1 Add explicit includes for types not implied in all stdlib impls sceneform-1.7pr5 2019-01-30 16:08:57 -08:00
Benjamin Doherty 21f0aa5fb4 Enable custom allocator test for Windows 2019-01-30 16:05:49 -08:00
Mathias Agopian 8bdae79536 added rebind copy-ctor to STLAllocator
this should fix the build on windows debug
2019-01-30 16:05:49 -08:00
Mathias Agopian 0bdb6b8a8a workaround a compile error with some compilers 2019-01-30 16:05:49 -08:00
Philip Rideout 447f44539f Add warning to GenMipmaps for non-renderable formats. 2019-01-30 11:03:54 -08:00
Philip Rideout 0a9be8f9b2 Remove generateMipmaps from DriverAPI. 2019-01-30 11:03:54 -08:00
Philip Rideout d0df2e1336 Replace glGenMipmap with our own implementation. 2019-01-30 11:03:54 -08:00
Philip Rideout f690d5e69c Suzanne now tests generateMipmaps. 2019-01-30 11:03:54 -08:00
Philip Rideout 4ffd790fd6 GL blit now updates baseLevel / maxLevel of target texture.
This not only paves the way for our own mipmap generator routine, but
also better aligns the semantics of blit with setTextureData.

Motivated by #749.
2019-01-30 11:03:54 -08:00
Ben Doherty c29fcc7668 Fix typo in iOS readme 2019-01-29 18:13:38 -08:00
Mathias Agopian ae6ab66af4 fix #755: a race condition cousing a deadlock
This reverts a JobSystem optimization that attempted to avoid signaling
a condition when there was no waiters. Unfortunately, there was a
race that caused the the signaling thread to miss that the waiter flag
was set, thus not signaling.
sceneform-1.7pr4
2019-01-29 15:40:25 -08:00
Ben Doherty 7be3994c96 Add Metal shading language compilation to matc (#752) 2019-01-29 12:44:58 -07:00
Ben Doherty 836b641bff Add filamat-jni to CMake and build.sh (#740) 2019-01-29 12:34:04 -07:00
Tim van Scherpenzeel 44bfac85e9 added quiet flag 2019-01-29 11:04:58 -08:00