Commit Graph

2094 Commits

Author SHA1 Message Date
Mathias Agopian
179bf03caf implement absorption 2019-12-08 22:18:18 -08:00
Pixelflinger
0371a805ed basic refraction 2019-12-08 22:18:18 -08:00
Pixelflinger
57b48e0719 address reviewers comments
- get rid of "thin layer thickness" property
- make absorption a vec3
2019-12-08 22:18:18 -08:00
Mathias Agopian
eb767abc55 Add material properties needed for refraction 2019-12-08 22:18:18 -08:00
Mathias Agopian
dbda77b091 Improve low roughness significantly
Filament will now allow incomplete mipmap chains for the IBL and
map the roughness to the available chain.

This allows to create roughness cubemaps with a minim size for
roughness==1, instead of always mapping it to 1x1.

cmgen will now use 16x16 cubemaps for roughness==1, which
improves the quality of rough objects significantly.

The beauty of this is that there is no asset or API change. Old assets
will continue to work like before.
2019-12-08 22:17:08 -08:00
Philip Rideout
2c1454270e OpenGL: enable cubemap filtering on desktop.
According to the OpenGL spec, proper cubemap filtering is disabled by
default in non-ES OpenGL.
2019-12-08 22:16:52 -08:00
Mathias Agopian
1ec72e606b Round non-texture FBO attachments to 32 pixels
this helps reducing churn in the resourceallocator cache.
2019-12-06 14:03:07 -08:00
Philip Rideout
24bfdd741a Revert "Fix bad state after setIndirectLight(null)."
This reverts commit f0ce4094dd.
2019-12-06 13:56:21 -08:00
Philip Rideout
f0ce4094dd Fix bad state after setIndirectLight(null).
This cleans up 3 related issues, but only the first of these caused an
actual user-visible bug:

(1) When the IBL was null, prepareLighting was failing to bind the black
1x1 texture.

(2) If you added and removed an IBL from a Scene, then Scene was not
returned to its initial state.

(3) The default 1x1 IBL used an intensity of 1 rather than 30000, which
is inconsistent with the null IBL.

Fixes #1940.
2019-12-06 13:54:49 -08:00
Philip Rideout
9cbcd88d4e WebGL: tweak helmet demo for shadows. 2019-12-06 10:27:00 -08:00
Philip Rideout
8ea6e6ce59 Upgrade hello-camera to use AHardwareBuffer. 2019-12-06 08:46:37 -08:00
Philip Rideout
6d0f8c9ead cmgen: add support for non-RLE HDR images.
The new conditional is cribbed from STB, which checks the first three
bytes.

