Commit Graph

2214 Commits

Author SHA1 Message Date
BStringhamVRSK
041f26a7c5 Implemented sRGB support for DXT encoded textures (#2026)
* Added sRGB support for DXT compressed textures - OpenGL

* Added sRGB support for DXT compressed textures - Vulkan and Metal

* Added detection if OpenGL driver supports sRGB compressed textures (EXT_texture_sRGB extension)

* Fixed whitespace to use spaces rather than tabs

* Test for GL_EXT_texture_sRGB or GL_EXT_texture_compression_s3tc_srgb support for sRGB DXT compressed textures

* GL ES uses GL_EXT_texture_compression_s3tc_srgb instead of GL_EXT_texture_sRGB
2020-01-15 10:26:29 -08:00
Mathias Agopian
b351e709c1 Framegraph improvements
- added a way to compare two handle's underlaying resource
  (i.e. do they refer to the same resource)

- minor refactoring and comment fixes
2020-01-15 10:22:10 -08:00
Mathias Agopian
fbad683810 Implement a "black board" for the framegraph
FrameGraph always keeps a default Blackboard, but additional ones 
can be created if needed.

A blackboard is just a registry of FrameGraphHandles, queryable by name.
2020-01-15 10:22:10 -08:00
Philip Rideout
2854c0627d camutils: add support for Builder pattern.
This makes the upcoming Java bindings simpler and improves parity with
existing API conventions.

Note that camutils does not depend on filament and therefore cannot use
BuilderBase.

Note that the Manipulator Builder state is public which breaks with
convention but makes implementation simple and allows C++ clients to
continue using modern initializer syntax if they wish.
2020-01-14 15:26:22 -08:00
Mathias Agopian
c5fa6fe7f2 More fixes to sampled textures in the framegraph
The main purpose of this change is to fix a problem where a resource
marked as sampleable by a *culled* pass would stay sampleable.
This happened because the sampleable state was tracked on the resource
itself.

We fix this by treating sample() just like read(), such resources are
added to an array living in the pass, which ensures the state is correct
when passes are culled.

Also fixed:
- simplified read() code a bit (minor)
- simplified resource aliasing code
- don't resolve() renderTargets of culled passes
2020-01-14 11:16:34 -08:00
Mathias Agopian
40c7232bb2 revert part of a recent TransformManager change
setParent() is not supposed to reorder child/parents in the array
because it doesn't rely on them being orderer. This also has the
advantage of not invalidating Instances.

However, commitLocalTransformTransaction() does rely on child/parent
ordering and the previous change did fix that.
2020-01-14 11:16:07 -08:00
Ben Doherty
59e3465b6b Update Assimp to 5.0.1 (#2027) 2020-01-13 15:00:27 -08:00
tpsiaki
2c591d2dca Correct out-of-order transform instances (#2025)
The current code only updates the order in the transaction commit if there's a single out-of-order node in the scene graph, but if multiple are out of order (or one swap doesn't fully fix the ordering), then we end up with out of order scenes, and incorrect world transforms.

Additionally, when nodes are reparented outside of a transaction, the order is not updated.
2020-01-13 13:22:49 -08:00
Mathias Agopian
4673545f45 Fix a multisample related bug in the FrameGraph
The FrameGraph would erroneously specify a sample count on textures
that are sampleable and used as an attachment to a multisampled 
target -- however, that's not allowed.

We didn't run into issues, because had a workaround for this when
creating the texture. This is augmented by an assertion.
2020-01-13 11:29:14 -08:00
Mathias Agopian
4703a45ff5 Ensure we don't use RTTI when not available
also don't implement the graphviz export in release builds.
2020-01-13 11:28:50 -08:00
Mathias Agopian
35aabd5e44 Fix a couple minor issues in the OpenGLES backend
- we were not unbinding the renderbuffer int the right place,
  when it's created, instead we were doing that when using it the 
  first time. Unbinding soon makes sense because we never need to
  rebind it after that.

- in debug builds we were clearing render targets at creation time,
  but this was wrong because a render target won't necessarily be written
  (it could be used as the source of the blit for instance).
  This didn't cause any trouble in the framegraph, by chance, it was smart
  enough to reuse existing render targets in the case of blitting.
  Ideally we'd clear textures/renderbuffer at creation time,
2020-01-13 11:28:50 -08:00
Mathias Agopian
118944be9a Improve/simplify OpenGLDriver a bit
merge frameBufferRenderbuffer() and framebufferTexture() because
the filament API doesn't have a distinction. This actually removes
quite a bit of code too.
2020-01-13 11:28:50 -08:00
Mathias Agopian
8e1ecbb0ea Minor FrameGraph improvements
- write() is marked as [[nodiscard]] since it's
  generally an error to discard it

- graphviz export not display wether a texture resource is
an actual texture or renderbuffer
2020-01-13 11:28:50 -08:00
Romain Guy
00ba8c09f8 Rewrite Maven publish tasks to support multiple flavors (#2022)
* Rewrite Maven publish tasks to support multiple flavors

* Don't build filamat with an unused CMake option

* Don't compiler debug in release mode

* ... for real

* Link to BUILDING.md
2020-01-10 18:02:46 -08:00
Philip Rideout
15b071acaa gltfio: support external resources on Android.
This was untested because our only glTF Android sample uses glb instead
of JSON. We will soon be adding a new Android demo that uses an actual
gltf file.

This fixes #1841.
2020-01-10 09:15:38 -08:00
Romain Guy
aa3dfb9a4b Revert "Disable filamat-android's flavors for now"
This reverts commit 95e22d878a.
2020-01-09 19:17:50 -08:00
Romain Guy
95e22d878a Disable filamat-android's flavors for now 2020-01-09 17:49:30 -08:00
Philip Rideout
4f8c495563 Another gltf_bloom fixup. 2020-01-09 14:31:43 -08:00
Romain Guy
1d6ea1db0f Update README.md 2020-01-09 14:23:41 -08:00
Romain Guy
393cc5c634 Update README 2020-01-09 14:23:05 -08:00
Philip Rideout
34c2772a60 Remove unused source file. 2020-01-09 14:10:33 -08:00
Philip Rideout
4d258ab5e8 Remove a build output file. 2020-01-09 14:07:20 -08:00
Philip Rideout
a306f9074a Clean up gltf-bloom to prep for new gltf-viewer app.
This renames the app namespace and removes the unused Io file.
2020-01-09 13:49:24 -08:00
Philip Rideout
6e30566363 Bump version number in package.json 2020-01-09 12:33:17 -08:00
Romain Guy
2908224c95 Filament 1.4.4 v1.4.4 2020-01-09 12:19:05 -08:00
Romain Guy
e011853e7e Update androidx.annotation to 1.1.0 2020-01-09 08:55:43 -08:00
Romain Guy
104105c937 Fix the build 2020-01-08 18:01:18 -08:00
Romain Guy
3fa98419a6 Add more .gitignore 2020-01-08 17:59:49 -08:00
Romain Guy
44d08ce41e Fixup javadocs 2020-01-08 17:55:17 -08:00
Mathias Agopian
0a1c1be00e Refactoring to allow rendering multi-pass rendering
specifically into the same render target.
2020-01-08 16:10:09 -08:00
Mathias Agopian
7efd7abffe Don't combine clearFlags when retrieving a rendertarget
Instead we use the clear flags that the user specified. This is needed
in the case where we're rendering in the target in two passes, the
first pass might want to clear the buffers, while the 2nd one will not.
If we were combining the clear flags, the first pass's flags would be
sticky and the view would always be cleared.

If combining is needed it must be specified by the user.
2020-01-08 16:10:09 -08:00
Mathias Agopian
e27158507e refactor Renderer to make it more flexible
This is in preparation to supporting screen-space effects.
There are two major changes:

- RenderPass is now copiable and intended to be passed by copy to
  the execute stage of frame graph passes

- The color pass is in its own function now


This actually simplify RenderPass api.
2020-01-08 16:10:09 -08:00
Romain Guy
d9ee2fa10d Use a proper Gradle plugin to generate Filament assets in samples (#2018) 2020-01-08 15:45:44 -08:00
Mathias Agopian
b30a7aa5a2 Make ResourceAllocator mockable and update test
We have one very important unit test that is supposed to make sure
the framegraph reuses the same rendertarget between 2 passes, this
unit test would always succeed when using the NoopDriver.
Now that we can mock the ResourceAllocator, we can ensure this unit
test is doing its job.
2020-01-08 15:39:40 -08:00
Mathias Agopian
34c1aaac18 improve cmgen prefiltered cubemaps
Rotate the sample pattern at every light direction, which trades
aliasing for noise (which is arguably more pleasant) for IBLs with
very high frequency (i.e. high level of HDR-ness).
2020-01-08 15:39:21 -08:00
Ben Doherty
8dbb4c6b7e Add new heightfield sample (#2004) 2020-01-08 11:55:28 -08:00
Romain Guy
f5d5afba74 Re-organize Android Gradle files (#2013)
* Re-organize Android Gradle files

Clean up our Gradle files, share versioning, etc. and prepare for
publication to sonatype.

* Use androix annotations for desktop

* Add samples as subprojects to root Gradle

* Fix build script

* Don't break when samples aren't compiled

* Better organize the Android Studio project
2020-01-07 18:37:45 -08:00
Philip Rideout
e09f0bb99f Repair gradle IBL path for gltf_bloom.
I broke this when I changed the cmgen KTX behavior.
2020-01-07 14:05:40 -08:00
Mathias Agopian
fddf51dc74 cmgen -d would force importance sampling mips generation 2020-01-06 17:43:11 -08:00
Mathias Agopian
b8d4b981e0 Better roughness remapping and comments
We were conflating two concepts in our comments about the roughness
remapping, which was confusing. Also changed the remapping so it 
matches a log2 mapping in our default configuration.
2020-01-06 17:42:56 -08:00
Daniel Lehmann
892302442f Fix Backend enum in Java to be consistent with C definition (#2006)
The C definition was changed to include METAL, moving NOOP further down.
The Java definition never caught up, making NOOP mean METAL and making the
real NOOP unreachable.

This patch puts them back in sync. Also, updated the Java comments to match
the comments from the C definition.
2020-01-06 16:27:15 -08:00
Philip Rideout
39046ddfe1 camutils: fix MSVC error. 2020-01-06 16:12:05 -08:00
Philip Rideout
ac14074bc4 camutils: flip zoom to match old manipulator. 2020-01-06 16:12:05 -08:00
Philip Rideout
7d548151d7 Introduce camutils library.
This moves the camera manipulator into its own library and adds new
functionality including a new "Google Maps" manipulator and a bookmark
feature to facilitate camera animation.

Java bindings and an Android sample will land later this week.
2020-01-06 16:12:05 -08:00
Philip Rideout
898ed70aa0 Remove <iostream> from math headers.
This speeds up our build time by using <iosfwd> and un-inlining the
vector print functions.
2020-01-06 15:09:06 -08:00
Romain Guy
78842b59c9 Only build FBX and OBJ importers (#2003) 2020-01-06 14:38:32 -08:00
Ben Doherty
f4f4f9ccd5 Implement flush for Metal backend (#1999) 2020-01-06 12:28:11 -08:00
Mathias Agopian
2ef9d72dbd Simply refraction code
This makes it easier to add new shapes and experiment.
Added a "sold box" shape that is not used yet.
2020-01-06 11:33:06 -08:00
Tim Psiaki
b030f67eb7 Make EntityManager and Panic dynamic-linkable. 2020-01-06 10:24:17 -08:00
Romain Guy
8380a87a6e Update HTML docs 2020-01-05 11:44:45 -08:00