Commit Graph

1079 Commits

Author SHA1 Message Date
Philip Rideout
39c63146e0 gltfio: add ubershader template.
We will need 6 pre-compiled materials (lit vs nonlit and the 3 blend
modes). This uses CMake's "configure_file" functionality to generate 6
mat files, then invokes matc on each one. They are then combined using
resgen.
2019-03-12 08:16:55 -07:00
Philip Rideout
960d1321e6 Repair web builds. 2019-03-11 18:36:29 -07:00
Mathias Agopian
8ffba072b2 remove the "byteSize" parameter from update[Vertex|Index]Buffer
It was redundant with BufferDescriptor::size.
2019-03-11 18:27:06 -07:00
Philip Rideout
031ff260f7 Repair web builds. 2019-03-11 17:44:12 -07:00
Mathias Agopian
c78db48b81 Better Camera component management
- getCameraComponent(Entity) retrieves a Camera component from an entity
- destroyCameraComponent(Entity) destroys just the camera component
  attached to an entity.

destroyCamera() are now deprecated because the API is confusing, it's
not immediately clear that it's destroying all component + the entity
itself.

Node: We don't add the corresponding Java APIs yet because there is no 
easy way to guarantee they're safe without making sure that 
getCameraComponent() will always return the same instance (which it
wouldn't currently).
2019-03-11 15:51:38 -07:00
Romain Guy
11eaad7992 Fix CI builds 2019-03-11 14:37:29 -07:00
Romain Guy
eda6ea64c8 Require CMake 3.10 2019-03-11 14:32:50 -07:00
Romain Guy
79dec2f8b5 Give our own CMake a higher priority 2019-03-11 14:28:26 -07:00
Romain Guy
41397e1b82 Move 3p models to models/ directory 2019-03-11 14:21:51 -07:00
Romain Guy
31a70d2352 Print CMake version number 2019-03-11 14:14:09 -07:00
Romain Guy
98ce5e2f5a Require CMake 3.12 because of CI 2019-03-11 14:07:13 -07:00
Romain Guy
9d8c000bcc Make CMake 3.13 the minimum version 2019-03-11 14:05:45 -07:00
Romain Guy
d238d7f6f2 Add CMake version check 2019-03-11 14:03:05 -07:00
Romain Guy
73af2620f9 Cleanup build.sh 2019-03-11 14:02:56 -07:00
yoshi (Yoshihisa Kaino)
160297db9c Fix Activate link #957 (#958) 2019-03-11 07:45:46 -07:00
Philip Rideout
8628c43fbf gltfio: material generator cleanup. 2019-03-10 15:11:58 -07:00
Philip Rideout
af9b3a99e0 gltfio: introduce MaterialProvider interface.
This prepares for an alternate "sans filamat" implementation of
MaterialProvider, which will be especially useful for web.
2019-03-10 11:59:47 -07:00
Philip Rideout
7a2924738c gltfio: transparency fixups
- rename gltfio::AlphaMode to use glTF nomenclature
- keep depth writes enabled for transparent renderables
2019-03-09 18:58:04 -08:00
Philip Rideout
06964a787a Repair parquet and helmet web demos. 2019-03-09 06:39:31 -08:00
Romain Guy
2e8c01d8aa Update README.md per #946 2019-03-08 23:11:29 -08:00
Mathias Agopian
b2738a2c8c Don't expose private structure in public header 2019-03-08 19:16:46 -08:00
Philip Rideout
0e4ca0bc7b Fix falling streetcar / quaternion slerp. 2019-03-08 17:50:15 -08:00
Philip Rideout
64f2a580da Update public site with latest JavaScript demos.
It has been a while, we've made a fix to our KTX writer, added a helmet
demo, etc.
2019-03-08 17:49:28 -08:00
Philip Rideout
f1f9fde3a4 Various JavaScript updates.
Add shadows to the FlightHelmet demo, add a link to it on the site,
and add recently-introduced entry points to the JS bindings.
2019-03-08 12:56:48 -08:00
Philip Rideout
c98ac44827 gltfio: fix UV set issue seen in littlest_tokyo 2019-03-08 11:31:22 -08:00
Philip Rideout
3c2a6d5f8c Link to rasterized markdown on website. 2019-03-08 09:59:01 -08:00
Mathias Agopian
d5178f862a minor cleanup: remove unneeded complexity 2019-03-07 17:21:58 -08:00
Mathias Agopian
4de71f7239 Remove dependency of UniformBuffer on UniformInterfaceBlock 2019-03-07 16:42:02 -08:00
Mathias Agopian
302d296949 Remove driver's UniformInterfaceBlock dependency 2019-03-07 16:42:02 -08:00
Mathias Agopian
1836377753 don't have two version of SamplerFormat
Instead, alias one on the other.
Also sort aliases in the header.
2019-03-07 16:42:02 -08:00
Mathias Agopian
462251bde6 Remove unused code and data
This is no longer used. Get rid of it.
2019-03-07 16:42:02 -08:00
Mathias Agopian
a1eedb95a0 'driver' shouldn't include filament/*.h headers
only filament/driver/* are allowed. These were not even needed.
2019-03-07 16:41:43 -08:00
Philip Rideout
b14759a0a4 gltfio: add wireframe functionality.
This makes it easy to draw a transformed box around each renderable for
diagnostic purposes. The API is similar to Animator in that it is
exposed through FilamentAsset but is created lazily and is implementated
outside of FilamentAsset.
2019-03-07 15:03:43 -08:00
Romain Guy
f02fe33070 Reformat comments 2019-03-07 14:53:33 -08:00
Philip Rideout
1ccf2d6a08 gltfio: fix up and enhance AABB functionality.
gltfio computes two types of bounding boxes: one for renderables (used
for frustum culling) and one for the overall asset (used for
positioning the camera or asset).

Both of these are based on the min+max attributes in the glTF file, but
the asset-level box was incorrect because only two corners of the
transformed AABB were considered.

This CL also adds optional computation of bounding boxes that crawls
through the vertex positions. This is useful when diagnosing potential
issues with the asset's min+max info.

These enhancements are motivated by a culling issue seen with the voxel
Cathedral on sketchfab.
2019-03-07 14:11:21 -08:00
Mathias Agopian
d2afc27703 Address review comments 2019-03-07 13:43:27 -08:00
Mathias Agopian
801d24b6e7 Remove some unused code and includes 2019-03-07 13:43:27 -08:00
Mathias Agopian
91738d0513 Remove the 'group' parameter from SamplerBindingMap 2019-03-07 13:43:27 -08:00
Mathias Agopian
2a72e8aee8 break dependency of Program on SamplerInterfaceBlock and SamplerBindingMap
Instead of passing SamplerInterfaceBlocks and a SamplerBindingMap to
Program, we now set a 'sampler group' per binding point:

Program::addSamplerGroup(...)

A sampler group here consists of a list of N 'Sampler' and a 'Sampler'
is just a unique name (unifrom name in the shader) and binding point in
the shader.

That's all the driver layer needs.

With this change we get rid of the code that re-created the uniform
names in the driver -- this should never have been done there. And we
also remove the hash-map lookups in vulkan and metal drivers.
2019-03-07 13:43:27 -08:00
Mathias Agopian
b0d640832a cleaup of Program.h 2019-03-07 13:43:27 -08:00
Mathias Agopian
50d8a8a2d8 fix SamplerBindingMap for non postprocess materials
This fixes #935

SamplerBindingMap was always adding the post-process samplers to the
map -- but matc doesn't generate those. This led the vulkan backend
to believe there was a post-process sampler bound, when there wasn't.

This is also technically a bug in the Vulkan backend because it should
have used the SamplerInterfaceBlock to determine which shaders are
actually used instead of blindly going through the whole list and 
trusting SamplerBindingMap.

The fix is kind of a hack, but the whole SamplerBindingMap is kind of a
hack anyways.
2019-03-06 18:26:08 -08:00
Romain Guy
23fe2cba98 Update MoltenVK to 1.1.101.0 (#937) 2019-03-06 16:52:24 -08:00
sebavan
906097625e Add Charlie importance sampling to cmgen.exe (#936) 2019-03-06 15:43:07 -08:00
Philip Rideout
8d979a7cb8 Resurrect quat slerp NaN protection.
In my previous NaN-related commit, I added a conditional similar to the
one seen in glMatrix, but this was insufficient for the interpolation
seen in a glTF skinning test because a divide-by-zero was occuring later
in the function. This commit simply adds back the previous protection.
2019-03-06 12:36:20 -08:00
Romain Guy
5ef0247569 Fix normal map sample 2019-03-06 12:03:34 -08:00
Pixelflinger
46e3326b81 move getSamplerBindingsStart() to SibGenerator
This is a bit more logical to have it there because SibGenerator
is about about what filament needs, whereas SamplerInterfaceBlock.h
is generic.
2019-03-06 11:47:26 -08:00
Pixelflinger
413f6a97b1 Engine.h doesn't need to store the per-view/post-process Sib
It's only used to get the size of the SamplerGroup.
Actually, Engine also uses the post-process Sib to create the
post-process material, but this should go away when we have
material domains -- so pretend it's not there.
2019-03-06 11:47:26 -08:00
Pixelflinger
1597b6f572 rename SamplerBuffer to SamplerGroup
This is the first part of a larger rework:
- Rename SamplerBuffer to SamplerGroup
- remove dependency on SamplerInterfaceGroup
2019-03-06 11:47:26 -08:00
Mathias Agopian
dc57eb4b7b fix filameshio test
when testing we're often using the NoopDriver, which
is has neither spirv or text shaders, so we default
to text to make this case work.
2019-03-05 18:38:01 -08:00
Mathias Agopian
7d81d9bb51 cleanup filamat namespace 2019-03-05 17:54:37 -08:00