Fixes #1937.
2019-12-06 08:45:12 -08:00
Philip Rideout
43d91a5c40 Repair twoPassesTwoSides transparency.
This regressed when we added support for dynamic backface culling
(#1641). Also note another fix we made: #1877.
2019-12-05 09:00:57 -08:00
Romain Guy
564e527ac7 Fix docs typo 2019-12-05 10:17:00 +01:00
Philip Rideout
6d3b733cb1 Bump package.json version. 2019-12-04 15:59:52 -08:00
Philip Rideout
0e967726de Simplify CameraManipulator.
This removes a lot of code and will make it easier to migrate into a new
library with Java bindings, etc.

- The clipping planes and projection matrix were unused, removed them.

- In split view mode, our demos were using only 2 of the 3 manipulators,
  removed one.

- Instead of callbacks and update methods, users can simply ask for the
  current matrix at every frame.

- The manipulator's job is to consume mouse events and maintain an
  "look at" basis, there is no need to store a reference to a Filament
  Camera.
2019-12-04 08:05:17 -08:00
Mathias Agopian
001a4c46db Added a property chunk to materials
Materials can now reflect which property is in use.
2019-12-03 17:51:44 -08:00
Mathias Agopian
1a9d0926ee Added a torus and simple cube shapes
renamed "cube.obj" to "rounded_cube.obj", which it was (rounded)
2019-12-03 17:49:40 -08:00
Mathias Agopian
05a756beaa ResourceAllocator: minor clean-up and comments 2019-12-03 17:42:43 -08:00
Mathias Agopian
1014847e9d workaround OpenGLES driver bug
some drivers declare supporting anisotropic filtering, but don't
support calling glSamplerParameter() to set the max anisotropy, presumably because they only support glTexParameter().
We simply turn off anisotropic filtering on these drivers.
2019-12-03 17:41:41 -08:00
Ben Doherty
d3309c2e84 Fix Windows build variants (#1926) 2019-12-02 17:16:15 -08:00
Romain Guy
565002a918 Remove obsolete comment 2019-12-02 14:23:12 -08:00
Romain Guy
08b83e7ed1 Make including jawt_md.h more resilient (#1922)
Sometimes CMake decides to use the JNI bits included with XCode instead
of those from the installed JDK. The header files are located in different
directories. This does the proper include.
2019-12-02 08:45:20 -08:00
Ben Doherty
b4c2f523fe Update RELEASE_NOTES.md 2019-11-27 13:14:12 -08:00
Romain Guy
4ba5d6b9a8 Update release notes v1.4.3 2019-11-27 13:05:34 -08:00
Ben Doherty
59ceb05f99 Add support for mapping individual planes of iOS external images (#1917) 2019-11-27 10:38:13 -08:00
Benjamin Doherty
929c8e96c6 Handle surface size changes in Metal 2019-11-27 01:08:40 -08:00
Philip Rideout
1b5a730358 VulkanDriver: add depth buffer to swap chain. 2019-11-27 01:08:40 -08:00
Benjamin Doherty
79255e8e7d Implement default depth buffer for Metal 2019-11-27 01:08:40 -08:00
Mathias Agopian
50845261fe Swap chains are now always created with a depth buffer
This is to allow direct rendering of 3D objects into the swapchain 
under certain circumstances (no msaa or postprocessing).
2019-11-27 01:08:40 -08:00
Philip Rideout
da090f0ff6 Fix missing call to glInvalidateFramebuffer().
We were over-optimizing, not always honoring the flag. This was
incorrect since bindFramebuffer can be called from other places.

Fixes #1914.
2019-11-26 15:25:59 -08:00
Philip Rideout
60ead8c5f3 Add Android sample for testing the Stream API.
This new sample differs from "Hello Camera" in that it exercises all
three ways of using Stream. It also uses Canvas instead of Camera2 to
draw into the external texture. It shows two sets of stripes, one
animated using the shader and the other animated using Canvas. If the
two stripes are aligned, then the stream is perfectly synchronized.
Users can tap the screen to cycle between the three modes.
2019-11-26 07:58:52 -08:00
Ben Doherty
6942569409 Pass shared context on Windows to wglCreateContextAttribs (#1913) 2019-11-25 13:38:07 -08:00
Romain Guy
498a608941 Remove unused lambda capture 2019-11-23 19:55:05 -08:00
Philip Rideout
eee7154c33 wasm: add support for DEBUG builds by disabling RTTI.
Unfortunately we require RTTI to be disabled for web builds
due to the way in which we handle array buffers. This may change
in the future but for now I think it's an acceptable constraint,
especially given the fact that RTTI adds bloat anyway.
2019-11-22 14:33:03 -08:00
Ben Doherty
a735660af8 Separate resource packages for gltf_viewer and lucy demo (#1908) 2019-11-22 11:34:42 -08:00
Ben Doherty
c5ed7172b3 Add release GitHub workflow (#1903) 2019-11-21 11:04:20 -08:00
Mathias Agopian
4b28362920 Better workaround a resource culling issue.
A texture resource can end-up with not usage bit set if it is used as
an attachment of a render target that gets replaced by a moveResource()
call. The framegraph should take care of culling our this resource,
in that case, but currently doesn't.

We worked around this issue by not declaring the resources, but it's
better to do this in the frame graph code, as to not affect the 
user facing API.
2019-11-20 22:26:00 -08:00
Mathias Agopian
dfeaa416c0 Tone mapping always sets alpha channel to 1 in opaque mode
This fixes an issue where the alpha channel could be left to garbage in
opaque mode with FXAA disabled.
2019-11-20 17:34:59 -08:00
Mathias Agopian
3ce4dd94f7 Use a larger blur filter for SSAO
We go from 9 to 15 taps to better match the 16x16 noise pattern.
2019-11-20 16:32:28 -08:00
Ben Doherty
0ee1d406e0 Update README.md to reflect build link removal (#1902) 2019-11-20 13:29:51 -08:00
Mathias Agopian
dad814e046 Fix a long standing bug preventing the use of transparent views (#1893)
Fix #1165

In order to use transparent views, post-processing had to be disabled
because we were not able to blit post-processed buffers with blending.
This is now fixed by simply reverting to a quad.

A side effect of this, is improved performance when a scaling blit is
needed when MSAA is active.


This also introduced new "bugs", or at least weird behaviors: the
system needs to know when blending is needed, and this has to be
based on heuristics (unless we add a new api). Currently the heuristic
is that the COLOR buffer is not discarded and the view is cleared with 
an alpha value (or not cleared).
2019-11-19 14:05:22 -08:00
Pixelflinger
6246f20e63 Always use SH3 for indirect lighting
We used to use SH2 on mobile/webgl, but the quality degradation is too
prominent. This adds ~16 adds though.
2019-11-19 14:00:37 -08:00
Ben Doherty
f4ad55f6d7 Fix Windows CI failures by specifying shell (#1890) 2019-11-19 11:20:59 -08:00
Pixelflinger
027c4b42f7 fix a few issues with MSAA blits
1) When scaling is enabled, we're using a blit at the end of the frame,
   however, if MSAA is also enabled, this blit is not allowed, so we
   need an explicit MSAA resolve.

2) When rendering directly into the default render target with MSAA
   enabled, we need an explicit resolve ONLY IF there is a format
   conversion, because those are also not allowed. 
   Before, we were doing this resolve regardless.

3) The test for "rendering directly into the default target" had
   become wrong because, the Render target can now be a user texture
   (which is assumed to have the proper MSAA-ness and a depth buffer),
   so no intermediate buffer should be needed for those. We now
   check that render target is actually the default render target
2019-11-18 20:25:53 -08:00
Pixelflinger
fb6c9f8b7d Use 16x16 blue noise for SSAO samples
The larger, blue noise texture gives a more pleasant, smoother SSAO
effect.
2019-11-18 20:25:29 -08:00
Pixelflinger
33d2eaee5b remove old 'SSAO' algorithm 2019-11-18 16:16:29 -08:00
Ben Doherty
ae3ccd7fb6 Implement headless swap chains and readPixels for Metal (#1885) 2019-11-18 11:28:20 -08:00
Russell Chou
72dbea256a Fix comment. 2019-11-16 15:10:15 -08:00
Pixelflinger
ea0ff1bc01 Add a way to override the material of a RenderPass
We used to have this functionality, but it we removed it because we
didn't have a use for it and it was costly.

This new implementation is only internal, and would (will?) be useful
if we wanted to generate a special buffer for SSAO for instance (instead
of just depth). This implementation, overrides the material at the time
the commands are executed, which is much cheaper than the previous
implementation.
2019-11-15 17:37:18 -08:00