Commit Graph

18 Commits

Author SHA1 Message Date
Ben Doherty
38ede3719f TangentSpaceMesh fixes (#6697) 2023-03-31 12:03:49 -07:00
Powei Feng
9d30233a38 geometry: clean up TangentSpaceMesh (#6595)
- Reordered the 'const var' declarations to 'var const'
 - Use std::vector for data arrays instead of manually managing
   allocations
2023-03-03 15:33:28 -08:00
Powei Feng
d12612f091 Add UV-based tangent space algorithms (#6572)
Added mikktspace as a third party lib
2023-02-24 09:32:02 -08:00
Powei Feng
b3513c7d1f geometry: Add TangentSpaceMesh implementations (#6530)
geometry: Add TangentSpaceMesh implementations

Added:
 - Hughes-Moller
 - Frisvad's method
 - Flat shading
2023-02-10 09:34:49 -08:00
Powei Feng
45246b6109 geometry: Add TangentSpaceMesh class outline (#6476)
- Defined class with documentation in comments
 - Implemented algorithm selection
 - No actual algorithms written yet

Part of google/filament#6358
2023-01-26 14:39:48 -08:00
ViktorHeisenberger
565d385132 Use Frisvad's method to compute tangent space from normals-only mesh input (#6313)
* Change tangent basis computation for normals-only to Frisvad's method

* Update RELEASE_NOTES.md
2022-11-22 09:30:37 -08:00
Philip Rideout
e81d053f35 gltfio: fix morphing for non-packed floats. 2022-06-03 07:54:42 -07:00
Philip Rideout
6178ba4a6b Add Transcoder API for C++ clients. (#3837)
* Add Transcoder API for C++ clients.

We will add JavaScript and Java support in a later PR.

* Transcoder: use fixed inner loop in some cases.

This lets clang produce better ARM code for common cases.

* Transcoder: stronger typing in Config, etc.

* Transcoder: add UTILS_RESTRICT and noexcept.
2021-04-22 13:29:52 -07:00
Philip Rideout
c3d6c853ab gltfio: robustness improvements for Draco meshes.
These changes are motivated by #3815.

See also:
    https://github.com/KhronosGroup/glTF-Blender-IO/issues/1326
    https://github.com/KhronosGroup/glTF-Blender-IO/issues/1345
2021-04-21 18:09:45 -07:00
Philip Rideout
a61bc51271 Add Java bindings for SurfaceOrientation.
Note that libgeometry is already included in `filament-android`, this
simply exposes more of its existing functionality.

The Java version of SurfaceOrientation is similar to the JavaScript
version because we are bundling it into the main Filament package, even
though it is a separate library in C++. This is much simpler than
creating a brand new Java package.

New Android sample that tests this is forthcoming.

Fixes #1729.
2020-02-11 12:38:06 -08:00
Philip Rideout
891e85ba2b gltfio: add nominal support for flat shading.
This "fixes" the new animated Fox model in the glTF conformance suite.
As per the glTF spec, we now generate per-face normals for the case
where normals are not specified in the model.

Note that true flat shading (i.e. flat interpolation) is not a
requirement in the glTF spec, since some Khronos members advocate for
WebGL 1.0 compatibility.

Fixes #2088.
2020-02-10 14:29:04 -08:00
Philip Rideout
709c5884ea geometry: tweak provided tangents to enforce orthonormality.
Fixes #1291.
2019-06-12 16:44:18 -07:00
Philip Rideout
57fffab7b6 Improve SurfaceOrientation robustness when using UVs. (#1161)
Fix #1158
2019-05-03 08:18:13 -07:00
Romain Guy
7b87662db0 Don't flip the normals (#1060)
* Don't flip the normals

* Fix the ubershader as well
2019-04-01 12:04:27 -07:00
Philip Rideout
ce50ea17c0 Avoid NaN when normal is colinear with fake axis.
I reproduced the issue by hacking our redball demo and visually
verified the fix.

cc @AdrianAtGoogle
2019-03-12 14:30:25 -07:00
Philip Rideout
13cd77bc9a SurfaceOrientation now supports uint32 indices. 2019-03-01 07:27:03 -08:00
Philip Rideout
ace38eff24 SurfaceOrientation cleanup per code review. 2019-02-27 08:47:24 -08:00
Philip Rideout
6d1e0ed6f4 Introduce SurfaceOrientation helper class.
This moves our existing VertexBuffer utility into a new "geometry"
library and adds new functionality for computing tangents based on UV's.
The UV-based method comes from Eric Lengyel.

We considered mikktspace (which thankfully has a zlib-style license) but
it would require re-indexing via meshoptimizer and is therefore a bit
heavyweight.

The new library has no dependencies and will add only 7 KB to Filament's
Android aar file.

Fixes #858 and preps for #528.
2019-02-27 08:47:24 -08:00