Commit Graph

30 Commits

Author SHA1 Message Date
magicwhale
27f8dbef21 Added support to gltf_viewer for multiple UV coordinates (#578)
gltf_viewer can now display models that use both UV0 and UV1 coordinates for textures.
2018-12-05 12:35:26 -08:00
magicwhale
b902a90285 Changed MeshAssimp to dynamically generate materials with filamat (#563) 2018-12-03 10:15:47 -08:00
Philip Rideout
af799e734a FilamentApp can now use KTX environments.
When cmgen creates ktx files, it creates a pair: one with an _ibl suffix
and one with _skybox. This convention is now honored by FilamentApp.

Note that we already have several KTX environments in the repo, so you
can clone a fresh repo and do:

  gltf_viewer --ibl={FILAMENT}/docs/webgl/pillars_2k DamagedHelmet.gltf

Note that we have several hundred files in samples/envs, we should
consider replacing those or copying the environments in docs/webgl
(which git would internally de-dup, due to content hashing).
2018-11-30 14:09:04 -08:00
Philip Rideout
0b84425bd0 Fix up tangents in MeshAssimp to help with #528.
We started to write our own implementation of mikktspace, but it
required an unindexed mesh for input. This was awkward because assimp is
already applying a pipeline of operations that includes tangent
generation and indexing. It felt reduandant to add our own pipeline on
top of that (unindexing => tangentgen => reindexing).

Since assimp's CalcTangentsProcess method is already producing
tangents that follow the orientation implied by texture coordinates,
this simply needs to be tweaked to match glTF. (flip the bitangent)

Also fixed a bug for the case where models have neither UV's nor
tangents, where we were calling norm instead of normalize. :)
2018-11-28 15:46:04 -08:00
magicwhale
2a5e978f2e Changed MeshAssimp to use constants defined in assimp header files 2018-11-28 12:15:24 -08:00
Philip Rideout
91abaf575b Add tangents utility to fix #532.
I tested this by writing a quick-and-dirty Sphere demo.
2018-11-28 11:27:37 -08:00
magicwhale
ad1f3cf133 Added support for different min and mag filter samplers in gltf_viewer (#539)
Modified MeshAssimp.cpp to support different min and mag filter types for gltf files.
2018-11-28 10:03:07 -08:00
Philip Rideout
0011b1bba3 Use resgen in samples and MeshAssimp. 2018-11-28 08:35:44 -08:00
Romain Guy
588ce8fe3f More code style cleanup 2018-11-26 14:07:07 -08:00
Romain Guy
44c4362edb Code style cleanups 2018-11-26 14:04:43 -08:00
Romain Guy
20ffb52dc2 Re-enable glTF support (#505)
* Revert "Rollback MeshAssimp enhancements."

This reverts commit b3dce967eb.

* Re-enable glTF support

* Start looking for texture ids at 1, not 0

* Detect if the importer is glTF

* glTF and regular materials both work
2018-11-26 13:14:28 -08:00
Philip Rideout
b3dce967eb Rollback MeshAssimp enhancements.
This caused regressions with some of our samples like vk_hellopbr:

- For the new 1x1 textures, RGB isn't accepted by Vulkan and Metal.
  Currently these platforms require RGBA, although we plan on adding
  reshaping functionality for the future.
- Too many texture samplers in a single shader, this causes a run time
  error. This could be alleviated by creating an atlas.
- vk_hellopbr assumes that all materials have a "metallic" param.

Going forward, we plan on creating a new library that avoids MeshAssimp,
so for now let's just disable gltf_viewer.
2018-11-19 14:18:12 -08:00
magicwhale
fc0d587b40 Added support for more features in gltf_viewer sample 2018-11-19 09:27:08 -08:00
magicwhale
1d392d38bd updated assimp 2018-11-19 09:27:08 -08:00
magicwhale
bc38c8a773 Edited MeshAssimp and added gltf_viewer sample code 2018-11-19 09:27:08 -08:00
Philip Rideout
9e5f44bd34 Consolidate two filamesh readers into a lib. 2018-10-16 13:31:16 -07:00
Philip Rideout
c6cef9ff9c NEW API: add RGBM flag to Texture.
This change will allow the skybox use a compressed texture format.

For now, the old internal format "RGBM" is still honored, but in a
forthcoming change we will replace the enum with UNUSED.
2018-10-08 11:33:06 -07:00
Mathias Agopian
2c4ecebf11 Minor importance sampling tweaks and code clean-up (#342)
* cleanup importance sampling code

* Add VNDF importance sampling -- work in progress.

* minor code cleanup
2018-10-04 15:21:34 -07:00
Romain Guy
a779e92b99 Fix clang-tidy warnings (#158) 2018-08-27 14:30:12 -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
3a7d80f29b Restore "Add single-threaded config to Filament. (#130)"
This reverts commit 24022010f9.
2018-08-27 08:51:46 -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
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
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
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
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
65a42a518c Add material_testbed application (#97)
* Add material_testbed application

This application can be used to automatically vary material parameters over multiple frames and capture each frame as a PNG file. This makes it easier to test/compare/etc. It's also useful to generate documentation examples.

* Rename material_testbed to frame_generator
2018-08-14 18:01:31 -07:00
Romain Guy
c429af310e Cleanup sample code 2018-08-13 17:01:04 -07:00
Romain Guy
b3d758f3b3 Initial commit 2018-08-03 10:38:22 -07:00