Commit Graph

228 Commits

Author SHA1 Message Date
Romain Guy
34c170d4da Add Android sample app (#181)
* Add Android sample app

It’s a simple rotating triangle but provides a good overview of how to use Filament on Android

* Remove unnecessary files
2018-08-29 09:01:28 -07:00
Rob Srinivasiah
8fd3f5d413 Properly initialize VulkanBinder::mDescriptorKey (#180)
* Properly initialize VulkanBinder::mDescriptorKey

Previously, the contents of mDescriptorKey were not being initialized during VulkanBinder construction. This could leads to bugs, such as getOrCreateDescriptor finding false entries inside the DescriptorKey::uniformBuffers or DescriptorKey::samplers arrays.

* Spaces instead of tabs

For shame ;(
2018-08-28 17:40:01 -07:00
prideout
a6caacba77 Add missing semicolon. 2018-08-28 17:00:53 -07:00
prideout
86e7afecea Minor code cleanup to filaweb. 2018-08-28 16:58:02 -07:00
Philip Rideout
fa9f597ca4 CMake improvements for samples/web. (#179)
This uses "foreach" in order to create proper dependencies for each
cubemap face and miplevel.

It also adds a custom command for the mesh and envmap assets, similar to
how we already handle materials. This seems to work properly and
rebuilds the assets only when upstream dependencies have been dirtied,
or when downstream dependencies have been deleted.
2018-08-28 16:07:48 -07:00
Ben Doherty
3282fc7984 Introduce property serialization (#175) 2018-08-28 16:01:59 -07:00
Philip Rideout
557dd53233 Add filamesh to HOST_TOOLS. (#178) 2018-08-28 14:39:13 -07:00
Philip Rideout
4665805d81 Minor improvements to EXR decoding. (#177)
See also #176.

This closes #166.
2018-08-28 14:38:54 -07:00
A. Tombs
f78a680b9c Documentation grammar and typo fixes (#174)
* Missing parameter in visibility function equation

The visibility function V_1 depends on l (or v) and alpha, but alpha was omitted in one equation.

* Fix typo its vs it is

* Fix typo usign -> using

* Fix typo algorightm -> algorithm

* Fix typo later -> latter

* Grammar: much less -> many fewer

* Fix missing equation label

Equation was referred to in the text, but did not have its label defined, causing the reference to show up as ???.

* Fix typo itentiy -> itentity

* Fix typo apperance -> appearance

* Fix typo participe -> participate

* Fix typo: scaterring -> scattering

* Consistency: grey -> gray

Since the document mostly uses American English, replace occurrences of "grey" (preferred spelling in UK) with "gray" (preferred spelling in US).

* Fix typo: interemdiate -> intermediate

* Fix typo: anistropic -> anisotropic

* Style: gaussian -> Gaussian

* Fix typo: particulary -> particularly

* Fix typo: subsitution -> substitution

* Fix typo: fomulate -> formulate

* Fix typo: evector -> vector

* Fix typo: tempetature -> temperature

* Fix typo: ar -> at

* Style: lambertian -> Lambertian

* Fix typo: disapears -> disappears

* Fix typo: acounting -> accounting

* Fix typo: simplificationss -> simplifications

* Fix typo: subsitute -> substitute

* Style: light saber -> lightsaber

* Fix typo: cooordinates -> coordinates

* Fix typo: probaility -> probability

* Fix typo: Hammersely -> Hammersley

* Fix typo: Mistuba -> Mitsuba
2018-08-28 11:35:53 -07:00
Philip Rideout
4dd6479a6c Add README instructions for web samples. (#173) 2018-08-28 11:33:47 -07:00
Ben Doherty
9e9e2c4709 Use GetLastError for additional error reporting (#169) 2018-08-28 11:22:34 -07:00
Philip Rideout
db2e1426e9 Introduce two WebGL samples: triangle and suzanne. (#170)
* Introduce two WebGL samples: triangle and suzanne.

This commit has no effect on mobile / desktop builds, it only adds new
targets to the `-p webgl` build.

We will eventually expose a proper JavaScript API, but for now these
samples use a (somewhat under-engineered) `filaweb` framework whereby
the WebAssembly module exposes a small number of C entry points: launch,
render, and resize.

Each sample has two source files: a cpp file and an html file. The cpp
file generates js / wasm pair.  The generated js is simply a loader for
the wasm.

The CMake script creates a pristine "public" folder which contains the
minimal set of files needed to serve the web application using a simple
static file server. The public folder like this:

    /suzanne.js         built by em++ from suzanne.cpp
    /suzanne.wasm       built by em++ from suzanne.cpp
    /suzanne.html       copied from REPO/samples/web
    /filaweb.js         copied from REPO/samples/web
    /favicon.png        copied from REPO/samples/web
    /monkey/*.png       copied from REPO/assets/models
    /monkey/*.filamesh  built by filamesh
    /desert/*           built by cmgen

To decode PNG textures, we use the somewhat unusual approach of using
JavaScript to draw them into a hidden 2D canvas, then reading back the
pixels. This allows us to avoid fattening up the wasm file with a PNG
decoder. An alternative idea would be to pass a DOM Image directly into
glTexImage2D, but this would require some #ifdefing and/or JS injection
in Filament's OpenGL backend.

* Optimize the suzanne material.
2018-08-28 11:09:06 -07:00
Romain Guy
c82b679740 Fix binding of integer attributes (#168)
According to the spec, an attribute declared as an integer (ivec* or uvec* in the shaders) but be bound using `glVertexAttribIPointer` instead of `glVertexAttribPointer`. This means we were not binding bone indices correctly for GPU skinning. This issue was hidden by lenient drivers, particularly on Android.
2018-08-28 10:59:38 -07:00
Romain Guy
88fb551d30 Explains sq() in code snippet
Closes #171
2018-08-28 10:57:59 -07:00
Rob Srinivasiah
d1e00af943 Bind PFD re-used from HGLRC creation (#165)
wglMakeCurrent requires the pixel format match between the HGLRC and HDC. Previously, the pixel format of the HDC wasn't explicitly set, and on most implementations, this leads to a failure.

There's also the option of stashing off the pixel format index, but this minimizes state stashed.
2018-08-28 09:28:18 -07:00
Romain Guy
d74811d5e7 Fix typo in multiscatter equation
Fixes #167
2018-08-28 09:01:36 -07:00
Ben Doherty
276e48fdeb Tungsten: add material parameters editing (#156) 2018-08-27 20:54:30 -07:00
Romain Guy
80c3c3d321 Fix skinning on Vulkan (#162) 2018-08-27 17:53:02 -07:00
Romain Guy
fdced6a166 Fix clang-tidy warnings (#160) 2018-08-27 17:09:50 -07:00
Romain Guy
a779e92b99 Fix clang-tidy warnings (#158) 2018-08-27 14:30:12 -07:00
Cory Bloor
a831c507cf Add missing include to math/mat3.h (#157)
CHAR_BIT is defined in <limits.h>
2018-08-27 14:06:32 -07:00
Romain Guy
89743004f3 Use n instead of shading_normal 2018-08-27 13:35:21 -07:00
Romain Guy
1740f23be4 Remove unnecessary code 2018-08-27 13:34:43 -07:00
Romain Guy
4c2b538422 Explain fp16 transform of the NDF 2018-08-27 13:32:14 -07:00
Romain Guy
959c21b172 mat2 and mat3 need vec2 and vec3 for scale/translate (#155) 2018-08-27 11:14:10 -07:00
Romain Guy
39ca6d146f Fix ambiguities with translate() and scale() (#154)
These two functions expect a vector of the same size as the
matrix's storage vectors (float4 for a mat4f for instance) which
has two major issues:

- The vector must end with 1 for homogeneous coordinates to work
- Passing a single scalar (mat4f::scale(0.5)) creates a matrix
  whose diagonal is set to that scalar, thus breaking homogeneous
  coordinates

With this change scale and translate expect a vector who dimensionality
is 1 less that of the matrix's underlying storage vectors. i.e. a float3
for mat4f.
2018-08-27 10:21:13 -07:00
prideout
155aa44388 Fix mutex lifetime in waitForCommands.
This fixes the regression that I recently introduced in the
single-threaded configuration commit. Many thanks to Mathias and Romain
for catching this.
2018-08-27 08:51:46 -07:00
prideout
3a7d80f29b Restore "Add single-threaded config to Filament. (#130)"
This reverts commit 24022010f9.
2018-08-27 08:51:46 -07:00
Romain Guy
33c44ee9ce Install BlueGL (#148)
* Add READMEs to install packages

* Don't install BlueVK headers, install BlueGL lib
2018-08-27 08:50:35 -07:00
Philip Rideout
24022010f9 Revert "Add single-threaded config to Filament. (#130)" (#152)
This reverts commit e3457aa0a7.
2018-08-26 18:40:49 -07:00
Romain Guy
ca73e73745 Don’t check for nullptr before free() (#151) 2018-08-26 16:24:19 -07:00
Tim van Scherpenzeel
966d1e5de2 fixed three small spelling mistakes (#149) 2018-08-26 10:01:41 -07:00
Ben Doherty
95fb7ae0ab Tungsten: prep for material parameters editing (#141) 2018-08-25 10:25:51 -07:00
Romain Guy
abf4cfba44 Add downloads section 2018-08-24 19:07:17 -07:00
Romain Guy
8cfdf187c5 Add link to build artifacts 2018-08-24 18:48:14 -07:00
Romain Guy
bad06aef9f Cleanup build script 2018-08-24 17:22:13 -07:00
Ben Doherty
2874897dc1 Tungsten: use single-line functions where possible (#144) 2018-08-24 17:18:21 -07:00
Philip Rideout
1dbe386268 Add WebAssembly to the build. (#145)
This does not add any samples or continuous integration, but it at least
allows developers to do a "-p webgl" and check if an actual wasm file
for the core Filament library can be succesfully built.
2018-08-24 17:18:12 -07:00
Philip Rideout
446959042f Make code friendly to WebAssembly. (#140)
This does not add any build stuff or new sample code yet, it just does
some prep to our C++ codebase:

- Similar to Android, WebAssembly will not be using BlueGL. We were
  using a mixture of #if and #ifdef when checking for the existence of
  certain GL prototypes, but the latter is what we want in order to
  build robustly with any GL headers. (We still perform run-time checks
  for extensions, this doesn't change that.)

- Add a trivial ContextManager, does a bit more than Dummy since it
  needs to create an actual driver. This doesn't get compiled yet, it
  just adds files to the tree.

- WebAssembly does not support mmap, execinfo, or asm volatile.
2018-08-24 17:17:40 -07:00
Mathias Agopian
a0d1084b40 assert() when setting bones but skinning is not enabled 2018-08-24 17:07:12 -07:00
Romain Guy
0dd89ef309 Update instructions for Java based systems (#143) 2018-08-24 16:44:20 -07:00
Philip Rideout
e3457aa0a7 Add single-threaded config to Filament. (#130)
* Add single-threaded config to Filament.

This adds a tick method to Engine and disables a couple components
in Renderer (FrameSkipper and FrameInfoManager).

This will make it easier to support WebGL, and will allow us to remove
some of the command buffer debugging stuff that we added for Vulkan.

* tick => execute, and other review feedback

* Restore the ASSERT for FFence::wait.
2018-08-24 16:37:12 -07:00
Romain Guy
b467bb0339 Update README v0.1.0-alpha2 2018-08-24 12:37:11 -07:00
Ben Doherty
4954364d45 Rename Windows CI artifact to filament-windows.tgz (#138) 2018-08-24 10:44:36 -07:00
Ben Doherty
255b6a903c Fix Windows build (#137) 2018-08-24 10:35:21 -07:00
Romain Guy
f9fbb6aef1 Add Windows badge 2018-08-24 10:26:35 -07:00
Romain Guy
ac70617f12 Update spirv-tools (#136)
This completely gets rid of unnecessary highp qualifiers in optimized GLSL code.
2018-08-24 10:24:48 -07:00
Ben Doherty
32993ffda9 Kokoro support for Windows (#135) 2018-08-24 10:13:16 -07:00
Romain Guy
4585b8f896 Add clearCoatNormal property (#131)
* Add clear coat normal map support

This change allows to set a separate normal map for the clear coat layer of a material.

* Document the new clearCoatNormal property

* Fix typo
2018-08-24 08:56:44 -07:00
Mathias Agopian
7a14aadb28 sample clean-up and new sphere object (#134)
* Add missing method to query the type of a light

* IcoSphere now generates front facing triangles

* Add a fairly generic sphere object to use in samples

it provides an ico sphere with normal, and reuses
the same vertex/index buffer for each new instance.
Each instance can have its own material, size and
position.

currently it’s not possible to change the # of
subdivisions.

* FilamentApp now provides a “default” pbr material

this makes it easier to create renderables for
testing.

* clean-up lightbulb and add spheres for each light

lightbulb now has less hardcoded things and it
spawns a small sphere for each light.
2018-08-23 21:12:46 -07:00