Commit Graph

2482 Commits

Author SHA1 Message Date
Kai Chieh Liu (KJ) 劉凱傑
3de9cc1533 Expose Renderable::getLayerMask() (#2289)
TEST: built on mac

Co-authored-by: KJ Liu <kjliu@amazon.com>
2020-03-26 15:31:38 -07:00
Ben Doherty
f1aaf16082 Add spot light controls to material_sandbox (#2270) 2020-03-26 13:29:39 -07:00
Kai Chieh Liu (KJ) 劉凱傑
4c23f7a436 Fix cmakelist to install subdir properly (#2283) 2020-03-25 18:20:24 -07:00
Pixelflinger
2188923153 Fix fog with transparent objects 2020-03-25 17:10:36 -07:00
Romain Guy
2f47bab237 Update README screenshots 2020-03-25 14:23:36 -07:00
prewettg
fe547a7690 Fixes resizing window not resizing the framebuffer on macOS (#2281) 2020-03-25 14:03:49 -07:00
Pixelflinger
b4f5a4a0a0 Fog improvements
- optimized the fog computations
- fixed issues with the skybox
- added the option of getting the fog color modulated by the IBL envmap
2020-03-24 22:29:25 -07:00
Pixelflinger
5929d5d9dd improve quality of diffuse sampling on desktop
We 4-tap filter the diffuse map, which generally is very small
(e.g. 16x16), to improve quality a bit.
2020-03-24 22:28:59 -07:00
Romain Guy
0b7de0ec65 Turn off contact shadows by default in gltf viewer (#2277) 2020-03-24 16:44:48 -07:00
Romain Guy
87ac282014 Export missing headers for NameComponentManager (#2276) 2020-03-24 16:32:48 -07:00
Pixelflinger
e525a7c7c4 enable some more features in lightbulb
spotlight/contact shadows, ssao, fog, bloom.
2020-03-24 16:15:58 -07:00
Romain Guy
8a84c7f0a3 Install all public headers from libutils 2020-03-24 15:46:23 -07:00
Ben Doherty
e462c22a07 Fix MetalBufferPool crash in completion handler (#2273) 2020-03-24 12:35:54 -07:00
Philip Rideout
3ea8a25127 Add Draco 1.3.6 to third_party. 2020-03-24 10:13:13 -07:00
Romain Guy
45df197bd6 Expose libutils APIs that should have been public (#2269)
* Expose libutils APIs that should have been public

* Don't make JobSystem public for now
2020-03-24 09:57:04 -07:00
Philip Rideout
1ecb83bf73 gltfio: Big internal refactoring / simplification.
This replaces the "bindings" structures with simple types that re-use
data structures from cgltf.

This also moves some trivial work from ResourceLoader to AssetLoader,
which simplifies the communication between these two classes.

Motivated by #1932.
2020-03-24 09:22:20 -07:00
Ben Doherty
aefa03291e Fix spot light shadow bugs related to light culling (#2264) 2020-03-23 16:12:44 -07:00
Pixelflinger
6e02fa186a generateMipmap needs at least 2 levels allocated 2020-03-23 15:05:00 -07:00
Pixelflinger
756074d8bd don't generate fog code in post-process materials 2020-03-23 15:04:42 -07:00
Pixelflinger
2caa09bebd Fix IBL mip calculation
The max mip (i.e. mip at roughness 1) was off by one.
2020-03-23 15:04:24 -07:00
Ben Doherty
72a182122a Update spirv-cross to 871c85d (#2262) 2020-03-20 16:59:47 -07:00
Pixelflinger
0688db7da3 fix a shadow clipping bug
In some situations the shadow map would be too aggressively clipped.
This was due to a bug in the box-frustum intersection algorithm, which
could fail when some vertices of the frustum were inside the box, and
some vertices of the box inside the frustum and the total number
of vertices such classified was 8.
2020-03-20 11:13:18 -07:00
Mathias Agopian
0c6d96c407 Add support for basic fog (#2256)
* Add support for basic fog

* address reviewers comments
2020-03-19 18:01:07 -07:00
Pixelflinger
1f48bd3e79 fix contact-shadows with shadow multiplier 2020-03-19 18:00:41 -07:00
Ben Doherty
7103f4f0b3 Share material dictionaries between GLSL / MSL (#2252) 2020-03-19 11:16:01 -07:00
Ben Doherty
210234255c Fix contact shadow GLSL compilation error (#2254) 2020-03-18 10:05:58 -07:00
Romain Guy
73312bc6bb Update README.md 2020-03-17 12:42:23 -07:00
Pixelflinger
6ea9872a3e fix computation of shading_posiiton for clip space domain shader
When reconstructing the position from clip-space, we need to apply
the .w divide.

Also use getWorldFromClipMatrix() directly.
2020-03-17 00:01:50 -07:00
Mathias Agopian
d54ceff7a3 Add support for screen-space contact shadows (#2245)
* Add support for screen-space contact shadows

This CL adds support and always enables it.
toggles and setting in the next CL (same PR).

* Plumb settings for screen-space contact shadows

screen-space contact shadows is handled like a shadow option,
parameters (including on/off) are set in the LightManager, using
the existing ShadowOptions API.

Additionally there is a per-renderable toggle.

Both toggles are off by default.

* Allow contact shadows when shadowing is auto-disabled


Shadowing can be auto-disabled when for instance there are no
shadow casters in the scene. We still allow contact shadows in
that case.

This would allow for instance, to make the vegetation on a terrain
not shadow-casting, and still get some shadowing there by using
contact shadows instead.

* apply micro-shadowing after contact shadows

also, don't compute contact shadows when we know we're fully shadowed.
2020-03-16 22:39:24 -07:00
Ben Doherty
6cf3e86c8a Fix iOS build samples CI (#2249) 2020-03-13 14:34:37 -07:00
Ben Doherty
acc36e8d9b Deprecating Clang on Windows in CMakeLists (#2243) 2020-03-13 12:33:02 -07:00
Pixelflinger
1670e73287 Revert "enable ASAN's -fsanitize=address in debug builds"
This caused failures in CI builds.

This reverts commit c132ede510.
2020-03-13 11:20:47 -07:00
Romain Guy
3b52b89fd6 Update release notes 2020-03-12 19:18:55 -07:00
Pixelflinger
c132ede510 enable ASAN's -fsanitize=address in debug builds 2020-03-12 19:18:29 -07:00
Pixelflinger
4e62e4f696 include alpha-masked objects in SSAO
this helps a lot with vegetations, which often uses alpha masking
2020-03-12 19:17:39 -07:00
Pixelflinger
c0addf22ed Cleanup render loop to prepare for more features
- decouple the depth and ssao passes, so that the depth
  pass could be used by another client, down the framegraph

- set uniforms/samplers from the execute closure of the color pass,
  instead of using a separate pass. This is more correct and it 
  potentially reduces calls to commitUniforms.

- make setSampler check that the value set is different,
  the idea here is that it's much more costly to have to commit the
  samplers rather than having to compare them. Also realistically we
  don't have a lot of samplers in a frame, so that's not a lot of
  compares.

- one downside of this change is that commands for the SSAO pass are
  always generated, we will fix that in an upcoming change.
2020-03-12 14:31:56 -07:00
Romain Guy
880642ef4a Fix crash in glTF sample for Android 2020-03-12 14:27:11 -07:00
Pixelflinger
2f94e5990c workaround a framegraph bug with imported rendertargets
Imported render targets are only partially implemented, which
caused a discard flags bug. It would happen when an imported
 render target is used more than once like when using SSrefr
without tone mapping.  In that case, the 2nd pass would use the same
discard flags as the first pass.
2020-03-11 22:58:22 -07:00
Pixelflinger
4a5ce16322 Trivially make LinearAllocator 16 bytes instead of 24 2020-03-11 17:04:08 -07:00
Pixelflinger
454b08362d minor code cleanups
- go through 'FIXMEs' & `TODOs` and either fix or remove obsolete ones.
- add a few asserts
- fix some comments and IDE warnings
2020-03-11 17:04:08 -07:00
Ben Doherty
f80c584db0 Update glslang to dbb56a1 (#2232) 2020-03-11 12:34:08 -07:00
Pixelflinger
68bcd6c159 fix setting an array mat3 as a parameter of material instance
this actually makes it possible to set mat3s from java.
2020-03-11 12:26:52 -07:00
Pixelflinger
a9a9061f96 update GLSLPostProcessor optimization passes to latest
deactivate "mergeReturnPass" because it triggers a segfault with
AMD drivers on MacOS.
2020-03-11 11:11:28 -07:00
Pixelflinger
196c98fc2a Fix framebuffer clears
We make sure to only (and always) clear newly allocated buffers,
but only clear existing buffers based on the user request. This
should allow to share the depth buffer between drawing two
Views (if post-process is disabled). This should also fix 
a bug where the intermediate buffer wasn't cleared when blending
a view on to of another.

This should fix #2138
2020-03-11 11:11:09 -07:00
Ben Doherty
9ea2e69579 Fix gltf_viewer (#2233) 2020-03-10 17:57:59 -07:00
Ben Doherty
f4da2ef8ec Add support for spot light shadows (#2209) 2020-03-10 17:53:25 -07:00
Pixelflinger
8fb65a19b4 fix utils::ctz() when builtins are not available
Our fallback 64-bits ctz() was completely wrong. 
The unit tests were wrong too.
2020-03-10 15:41:43 -07:00
Ben Doherty
a2c6c34739 Update SPIRV-Tools to 2020.1 / SPIRV-Cross to 65aa0c3 (#2121) 2020-03-10 15:32:41 -07:00
Romain Guy
a2818037b3 matinfo can print dictionaries, shrink Metal dictionary (#2230)
This change adds new commands to matinfo to print dictionaries.
This feature is useful to debug dictionaries, and I just used
it to identify that using a shared dictionary would save ~12 KiB
in the Android build. The macOS build (GLSL + Metal) would go
down to 71 KiB from 136 KiB.

The SPIRV to Metal conversion leaves leading spaces and some
comments. This change also runs the shrinker on optimized Metal
shaders to further reduce the size of shaders.
2020-03-10 11:42:19 -07:00
Romain Guy
02c7a22d43 Remove build time warning 2020-03-10 08:41:28 -07:00