Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
04df79e58f | ||
|
|
a4b3717762 | ||
|
|
1035e442ee | ||
|
|
a1a3adf8af | ||
|
|
620a693c11 | ||
|
|
4511af6f9e | ||
|
|
214e54f2ad | ||
|
|
2eefbe11ae | ||
|
|
74ea3d50c2 | ||
|
|
9a8159ab04 | ||
|
|
2f3aac29da | ||
|
|
9d7f5f593e | ||
|
|
2596273a94 | ||
|
|
210a8c2260 |
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -309,7 +309,7 @@ public class Renderer {
|
||||
*
|
||||
* <p><code>render()</code> generates commands for each of the following stages:</p>
|
||||
* <ul>
|
||||
* <li>Shadow map pass, if needed (currently only a single shadow map is supported)</li>
|
||||
* <li>Shadow map passes, if needed</li>
|
||||
* <li>Depth pre-pass</li>
|
||||
* <li>SSAO pass, if enabled</li>
|
||||
* <li>Color pass</li>
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -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.");
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -203,7 +203,7 @@ void FScene::updateUBOs(utils::Range<uint32_t> 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<PerRenderableUib>(visibleRenderables.size());
|
||||
|
||||
bool hasContactShadows = false;
|
||||
auto& sceneData = mRenderableData;
|
||||
|
||||
@@ -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<PerRenderableUibBone>(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<backend::HwBufferObject> 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<PerRenderableUibBone>(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<backend::HwBufferObject> 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<PerRenderableUibBone>(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));
|
||||
}
|
||||
|
||||
|
||||
@@ -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<PerRenderableUibBone>(count);
|
||||
std::uninitialized_fill_n(out, count, PerRenderableUibBone{});
|
||||
driver.updateBufferObject(bones.handle, { out, size }, 0);
|
||||
driver.updateBufferObject(bones.handle, {
|
||||
out, count * sizeof(PerRenderableUibBone) }, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
@@ -44,6 +44,10 @@
|
||||
#include <filament/Skybox.h>
|
||||
#include <filament/View.h>
|
||||
|
||||
#ifndef NDEBUG
|
||||
#include <filament/DebugRegistry.h>
|
||||
#endif
|
||||
|
||||
#include <filagui/ImGuiHelper.h>
|
||||
|
||||
#include <filamentapp/Cube.h>
|
||||
@@ -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<bool>("d.renderer.doFrameCapture");
|
||||
*captureFrame = true;
|
||||
}
|
||||
#endif
|
||||
window->keyDown(event.key.keysym.scancode);
|
||||
break;
|
||||
case SDL_KEYUP:
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -61,5 +61,5 @@ matc::Config::Input* MockConfig::getInput() const noexcept {
|
||||
}
|
||||
|
||||
std::string MockConfig::toString() const noexcept {
|
||||
return nullptr;
|
||||
return {};
|
||||
}
|
||||
|
||||
2
web/filament-js/filament.d.ts
vendored
2
web/filament-js/filament.d.ts
vendored
@@ -824,7 +824,9 @@ export enum PixelDataType {
|
||||
export enum RenderableManager$PrimitiveType {
|
||||
POINTS,
|
||||
LINES,
|
||||
LINE_STRIP,
|
||||
TRIANGLES,
|
||||
TRIANGLE_STRIP,
|
||||
NONE,
|
||||
}
|
||||
|
||||
|
||||
@@ -116,7 +116,9 @@ enum_<LightManager::Type>("LightManager$Type")
|
||||
enum_<RenderableManager::PrimitiveType>("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>("View$QualityLevel")
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user