Commit Graph
2689 Commits
Author SHA1 Message Date
Romain Guy 3e5fe994b9 Fix default lighting intensities in ModelViewer
They were waaay too high
2020-05-05 00:25:19 -07:00
Romain Guy 05def1a789 Update AGP 2020-05-04 17:55:39 -07:00
Philip Rideout b36d29ef77 Vulkan: fix array textures.
This fixes a crash with `lightbulb -m`.

- During VkImage creation, the subresource depth should be 1 since it is
  meant for 3D textures.
- Render targets should select a single level from an array texture, not
  all of them.
- Add debug_trap to validation errors to make them easier to debug.
2020-05-04 15:51:27 -07:00
Pixelflinger 898ae083ee asserts that the engine is not terminated in flushAndWait() 2020-05-04 14:29:01 -07:00
Nakshathru Ajay 9c75c1ecfa Adding support for openjdk 13 (#2477)
Updated gradle version to 6.3 for openjdk 13 support
2020-05-04 09:15:12 -07:00
Pixelflinger 13767c3bb4 Don't use gl_FragCoord anywhere as it breaks with custom viewports
This fixes dynamic lighting and SSAO when a viewport is not in 0,0.
In practice this currently happens only when all post-processing is
disabled.

Instead of using gl_FragCoord we introduce a new API, 
getNormalizedViewportCoord(), which as the name implies returns
normalized [0, 1] viewport coordinates with origin at the bottom-left,
on all platforms.

This is implemented in this PR by interpolating gl_Position.
2020-05-01 23:51:17 -07:00
Pixelflinger 064ebd56e0 Reduce DoF sample count from 25 to 11
We keep very the same (or very close) quality by exploiting h/w
filtering. On the flip side, this is not compatible with dithering,
which is removed here.
2020-05-01 23:50:49 -07:00
Pixelflinger b514b2e996 GL backend: Fix an issue with discardEnd flags
In OpenGL with use glInvalidateFramebuffer() for hinting controlling
the load/store of tiles. However, glInvalidateFramebuffer() conceptually
destroys the content of the framebuffer attachment.

This causes a problem when we want for instance to use a buffer for
reading only (e.g. a depth buffer) in multiple passes. In such
scenario, the attachment will be marked as "discard" (which is a
misnomer for storeOp==DONT_CARE in vulkan parlance), without the
intention of making the buffer invalid.

We fix this by ignoring the discardEnd flags entirely if a buffer
has not been written. In this case, we relying on the driver to not
write the tiles out -- but we don't have any other way to express
this in GL.

This issue cannot be encountered currently because the framegraph 
is not aggressive enough setting the discardEnd flags.
2020-05-01 18:19:23 -07:00
Philip Rideout 8c7fbb2e01 Fix stale IBL string in shadowtest sample. 2020-05-01 16:45:59 -07:00
Ben Doherty 3e67f628ee Bump version to 1.6.0 (#2474) v1.6.0 2020-05-01 15:58:56 -07:00
Pixelflinger 3bd1afedbd compute bitangeant in fragment shader
This saves 4 varying components.
Fixes #2092
2020-05-01 14:41:03 -07:00
Pixelflinger f19533b149 fix a arithmetic error in SSR when a symmetry was present
Make sure that Camera returns a positive field-of-view, even when
the projection matrix has a symmetry (negative scaling).
2020-05-01 10:15:07 -07:00
Pixelflinger dc5c48de33 fix a couple missing 'highp' qualifiers 2020-05-01 10:14:44 -07:00
Ben Doherty fc4b88b5e9 Fix incorrect lightspace 2D bounds calculation for stable shadows (#2468) 2020-05-01 08:56:09 -07:00
Philip Rideout 116b475161 Both Vulkan timestamps should use BOTTOM.
As per the spec:

```
vkCmdWriteTimestamp latches the value of the timer when all previous
commands have completed executing as far as the specified pipeline
stage, and writes the timestamp value to memory.
```
2020-04-30 13:37:21 -07:00
Philip Rideout cab4a660d3 Vulkan: fix race condition with queries. 2020-04-30 13:37:21 -07:00
Philip Rideout 72dafa4887 Vulkan: add support for timer queries. 2020-04-30 13:37:21 -07:00
Pixelflinger 4e873e8007 A new depth of field (DoF) post-process effect 2020-04-30 13:22:28 -07:00
Ben Doherty 64609cc4aa Update RELEASE_NOTES.md 2020-04-30 10:15:46 -07:00
Ben Doherty 8dc526b536 Update RELEASE_NOTES.md 2020-04-30 10:14:24 -07:00
Ben Doherty 0769aabf29 Add intensityCandela API to LightManager (#2465) 2020-04-30 10:12:09 -07:00
Pixelflinger db53ce62ad fix LightManager::forEachComponent()
the Instance id was off-by-one and didn't match the
given entity.

in gltf_viewer this caused contact shadows to not work
when there was only a single directional light
2020-04-30 00:23:39 -07:00
Ben Doherty d91eb1180f Respect all of ShadowOptions when building a light (#2463) 2020-04-29 08:46:41 -07:00
Philip Rideout 89d47eb05a Vulkan: fix lots of validation errors. 2020-04-29 08:45:23 -07:00
Ben Doherty e985546e81 Set a clear color when no IBL is present (#2440) 2020-04-28 17:57:12 -07:00
Romain Guy 8036d65adf Don't trip assert in debug 2020-04-25 17:01:28 -07:00
Romain Guy 6a95807105 Better fix for texture unit spew 2020-04-25 16:55:30 -07:00
Romain Guy 0a387e16d9 More key fixes for ImGui 2020-04-25 16:15:32 -07:00
Romain Guy 1ec45c670b Fix more ImGui key clashes 2020-04-25 16:10:53 -07:00
Romain Guy 5a9ebf8db0 Always bind the structure sampler (#2462) 2020-04-25 14:33:48 -07:00
Romain Guy abd852a9aa Improve matinfo output 2020-04-25 14:17:38 -07:00
Romain Guy 2c29c67df0 Cleanup on exit 2020-04-25 14:10:13 -07:00
Romain Guy 1d73027df6 Use a different key for spotLightEnabled 2020-04-25 13:59:36 -07:00
Romain Guy 54a4545ac5 Update README 2020-04-25 10:37:13 -07:00
Romain Guy 14ce9e30b9 Make the build more quiet (#2457)
* Make the build more quiet

* Add mising include
2020-04-25 01:13:30 -07:00
Romain Guy cc6361e4f9 Make CI scripts safer (#2456)
- Added an extra README file detailing what the scripts are for
- The scripts now display a warning and a prompt before requiring user confirmation to continue
- The system install commands are only executed in CI environments (ninja and cmake being installed as root without checking for the environment was a leftover from a previous non-GitHub based CI setup)
2020-04-25 01:03:29 -07:00
Ben Doherty 45ce2d3a17 Fix crash when using free flight and hovering outside of the window (#2454) 2020-04-24 15:38:15 -07:00
Pixelflinger 1b6c25ce68 some old adreno drivers don't support bool in UBOs
Fixes #2418
2020-04-24 15:10:37 -07:00
Philip Rideout e10530d3bb Vulkan: fix InvalidImageLayout validation errors.
It is illegal for shaders to sample from images that have a blit layout.
2020-04-24 08:47:19 -07:00
Pixelflinger 043cdcfcff simpify froxel GPU data structure
instead of storing two counters for point and spot lights, we now
only have a single counter for both, and the light data structure
has a type, the shader can use to decide what to do -- instead of
using two loops. In practice spot and point light code is very similar 
anyways. 

This simplify a lot the CPU side (as in make it less complex) and frees
up 8-bits in the per-froxel GPU data structure.
2020-04-24 01:42:27 -07:00
Pixelflinger 880bf0f061 remove the froxel remaping (unused) code
this was just an experiment, we'll never use it.
2020-04-24 01:42:27 -07:00
Philip Rideout 7bbea3e503 Vulkan: add support for 2D texture arrays.
In Vulkan, the arrayness of a texture is an aspect of the "image view",
not the image itself.

In my earlier attempt I used VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT on
the image, which MoltenVK does not support. Confusingly, that flag is
actually meant for rendering into a slice of a 3D texture, which we are
not doing.

Vulkan is hard.
2020-04-23 13:03:18 -07:00
Mathias AgopianandBen Doherty f8e0cedcdb Add java doc for LightManager (#2441)
* Add java doc for LightManager

Co-Authored-By: Ben Doherty <bendoherty@google.com>

Co-authored-by: Ben Doherty <bendoherty@google.com>
2020-04-23 11:02:57 -07:00
Pixelflinger 2a2c339cf5 improve code that generates froxel planes
we can calculate each plane direction from its clip-space equation
(which is trivial), instead of back-projecting 2 points and computing
the cross-product
2020-04-23 10:59:13 -07:00
Benjamin Doherty 9dcb1181f3 Fix camera mode optstr 2020-04-22 16:38:22 -07:00
Ben Doherty 09d9bbb035 Add camera flag to gltf_viewer and material_sandbox (#2438) 2020-04-22 15:23:18 -07:00
Philip Rideout 354d3222cb Vulkan: fix bad depth clears.
The Vulkan backend was failing to clear the depth buffer in apps that do
not have a textured skybox, such as hellotriangle.
2020-04-22 15:22:32 -07:00
Philip Rideout e6be4c312b Fix warnings. 2020-04-22 15:19:37 -07:00
Philip Rideout 0e2cf44ca4 Skybox now binds dummy texture.
This fixes unbound sampler warnings, as seen in our hellotriangle app.
2020-04-22 13:08:20 -07:00
Ben Doherty 2e0e19d9ce Add a new free flight camera manipulator (#2436) 2020-04-22 13:04:19 -07:00