Commit Graph

18 Commits

Author SHA1 Message Date
bjorn 8462beef00 Fix/improve alpha cutoff;
The current flag did not work because float shader flags are not
supported.  It was also not very useful because it was per-shader
and did not use the alpha cutoff property of glTF materials.

Instead, let's turn the shader flag into an enable/disable boolean,
and add a scalar material property named "alphacutoff" that gets
read by the glTF importer.

When the alphaCutoff flag is enabled, the material property will be
compared against the pixel's alpha value to decide whether it should
get discarded.
2021-12-28 21:10:52 +02:00
bjorn 8164e0b6e8 TextureData is now named Image!;
The existing Image construct was renamed StorageImage.
2021-02-08 20:17:47 -07:00
bjorn bc4cde1653 Adjust lovrRelease signature; 2021-02-08 17:52:26 -07:00
bjorn 3ded60948f rm core/ref; rm lovrAlloc; util does refcounting; 2021-02-08 17:26:44 -07:00
bjorn 6c2679e00f Fix model loading edge case; 2020-08-26 04:41:15 -06:00
bjorn 75e26f0051 Move core/hash to core/util; 2020-05-19 13:49:40 -06:00
bjorn 443376efde ModelData: Use union for transform fields;
Nodes can have either a transform matrix, or decomposed transform
properties, but never both.  Using a union means we can store both
of those variants in the same piece of memory, using the existing
matrix boolean to figure out which one to use.

This reduces the size of the struct by 48 bytes (152 -> 104), which
ends up speeding up some model operations, I'm guessing due to the
CPU cache.
2020-02-11 16:38:31 -08:00
bjorn 403ed8d3b0 Windows; 2019-12-10 12:19:50 -08:00
bjorn d21911d010 Add core/map hash table; rm lib/map; 2019-10-30 00:07:05 -07:00
bjorn bd773d2d6c Add materialMap to ModelData; 2019-08-09 15:14:22 -07:00
bjorn d0ee0d9b1a glTF: Fix transform for scenes with multiple root nodes; 2019-07-19 16:42:13 -07:00
bjorn 3c07ad6b0b Replace Animator with Model:animate; 2019-07-10 22:08:19 -07:00
bjorn b54f68a3d5 glTF: Support Textures with missing images and samplers; 2019-06-20 17:44:30 -07:00
bjorn 22fe333150 Update refcounting (again);
- Ref struct only stores refcount now and is more general.
- Proxy stores a hash of its type name instead of an enum.
- Variants store additional information instead of using a vtable.
- Remove the concept of superclasses from the API.
- Clean up some miscellaneous includes.
2019-06-02 01:02:26 -07:00
bjorn 4221c547d7 glTF: Add support for base64 buffer data; 2019-05-26 21:13:59 -07:00
bjorn 4cc154fdfa More number conversions; 2019-05-20 20:35:07 -07:00
bjorn 7645f4c014 Add core folder; 2019-05-20 02:47:33 -07:00
bjorn a17f10e273 Add modules folder; 2019-05-19 00:38:35 -07:00
Renamed from src/data/modelData_gltf.c (Browse further)