Commit Graph

174 Commits

Author SHA1 Message Date
Philip Rideout
099738e545 Try to clean up asset folders for sample apps. (#128)
* Try to clean up asset folders for sample apps.

This removes the build step where we copy a subset of assets, and makes
it so that FilamentApp hands out a "root path" for assets. For now this
is determined based on the location of the executable. This allows
developers to launch samples from any CWD.

Closes #11

* Restore asset copy to build.
2018-08-23 12:46:45 -07:00
Philip Rideout
7fff7d715f Update VkMemAlloc and fix its usage. (#126)
This implements the following suggestions from Adam Sawicki:

(1) Update VkMemAlloc to dev branch.
(2) Use VMA_MEMORY_USAGE_CPU_ONLY in the stage pool.
(2) Add vmaFlush after every vmaUnmap.

We also considered removing Map / Unmap in favor of persistent mapping
via VMA_ALLOCATION_CREATE_MAPPED_BIT, but decided to be conservative
until we have a chance to rethink our UBO update strategy.

Closes #19
2018-08-23 10:20:12 -07:00
Philip Rideout
aa518369b4 Move deprecated Image out of libs. (#125)
This moves the old Image class into cmgen because it is the only client
that still uses it. We can migrate cmgen to LinearImage in the future.
2018-08-23 10:19:02 -07:00
Mathias Agopian
c0a3fc51a4 improve vectorization by massaging the code a bit 2018-08-23 10:16:29 -07:00
Mathias Agopian
fc98c775c5 more work towards working light-trees
- improve API of computeLightTree() which should 
  now be functional.

- pre-calculate the range of each light in
  screen-space, so we don’t have to do so
  over and over again in computeLightTree().

- define the GPU-side “node” for the light-tree,
  this is a place-holder until we really implement it.
2018-08-23 10:16:29 -07:00
Romain Guy
f8c87f8f81 Update screenshots 2018-08-22 16:29:32 -07:00
Romain Guy
d237406ccd Clean up multiscatter and single scatter specular combination 2018-08-22 15:58:04 -07:00
Mathias Agopian
9a129dca1e improve BinaryTreeArray unit test
make sure we visit children before the parents.
2018-08-22 14:55:17 -07:00
Mathias Agopian
1f3dad48b6 Improve Binary Tree Array by getting rid of the recursion
We use a stack instead, it’s not terribly different
from the recursion but it saves function calls
which use a lot more stack than needed.
2018-08-22 14:55:17 -07:00
Mathias Agopian
38de58007c checkpoint: ground work for calculating binary light trees
computeLightTree() takes a list of light as
a bitfield and produces a depth-first 
binary tree array that can be used to efficiently
check which lights volumes contain a given z
coordinate in screen space.

Currently computeLightTree() produces the array
locally on the stack, which isn’t useful, but
before we can make use of it, a lot of other
things have to happen.
2018-08-22 14:55:17 -07:00
Mathias Agopian
4fed143099 pass CameraInfo to froxelizer 2018-08-22 14:55:17 -07:00
Mathias Agopian
8249a8a6d7 Always sort lights by distance to the camera-plane
This will be useful later.
2018-08-22 14:55:17 -07:00
Adrian Perez
d9c07220c8 FrameUniforms.resolution gets consistent precision between VS/FS (#122)
* Add option USE_EXTERNAL_GLES3

Causes gl_headers to use GLES, even on desktop.
Causes all ContextManagers to be elided;
users are expected to provide their own.

* FrameUniforms.resolution gets consistent precision between VS/FS
2018-08-22 14:53:47 -07:00
Philip Rideout
e45e7b256d Introduce mipgen frontend. (#120)
* Introduce mipgen frontend.

For now this is fairly simple although it does let you choose a filter.
Another cool feature is that an HTML file is generated which makes it
easy to review the generated miplevels.

This does not expose the Boundary enum to users because it has not yet
been implemented in the core Image library.

* Fix up mipgen per code review.
2018-08-21 17:54:27 -07:00
Romain Guy
b587ec3f43 Fix revision formatting 2018-08-21 15:55:48 -07:00
Romain Guy
b86928179b Document energy compensation for multiscattering BRDFs (#121)
* Document better BRDFs

- Document the loss of energy in the specular BRDF
- Start documenting the gain of energy in the diffuse BRDF

* Explain energy compensation with second scaled lobe

* Add multiscattering pre-integration
2018-08-21 15:51:54 -07:00
Mathias Agopian
c8c61fdb8a more froxel optimizations (#118)
* better froxel records compression

We used to compress froxel records by reusing the
previous record on the left if it was identical,
now we additionally check the record above if
that fails.

In practice this saves 10% to 30% space in the
froxel record buffer, which is a scarce resource 
for us.

e.g. if a light occupied 3x3 froxels in a given 
z-slice, without compression 9 records would be
used, with left-only compression, only 3, 
and with left+above compression, only 1.

* use size_t for in and out parameters

this helps the compiler in many places, not
having to cast from 64 to 32 bits.

* implement bitset’s any() and all() operations with NEON

* empty froxels are a common case, handle it first
2018-08-20 16:45:16 -07:00
Philip Rideout
d12021a196 Fix args to update-alternatives. (#117) 2018-08-20 15:37:52 -07:00
Romain Guy
d91129d42c Merge branch 'master' of https://github.com/google/filament 2018-08-20 14:53:38 -07:00
Romain Guy
424fd3a6e6 Add more f0 sample values 2018-08-20 14:53:35 -07:00
Romain Guy
e329ec1872 Fix typo 2018-08-20 12:27:49 -07:00
Adrian Perez
c1ebe11f3a Add option USE_EXTERNAL_GLES3 (#116)
Causes gl_headers to use GLES, even on desktop.
Causes all ContextManagers to be elided;
users are expected to provide their own.
2018-08-20 12:26:53 -07:00
Romain Guy
0b914d2ad3 Filament is a real-time renderer 2018-08-20 11:48:22 -07:00
Mathias Agopian
5ed80bc616 Add ctz to utils::algorithm
Use CTZ in bitset.forEachBitSet() so we can
efficiently go through them in order instead of
reverse order.
2018-08-17 19:48:23 -07:00
Adrian Perez
0491c65517 Fix ContextManagerDummy to compile when enabled (#114) 2018-08-17 17:48:37 -07:00
Romain Guy
103ec98d8b Fix test_bluegl on macOS and Windows (#113)
* Fix test_bluegl on macOS

We need to make the context current and request a core profile.

* Fix windows testing code
2018-08-17 16:50:30 -07:00
Mathias Agopian
da87405b68 option to reorder the froxel info for better cpu cache utilization
This changes the layout of the froxels data
structure in the GPU so that the major axis
is the Z axis instead of X. The idea is that
within a given screen-space tile, we have a high
probability to access froxels at the same x/y
but different z.

This is turned off right now, as it requires
a change that breaks existing compiled materials.
2018-08-17 13:44:09 -07:00
Romain Guy
a597127d59 Merge branch 'master' of https://github.com/google/filament 2018-08-17 12:06:23 -07:00
Romain Guy
ae1ad6f8b0 Describe F a bit more 2018-08-17 12:06:20 -07:00
Philip Rideout
07e4db795f Remove lots of reinterpret_cast. (#112)
* Remove lots of reinterpret_cast.

* Improve terseness with auto.
2018-08-17 12:01:32 -07:00
Philip Rideout
044387308a Migrate imageio to LinearImage. (#111) 2018-08-17 11:22:05 -07:00
Romain Guy
7a296f3d6b Add revisions section to the documentation 2018-08-17 10:09:08 -07:00
Mathias Agopian
63e2f69c16 add more pseudo vector swizzle to lib math
vec3: yz
vec4: yz, zw, yzw
2018-08-16 22:36:30 -07:00
Mathias Agopian
03628bbd53 really fix the previous froxelization bug
apparently off-by-one’s hard. The first row of
our *source* froxel data must be skipped because
it contains a bit mask representing wether a light
is point or spot.
2018-08-16 21:10:17 -07:00
Mathias Agopian
87b42f0837 minor clean-up 2018-08-16 20:43:30 -07:00
Mathias Agopian
82c0ff6f30 fix small bug that caused the first column of froxel to be empty
we were also off-by-one when reading the froxels’s
bounding spheres.
2018-08-16 20:43:30 -07:00
Romain Guy
f3e0137c2b Fix misguiding comments in the docs 2018-08-16 18:25:10 -07:00
Romain Guy
50bb3f3530 Add energy conservation/loss images for documentation 2018-08-16 16:44:00 -07:00
Romain Guy
8c9c49e2b9 Fix potential null pointer crash
Passing `-y` without specifying an IBL on the command line would lead to a crash.
2018-08-16 16:32:15 -07:00
Romain Guy
70f5bc4291 Add section on specular colors
It explains how to compute f0 for conductors from measured spectral data.
2018-08-16 16:10:13 -07:00
Romain Guy
3b110e3774 Fix uninitialized vectors in envmap processing 2018-08-16 14:56:00 -07:00
Romain Guy
58520d7d32 Add spherical harmonics extraction test (#105)
We use a white furnace to test that spherical harmonics are properly computed.
2018-08-16 14:35:12 -07:00
Romain Guy
df146c3cba Update build instructions
Explain how to skip building the Java bindings
2018-08-16 11:40:29 -07:00
Morten Olsen Lysgaard
178502c8a6 CMakeLists.txt: use CMAKE_CURRENT_SOURCE_DIR instead of CMAKE_SOURCE_DIR to enable embedding of filament as a subdirectory in a larger CMake project. (#103) 2018-08-16 09:25:04 -07:00
Romain Guy
e439c779a2 Don't use $CMAKE_SOURCE_DIR, let's use $FILAMENT instead
See pull request #103
2018-08-16 09:08:57 -07:00
Cory Bloor
2dc0d278ac Enhance CMake compiler check on Linux (#102)
* Enhance CMake compiler check

This commit adds a check for compilers that don't meet the project's
minimum requirements. It will catch Clang versions that are too low as
well as any non-Clang compilers.

* Change SEND_ERROR to FATAL_ERROR
2018-08-15 18:05:02 -07:00
Philip Rideout
6d9668ccf6 Add unit test for cross cube images. (#101) 2018-08-15 15:36:17 -07:00
Romain Guy
7547cd9ee5 Update images for the documentation 2018-08-15 13:57:48 -07:00
Romain Guy
24dc24ce86 Add explanations about the Fresnel term 2018-08-15 13:13:48 -07:00
Mathias Agopian
2bdf4c7911 use pointers instead of std::array<>::iterator (#100)
some STL implementations assert when iterators are
out of range (even without dereferencing).
2018-08-15 12:59:28 -07:00