Commit Graph
710 Commits
Author SHA1 Message Date
Romain Guy 71a88228e2 Update web badge 2018-09-06 16:12:03 -07:00
Romain Guy 193cfb0fdd Change web badge icon 2018-09-06 16:06:53 -07:00
Romain Guy d31076e558 Add Web build badge 2018-09-06 15:56:54 -07:00
Philip Rideout 3dc75c09f1 Fix continuous web builds by skipping unit tests. (#219)
We do not build unit tests for the web build, so we should skip them.
2018-09-06 15:50:47 -07:00
Philip Rideout 837e01e5a9 Prep for WebGL on Kokoro. (#215)
This adds an archive step to `build.sh` and adds `build/web`.

The archive is a tgz that contains the contents of `public`, which only consists of the files needed for a simple static web server.

The files in `build/web` are almost identical to the mac build, except that they use the `/web/` path and install the emscripten SDK.
2018-09-06 14:30:25 -07:00
Philip Rideout 7b36ed4638 WebGL demos now decode PNG in C. (#214)
This removes the trick of drawing to a 2D canvas. It was corrupting the
alpha in RGBM images, which caused subtle banding in the Suzanne
reflection. Moreover it added complexity to the demo code.

This commit will increase the pre-zipped WASM size by 17k, but I think
it's worth it.

This also removes one of the cmgen passes in the WebGL build; we were
using PNG instead of RGBM for the skybox to work around the banding
issue that this fixes.
2018-09-06 13:48:22 -07:00
Philip Rideout db79bc9729 Fix !! typo. (#213) 2018-09-06 11:04:39 -07:00
Philip Rideout f1324adc7a Work around Firefox by avoiding InvalidateFramebuffer. (#212) 2018-09-06 09:17:20 -07:00
Philip Rideout 9b17472d67 WebGL: use an opaque canvas and legal HTML. (#211)
Some browsers complain about missing charset metadata etc, so this makes
our HTML samples a bit more legit.

Also, using an opaque canvas improves performance and makes it easier to
diagnose bugs.
2018-09-05 17:18:41 -07:00
Romain Guy f550fbaa44 Skip lighting and shadowing computations when possible (#210) 2018-09-05 16:04:38 -07:00
Romain Guy 2eac290161 Make shadowMultiplier objets transparent when not lit (#209) 2018-09-05 15:17:31 -07:00
Philip Rideout 6767258805 Make debug builds of WebGL usable. (#208) 2018-09-05 13:02:56 -07:00
Ben Doherty 7575bcee6e Tungsten: introduce custom view rendering (#205)
* Auto-convert MaterialGraphComponent to Kotlin

* Introduce new view rendering

* Add expressionMap to graph

* Show data width on slots

* Compile all nodes when compiling, even unconnected nodes

* Remove old views
2018-09-05 12:03:34 -07:00
Tim van Scherpenzeel 963342c7cc fix minor error in spelling of stitch (#204) 2018-09-05 12:03:09 -07:00
Philip Rideout edec94bb08 Suzanne fixup: create entities for point lights. (#206)
This was causing an assert with debug builds.
2018-09-05 11:59:26 -07:00
Romain Guy 1c42a122c9 Fix cubemap mirroring (#203) 2018-09-05 11:46:31 -07:00
Romain Guy 91279fa818 Exclude comments from brace parsing in vertex/fragment blocks (#200)
* Exclude comments from brace parsing in vertex/fragment blocks

If a comment contained an opening brace { but not the matching
closing one, matc would not count braces properly and not find
the proper end of a vertex/fragment block.

* Add test
2018-09-04 12:03:16 -07:00
Romain Guy 0a8fad46fe Fix typos 2018-09-04 10:27:15 -07:00
Romain Guy 4c3b9b2fee Remove assert for tiled images (#198)
They are now properly supported
2018-09-04 10:21:12 -07:00
Romain Guy 4da8cbc2f0 Compile Java APIs against Java 1.8 (#199) 2018-09-04 10:18:37 -07:00
Sergey 2dd98893f8 Enable DPI awareness in Windows (#193) 2018-09-04 10:03:30 -07:00
Romain Guy 4eb2c16ad6 Update TinyEXR (#197) 2018-09-04 10:02:48 -07:00
Romain Guy f8a935e028 Cleanup Android sample code
- Free IBL textures
- Refactor loading code to be easier to read/follow
- Simplify some code originally ported from Java
2018-08-31 21:52:31 -07:00
Ben Doherty bef9a9d2c4 Tungsten: introduce handling for varying dimensionality (#191)
* Introduce dimensions to Expression

* Rename to setExpressionForSlot and add redComponent function

* Add Expression helpers to aid with differing data widths

* Add Float2ConstantNode

* Single-line functions when possible
2018-08-31 18:16:57 -07:00
Romain Guy c20b452a74 Add new Android sample: IBL and meshes (#192) 2018-08-31 18:13:22 -07:00
Romain Guy 0df72a736f Destroy entities properly 2018-08-31 14:35:13 -07:00
Romain Guy af0cac72e5 Position the camera in a less confusing spot 2018-08-31 14:29:19 -07:00
Romain Guy a6722c1f12 Add new Android sample app (#190)
This sample app shows a lit, rotating cube
2018-08-31 14:20:57 -07:00
Romain Guy f14ff58a89 Add Engine.destroyEntity (#189)
To match the C++ APIs
2018-08-31 10:37:51 -07:00
Romain Guy 0097fc404e Automatically rebuild materials from Gradle (#183)
* Automatically rebuild materials from Gradle

* Share Gradle tasks
2018-08-30 10:36:54 -07:00
Romain Guy 4002498438 Add new HDR environment maps in third_party (#182)
These are much better than the ones we had in assets/
2018-08-29 14:22:58 -07:00
Romain Guy 775c53f62c Wrap long line 2018-08-29 09:19:17 -07:00
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