diff --git a/README.md b/README.md
index ef8aa26a6b..d66791b606 100644
--- a/README.md
+++ b/README.md
@@ -31,7 +31,7 @@ repositories {
}
dependencies {
- implementation 'com.google.android.filament:filament-android:1.16.0'
+ implementation 'com.google.android.filament:filament-android:1.16.1'
}
```
@@ -52,7 +52,7 @@ Here are all the libraries available in the group `com.google.android.filament`:
iOS projects can use CocoaPods to install the latest release:
```
-pod 'Filament', '~> 1.16.0'
+pod 'Filament', '~> 1.16.1'
```
### Snapshots
@@ -151,9 +151,9 @@ steps:
- [x] Points
- [x] Lines
- [ ] Line Loop
- - [ ] Line Strip
+ - [x] Line Strip
- [x] Triangles
- - [ ] Triangle Strip
+ - [x] Triangle Strip
- [ ] Triangle Fan
- Animation
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index 1cf404fa45..abb366bba3 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -3,7 +3,11 @@
This file contains one line summaries of commits that are worthy of mentioning in release notes.
A new header is inserted each time a *tag* is created.
-## v1.16.1 (currently main branch)
+## v1.16.2 (currently main branch)
+
+## v1.16.1
+
+- engine: Added line/triangle strip support.
## v1.16.0
diff --git a/android/filament-android/src/main/java/com/google/android/filament/RenderableManager.java b/android/filament-android/src/main/java/com/google/android/filament/RenderableManager.java
index 437358c5ed..db4fdb8c83 100644
--- a/android/filament-android/src/main/java/com/google/android/filament/RenderableManager.java
+++ b/android/filament-android/src/main/java/com/google/android/filament/RenderableManager.java
@@ -96,7 +96,9 @@ public class RenderableManager {
public enum PrimitiveType {
POINTS(0),
LINES(1),
- TRIANGLES(4);
+ LINE_STRIP(3),
+ TRIANGLES(4),
+ TRIANGLE_STRIP(5);
private final int mType;
PrimitiveType(int value) { mType = value; }
diff --git a/android/filament-android/src/main/java/com/google/android/filament/Renderer.java b/android/filament-android/src/main/java/com/google/android/filament/Renderer.java
index 89cda98c58..79a3f536fb 100644
--- a/android/filament-android/src/main/java/com/google/android/filament/Renderer.java
+++ b/android/filament-android/src/main/java/com/google/android/filament/Renderer.java
@@ -309,7 +309,7 @@ public class Renderer {
*
*
render() generates commands for each of the following stages:
*
- * - Shadow map pass, if needed (currently only a single shadow map is supported)
+ * - Shadow map passes, if needed
* - Depth pre-pass
* - SSAO pass, if enabled
* - Color pass
diff --git a/android/gradle.properties b/android/gradle.properties
index 8dd051c616..e3e89a33ee 100644
--- a/android/gradle.properties
+++ b/android/gradle.properties
@@ -1,5 +1,5 @@
GROUP=com.google.android.filament
-VERSION_NAME=1.16.0
+VERSION_NAME=1.16.1
POM_DESCRIPTION=Real-time physically based rendering engine for Android.
diff --git a/filament/backend/include/backend/DriverEnums.h b/filament/backend/include/backend/DriverEnums.h
index 1b36256dea..b521f3a4e0 100644
--- a/filament/backend/include/backend/DriverEnums.h
+++ b/filament/backend/include/backend/DriverEnums.h
@@ -193,10 +193,12 @@ static constexpr size_t SHADER_MODEL_COUNT = 3;
*/
enum class PrimitiveType : uint8_t {
// don't change the enums values (made to match GL)
- POINTS = 0, //!< points
- LINES = 1, //!< lines
- TRIANGLES = 4, //!< triangles
- NONE = 0xFF
+ POINTS = 0, //!< points
+ LINES = 1, //!< lines
+ LINE_STRIP = 3, //!< line strip
+ TRIANGLES = 4, //!< triangles
+ TRIANGLE_STRIP = 5, //!< triangle strip
+ NONE = 0xFF
};
/**
diff --git a/filament/backend/src/metal/MetalEnums.h b/filament/backend/src/metal/MetalEnums.h
index 7c84ee65bc..3de905a984 100644
--- a/filament/backend/src/metal/MetalEnums.h
+++ b/filament/backend/src/metal/MetalEnums.h
@@ -304,7 +304,9 @@ constexpr inline MTLPrimitiveType getMetalPrimitiveType(PrimitiveType type) noex
switch (type) {
case PrimitiveType::POINTS: return MTLPrimitiveTypePoint;
case PrimitiveType::LINES: return MTLPrimitiveTypeLine;
+ case PrimitiveType::LINE_STRIP: return MTLPrimitiveTypeLineStrip;
case PrimitiveType::TRIANGLES: return MTLPrimitiveTypeTriangle;
+ case PrimitiveType::TRIANGLE_STRIP: return MTLPrimitiveTypeTriangleStrip;
case PrimitiveType::NONE:
ASSERT_POSTCONDITION(false, "NONE is not a valid primitive type.");
}
diff --git a/filament/backend/src/ostream.cpp b/filament/backend/src/ostream.cpp
index d9eed6106f..d909921dbb 100644
--- a/filament/backend/src/ostream.cpp
+++ b/filament/backend/src/ostream.cpp
@@ -51,7 +51,9 @@ io::ostream& operator<<(io::ostream& out, ShaderModel model) {
io::ostream& operator<<(io::ostream& out, PrimitiveType type) {
switch (type) {
CASE(PrimitiveType, TRIANGLES)
+ CASE(PrimitiveType, TRIANGLE_STRIP)
CASE(PrimitiveType, LINES)
+ CASE(PrimitiveType, LINE_STRIP)
CASE(PrimitiveType, POINTS)
CASE(PrimitiveType, NONE)
}
diff --git a/filament/backend/src/vulkan/VulkanHandles.cpp b/filament/backend/src/vulkan/VulkanHandles.cpp
index 5f9bf0f427..1cd45ee92c 100644
--- a/filament/backend/src/vulkan/VulkanHandles.cpp
+++ b/filament/backend/src/vulkan/VulkanHandles.cpp
@@ -283,9 +283,15 @@ void VulkanRenderPrimitive::setPrimitiveType(backend::PrimitiveType pt) {
case backend::PrimitiveType::LINES:
primitiveTopology = VK_PRIMITIVE_TOPOLOGY_LINE_LIST;
break;
+ case backend::PrimitiveType::LINE_STRIP:
+ primitiveTopology = VK_PRIMITIVE_TOPOLOGY_LINE_STRIP;
+ break;
case backend::PrimitiveType::TRIANGLES:
primitiveTopology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
break;
+ case backend::PrimitiveType::TRIANGLE_STRIP:
+ primitiveTopology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP;
+ break;
}
}
diff --git a/filament/include/filament/RenderableManager.h b/filament/include/filament/RenderableManager.h
index 0e602c3e1c..46ef09e429 100644
--- a/filament/include/filament/RenderableManager.h
+++ b/filament/include/filament/RenderableManager.h
@@ -105,8 +105,8 @@ public:
* Clients can specify bones either using this quat-vec3 pair, or by using 4x4 matrices.
*/
struct Bone {
- math::quatf unitQuaternion = { 1, 0, 0, 0 };
- math::float3 translation = { 0, 0, 0 };
+ math::quatf unitQuaternion = { 1.f, 0.f, 0.f, 0.f };
+ math::float3 translation = { 0.f, 0.f, 0.f };
float reserved = 0;
};
diff --git a/filament/include/filament/Renderer.h b/filament/include/filament/Renderer.h
index d5f2250fcc..cbb3aa1989 100644
--- a/filament/include/filament/Renderer.h
+++ b/filament/include/filament/Renderer.h
@@ -252,7 +252,7 @@ public:
*
* render() generates commands for each of the following stages:
*
- * 1. Shadow map pass, if needed (currently only a single shadow map is supported).
+ * 1. Shadow map passes, if needed.
* 2. Depth pre-pass.
* 3. Color pass.
* 4. Post-processing pass.
diff --git a/filament/src/Scene.cpp b/filament/src/Scene.cpp
index e17400af84..d5cca3c3c2 100644
--- a/filament/src/Scene.cpp
+++ b/filament/src/Scene.cpp
@@ -203,7 +203,7 @@ void FScene::updateUBOs(utils::Range visibleRenderables, backend::Hand
const size_t size = visibleRenderables.size() * sizeof(PerRenderableUib);
// allocate space into the command stream directly
- void* const buffer = driver.allocate(size);
+ void* const buffer = driver.allocatePod(visibleRenderables.size());
bool hasContactShadows = false;
auto& sceneData = mRenderableData;
diff --git a/filament/src/SkinningBuffer.cpp b/filament/src/SkinningBuffer.cpp
index 58e757f2c0..5dc879ac5a 100644
--- a/filament/src/SkinningBuffer.cpp
+++ b/filament/src/SkinningBuffer.cpp
@@ -78,10 +78,10 @@ FSkinningBuffer::FSkinningBuffer(FEngine& engine, const Builder& builder)
if (builder->mInitialize) {
// initialize the bones to identity (before rounding up)
- size_t size = mBoneCount * sizeof(PerRenderableUibBone);
- auto* out = (PerRenderableUibBone*)driver.allocate(size);
+ auto* out = driver.allocatePod(mBoneCount);
std::uninitialized_fill_n(out, mBoneCount, PerRenderableUibBone{});
- driver.updateBufferObject(mHandle, { out, size }, 0);
+ driver.updateBufferObject(mHandle, {
+ out, mBoneCount * sizeof(PerRenderableUibBone) }, 0);
}
}
@@ -119,15 +119,15 @@ static uint32_t packHalf2x16(half2 v) noexcept {
void FSkinningBuffer::setBones(FEngine& engine, Handle handle,
RenderableManager::Bone const* transforms, size_t boneCount, size_t offset) noexcept {
auto& driverApi = engine.getDriverApi();
- size_t size = boneCount * sizeof(PerRenderableUibBone);
- PerRenderableUibBone* UTILS_RESTRICT out = (PerRenderableUibBone*)driverApi.allocate(size);
+ PerRenderableUibBone* UTILS_RESTRICT out = driverApi.allocatePod(boneCount);
for (size_t i = 0, c = boneCount; i < c; ++i) {
// the transform is stored in row-major, last row is not stored.
mat4f transform(transforms[i].unitQuaternion);
transform[3] = float4{ transforms[i].translation, 1.0f };
out[i] = makeBone(transform);
}
- driverApi.updateBufferObject(handle, { out, size },
+ driverApi.updateBufferObject(handle, {
+ out, boneCount * sizeof(PerRenderableUibBone) },
offset * sizeof(PerRenderableUibBone));
}
@@ -155,13 +155,13 @@ PerRenderableUibBone FSkinningBuffer::makeBone(mat4f transform) noexcept {
void FSkinningBuffer::setBones(FEngine& engine, Handle handle,
mat4f const* transforms, size_t boneCount, size_t offset) noexcept {
auto& driverApi = engine.getDriverApi();
- size_t size = boneCount * sizeof(PerRenderableUibBone);
- PerRenderableUibBone* UTILS_RESTRICT out = (PerRenderableUibBone*)driverApi.allocate(size);
+ PerRenderableUibBone* UTILS_RESTRICT out = driverApi.allocatePod(boneCount);
for (size_t i = 0, c = boneCount; i < c; ++i) {
// the transform is stored in row-major, last row is not stored.
out[i] = makeBone(transforms[i]);
}
- driverApi.updateBufferObject(handle, { out, size },
+ driverApi.updateBufferObject(handle, {
+ out, boneCount * sizeof(PerRenderableUibBone) },
offset * sizeof(PerRenderableUibBone));
}
diff --git a/filament/src/components/RenderableManager.cpp b/filament/src/components/RenderableManager.cpp
index ddd17662a5..7208771bb6 100644
--- a/filament/src/components/RenderableManager.cpp
+++ b/filament/src/components/RenderableManager.cpp
@@ -364,10 +364,10 @@ void FRenderableManager::create(
builder->mUserBoneMatrices, count, 0);
} else {
// initialize the bones to identity
- size_t size = count * sizeof(PerRenderableUibBone);
- auto* out = (PerRenderableUibBone*)driver.allocate(size);
+ auto* out = driver.allocatePod(count);
std::uninitialized_fill_n(out, count, PerRenderableUibBone{});
- driver.updateBufferObject(bones.handle, { out, size }, 0);
+ driver.updateBufferObject(bones.handle, {
+ out, count * sizeof(PerRenderableUibBone) }, 0);
}
}
}
diff --git a/ios/CocoaPods/Filament.podspec b/ios/CocoaPods/Filament.podspec
index 710d5a22d2..759d3047e7 100644
--- a/ios/CocoaPods/Filament.podspec
+++ b/ios/CocoaPods/Filament.podspec
@@ -1,12 +1,12 @@
Pod::Spec.new do |spec|
spec.name = "Filament"
- spec.version = "1.16.0"
+ spec.version = "1.16.1"
spec.license = { :type => "Apache 2.0", :file => "LICENSE" }
spec.homepage = "https://google.github.io/filament"
spec.authors = "Google LLC."
spec.summary = "Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS, and WASM/WebGL."
spec.platform = :ios, "11.0"
- spec.source = { :http => "https://github.com/google/filament/releases/download/v1.16.0/filament-v1.16.0-ios.tgz" }
+ spec.source = { :http => "https://github.com/google/filament/releases/download/v1.16.1/filament-v1.16.1-ios.tgz" }
# Fix linking error with Xcode 12; we do not yet support the simulator on Apple silicon.
spec.pod_target_xcconfig = {
diff --git a/libs/filamat/src/GLSLPostProcessor.cpp b/libs/filamat/src/GLSLPostProcessor.cpp
index 30d0f967f8..e5a7eed5db 100644
--- a/libs/filamat/src/GLSLPostProcessor.cpp
+++ b/libs/filamat/src/GLSLPostProcessor.cpp
@@ -357,7 +357,7 @@ void GLSLPostProcessor::fullOptimization(const TShader& tShader,
CompilerGLSL glslCompiler(move(spirv));
glslCompiler.set_common_options(glslOptions);
- if (tShader.getStage() == EShLangFragment && !glslOptions.es) {
+ if (!glslOptions.es) {
// enable GL_ARB_shading_language_packing if available
glslCompiler.add_header_line("#extension GL_ARB_shading_language_packing : enable");
}
diff --git a/libs/filamentapp/src/FilamentApp.cpp b/libs/filamentapp/src/FilamentApp.cpp
index 8b344bc242..dfc9631490 100644
--- a/libs/filamentapp/src/FilamentApp.cpp
+++ b/libs/filamentapp/src/FilamentApp.cpp
@@ -44,6 +44,10 @@
#include
#include
+#ifndef NDEBUG
+#include
+#endif
+
#include
#include
@@ -272,6 +276,14 @@ void FilamentApp::run(const Config& config, SetupCallback setupCallback,
if (event.key.keysym.scancode == SDL_SCANCODE_ESCAPE) {
mClosed = true;
}
+#ifndef NDEBUG
+ if (event.key.keysym.scancode == SDL_SCANCODE_PRINTSCREEN) {
+ DebugRegistry& debug = mEngine->getDebugRegistry();
+ bool* captureFrame =
+ debug.getPropertyAddress("d.renderer.doFrameCapture");
+ *captureFrame = true;
+ }
+#endif
window->keyDown(event.key.keysym.scancode);
break;
case SDL_KEYUP:
diff --git a/libs/gltfio/src/GltfEnums.h b/libs/gltfio/src/GltfEnums.h
index ad6a34aace..39e71b7a0c 100644
--- a/libs/gltfio/src/GltfEnums.h
+++ b/libs/gltfio/src/GltfEnums.h
@@ -122,12 +122,16 @@ inline bool getPrimitiveType(cgltf_primitive_type in,
case cgltf_primitive_type_lines:
*out = filament::RenderableManager::PrimitiveType::LINES;
return true;
+ case cgltf_primitive_type_line_strip:
+ *out = filament::RenderableManager::PrimitiveType::LINE_STRIP;
+ return true;
case cgltf_primitive_type_triangles:
*out = filament::RenderableManager::PrimitiveType::TRIANGLES;
return true;
- case cgltf_primitive_type_line_loop:
- case cgltf_primitive_type_line_strip:
case cgltf_primitive_type_triangle_strip:
+ *out = filament::RenderableManager::PrimitiveType::TRIANGLE_STRIP;
+ return true;
+ case cgltf_primitive_type_line_loop:
case cgltf_primitive_type_triangle_fan:
return false;
}
diff --git a/tools/matc/tests/MockConfig.cpp b/tools/matc/tests/MockConfig.cpp
index 08146ccbe5..6fd75b2c42 100644
--- a/tools/matc/tests/MockConfig.cpp
+++ b/tools/matc/tests/MockConfig.cpp
@@ -61,5 +61,5 @@ matc::Config::Input* MockConfig::getInput() const noexcept {
}
std::string MockConfig::toString() const noexcept {
- return nullptr;
+ return {};
}
diff --git a/web/filament-js/filament.d.ts b/web/filament-js/filament.d.ts
index 5ab46b7c2e..9163ca7c7c 100644
--- a/web/filament-js/filament.d.ts
+++ b/web/filament-js/filament.d.ts
@@ -824,7 +824,9 @@ export enum PixelDataType {
export enum RenderableManager$PrimitiveType {
POINTS,
LINES,
+ LINE_STRIP,
TRIANGLES,
+ TRIANGLE_STRIP,
NONE,
}
diff --git a/web/filament-js/jsenums.cpp b/web/filament-js/jsenums.cpp
index 49bb7add4e..ed9d16fe55 100644
--- a/web/filament-js/jsenums.cpp
+++ b/web/filament-js/jsenums.cpp
@@ -116,7 +116,9 @@ enum_("LightManager$Type")
enum_("RenderableManager$PrimitiveType")
.value("POINTS", RenderableManager::PrimitiveType::POINTS)
.value("LINES", RenderableManager::PrimitiveType::LINES)
+ .value("LINE_STRIP", RenderableManager::PrimitiveType::LINE_STRIP)
.value("TRIANGLES", RenderableManager::PrimitiveType::TRIANGLES)
+ .value("TRIANGLE_STRIP", RenderableManager::PrimitiveType::TRIANGLE_STRIP)
.value("NONE", RenderableManager::PrimitiveType::NONE);
enum_("View$QualityLevel")
diff --git a/web/filament-js/package.json b/web/filament-js/package.json
index b2a118e858..bd0ec5807c 100644
--- a/web/filament-js/package.json
+++ b/web/filament-js/package.json
@@ -1,6 +1,6 @@
{
"name": "filament",
- "version": "1.16.0",
+ "version": "1.16.1",
"description": "Real-time physically based rendering engine",
"main": "filament.js",
"module": "filament.js",