Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4142e7a1cf | ||
|
|
a721e648b7 | ||
|
|
358e89ef08 | ||
|
|
78d9c43ef1 | ||
|
|
ce253a9563 | ||
|
|
e023e90e7a | ||
|
|
a5b5b0c3a7 | ||
|
|
18c3c36727 | ||
|
|
4e6f6a4579 | ||
|
|
84487f4d8d | ||
|
|
45f5a07989 | ||
|
|
b7b4d3c295 | ||
|
|
0061883dbf | ||
|
|
47e3be11f0 | ||
|
|
420f4000c2 | ||
|
|
4582ce8769 | ||
|
|
3beb39f30b | ||
|
|
b72d6c058a | ||
|
|
4c7c10fad0 | ||
|
|
0c8f367b29 | ||
|
|
50045edb4f | ||
|
|
f538d1aa43 | ||
|
|
4bd8d2a3b7 | ||
|
|
9fa952d968 | ||
|
|
1edad92d73 | ||
|
|
52282baeff |
@@ -78,7 +78,7 @@ To turn an option on or off:
|
||||
|
||||
```
|
||||
$ cd <cmake-build-directory>
|
||||
$ cmake . -DOPTION=ON # Relace OPTION with the option name, set to ON / OFF
|
||||
$ cmake . -DOPTION=ON # Replace OPTION with the option name, set to ON / OFF
|
||||
```
|
||||
|
||||
Options can also be set with the CMake GUI.
|
||||
@@ -181,7 +181,7 @@ Install the following components:
|
||||
- [Python 3.7](https://www.python.org/ftp/python/3.7.0/python-3.7.0.exe)
|
||||
- [CMake 3.14 or later](https://github.com/Kitware/CMake/releases/download/v3.14.7/cmake-3.14.7-win64-x64.msi)
|
||||
|
||||
The latest Windows SDK can also by installed by opening Visual Studio and selecting _Get Tools and
|
||||
The latest Windows SDK can also be installed by opening Visual Studio and selecting _Get Tools and
|
||||
Features..._ under the _Tools_ menu.
|
||||
|
||||
By default, Windows treats the file system as case insensitive. Please do not enable case
|
||||
|
||||
@@ -7,4 +7,3 @@ for next branch cut* header.
|
||||
appropriate header in [RELEASE_NOTES.md](./RELEASE_NOTES.md).
|
||||
|
||||
## Release notes for next branch cut
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.google.android.filament:filament-android:1.40.0'
|
||||
implementation 'com.google.android.filament:filament-android:1.40.3'
|
||||
}
|
||||
```
|
||||
|
||||
@@ -50,7 +50,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.40.0'
|
||||
pod 'Filament', '~> 1.40.3'
|
||||
```
|
||||
|
||||
### Snapshots
|
||||
|
||||
@@ -9,11 +9,15 @@ Before starting, ensure that each of these branches is up-to-date with origin:
|
||||
- rc/$RELEASE
|
||||
- main
|
||||
|
||||
## 0. Make sure the rc/$RELEASE branch has the correct version.
|
||||
## 0. Check versions.
|
||||
|
||||
It should have the version corresponding to its name, $RELEASE.
|
||||
Make sure the rc/$RELEASE branch has the correct Filament version. It should have the version
|
||||
corresponding to its name, $RELEASE.
|
||||
|
||||
## 1. Bump versions on main to $RELEASE.
|
||||
Make sure `MATERIAL_VERSION` has been bumped to a new version if this is a MAJOR or MINOR release
|
||||
(first two version numbers).
|
||||
|
||||
## 1. Bump Filament versions on main to $RELEASE.
|
||||
|
||||
Checkout main and run the following command to bump Filament's version to $RELEASE:
|
||||
|
||||
|
||||
@@ -7,6 +7,15 @@ A new header is inserted each time a *tag* is created.
|
||||
Instead, if you are authoring a PR for the main branch, add your release note to
|
||||
[NEW_RELEASE_NOTES.md](./NEW_RELEASE_NOTES.md).
|
||||
|
||||
## v1.40.3
|
||||
|
||||
## v1.40.2
|
||||
|
||||
- rendering: dynamic resolution would not work with a translucent render target and quality > low
|
||||
- Java/Kotlin: user callbacks were not invoked on successful texture upload
|
||||
|
||||
## v1.40.1
|
||||
|
||||
## v1.40.0
|
||||
|
||||
- matc: fix VSM high precision option on mobile [⚠️ **Recompile materials**]
|
||||
|
||||
@@ -511,9 +511,7 @@ public:
|
||||
|
||||
private:
|
||||
void* mData = nullptr;
|
||||
jobject mBitmap = nullptr;
|
||||
jobject mHandler = nullptr;
|
||||
jobject mCallback = nullptr;
|
||||
jobject mBitmap{};
|
||||
AndroidBitmapInfo mInfo{};
|
||||
};
|
||||
|
||||
|
||||
@@ -191,7 +191,7 @@ class ModelViewer(
|
||||
asset = assetLoader.createAsset(buffer)
|
||||
asset?.let { asset ->
|
||||
resourceLoader.asyncBeginLoad(asset)
|
||||
animator = asset.getInstance().animator
|
||||
animator = asset.instance.animator
|
||||
asset.releaseSourceData()
|
||||
}
|
||||
}
|
||||
@@ -214,7 +214,7 @@ class ModelViewer(
|
||||
resourceLoader.addResourceData(uri, resourceBuffer)
|
||||
}
|
||||
resourceLoader.asyncBeginLoad(asset)
|
||||
animator = asset.getInstance().animator
|
||||
animator = asset.instance.animator
|
||||
asset.releaseSourceData()
|
||||
}
|
||||
}
|
||||
@@ -311,7 +311,7 @@ class ModelViewer(
|
||||
var count = 0
|
||||
val popRenderables = { count = asset.popRenderables(readyRenderables); count != 0 }
|
||||
while (popRenderables()) {
|
||||
for (i in 0..count - 1) {
|
||||
for (i in 0 until count) {
|
||||
val ri = rcm.getInstance(readyRenderables[i])
|
||||
rcm.setScreenSpaceContactShadows(ri, true)
|
||||
}
|
||||
@@ -371,7 +371,7 @@ class ModelViewer(
|
||||
resourceLoader.addResourceData(uri, buffer)
|
||||
}
|
||||
resourceLoader.asyncBeginLoad(asset)
|
||||
animator = asset.getInstance().animator
|
||||
animator = asset.instance.animator
|
||||
asset.releaseSourceData()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
GROUP=com.google.android.filament
|
||||
VERSION_NAME=1.40.0
|
||||
VERSION_NAME=1.40.3
|
||||
|
||||
POM_DESCRIPTION=Real-time physically based rendering engine for Android.
|
||||
|
||||
|
||||
@@ -231,7 +231,7 @@ class MainActivity : Activity() {
|
||||
animator.repeatCount = ValueAnimator.INFINITE
|
||||
animator.addUpdateListener { a ->
|
||||
val v = (a.animatedValue as Float)
|
||||
camera.lookAt(cos(v) * 4.5, 1.5, sin(v) * 4.5, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0)
|
||||
camera.lookAt(cos(v) * 5.5, 1.5, sin(v) * 5.5, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0)
|
||||
}
|
||||
animator.start()
|
||||
}
|
||||
@@ -253,7 +253,7 @@ class MainActivity : Activity() {
|
||||
|
||||
// Stop the animation and any pending frame
|
||||
choreographer.removeFrameCallback(frameScheduler)
|
||||
animator.cancel();
|
||||
animator.cancel()
|
||||
|
||||
// Always detach the surface before destroying the engine
|
||||
uiHelper.detach()
|
||||
|
||||
@@ -140,9 +140,9 @@ class MainActivity : Activity() {
|
||||
camera = engine.createCamera(engine.entityManager.create())
|
||||
|
||||
// clear the swapchain with transparent pixels
|
||||
val options = renderer.clearOptions
|
||||
options.clear = true
|
||||
renderer.clearOptions = options
|
||||
renderer.clearOptions = renderer.clearOptions.apply {
|
||||
clear = true
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupView() {
|
||||
|
||||
4
build.sh
4
build.sh
@@ -90,8 +90,8 @@ function print_help {
|
||||
echo " Desktop matc target, release build:"
|
||||
echo " \$ ./$self_name release matc"
|
||||
echo ""
|
||||
echo " Build gltf_viewer then immediately run it with no arguments:"
|
||||
echo " \$ ./$self_name release run_gltf_viewer"
|
||||
echo " Build gltf_viewer:"
|
||||
echo " \$ ./$self_name release gltf_viewer"
|
||||
echo ""
|
||||
}
|
||||
|
||||
|
||||
@@ -142,8 +142,9 @@ protected:
|
||||
} egl;
|
||||
} ext;
|
||||
|
||||
private:
|
||||
void initializeGlExtensions() noexcept;
|
||||
|
||||
private:
|
||||
EGLConfig findSwapChainConfig(uint64_t flags) const;
|
||||
};
|
||||
|
||||
|
||||
@@ -85,10 +85,10 @@ VkImageSubresourceRange VulkanAttachment::getSubresourceRange(VkImageAspectFlags
|
||||
VulkanTimestamps::VulkanTimestamps(VkDevice device) : mDevice(device) {
|
||||
// Create a timestamp pool large enough to hold a pair of queries for each timer.
|
||||
VkQueryPoolCreateInfo tqpCreateInfo = {
|
||||
.sType = VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO,
|
||||
.queryType = VK_QUERY_TYPE_TIMESTAMP,
|
||||
.sType = VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO,
|
||||
.queryType = VK_QUERY_TYPE_TIMESTAMP,
|
||||
};
|
||||
std::unique_lock<utils::Mutex> timestamps_lock(mMutex);
|
||||
std::unique_lock<utils::Mutex> lock(mMutex);
|
||||
tqpCreateInfo.queryCount = mUsed.size() * 2;
|
||||
VkResult result = vkCreateQueryPool(mDevice, &tqpCreateInfo, VKALLOC, &mPool);
|
||||
ASSERT_POSTCONDITION(result == VK_SUCCESS, "vkCreateQueryPool error.");
|
||||
@@ -115,23 +115,23 @@ void VulkanTimestamps::clearQuery(uint32_t queryIndex) {
|
||||
|
||||
void VulkanTimestamps::beginQuery(VulkanCommandBuffer const* commands,
|
||||
VulkanTimerQuery* query) {
|
||||
uint32_t const index = query->startingQueryIndex;
|
||||
uint32_t const index = query->getStartingQueryIndex();
|
||||
|
||||
vkCmdResetQueryPool(commands->cmdbuffer, mPool, index, 2);
|
||||
vkCmdWriteTimestamp(commands->cmdbuffer, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, mPool, index);
|
||||
|
||||
// We stash this because getResult might come before the query is actually processed.
|
||||
query->fence = commands->fence;
|
||||
query->setFence(commands->fence);
|
||||
}
|
||||
|
||||
void VulkanTimestamps::endQuery(VulkanCommandBuffer const* commands,
|
||||
VulkanTimerQuery const* query) {
|
||||
uint32_t const index = query->stoppingQueryIndex;
|
||||
uint32_t const index = query->getStoppingQueryIndex();
|
||||
vkCmdWriteTimestamp(commands->cmdbuffer, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, mPool, index);
|
||||
}
|
||||
|
||||
VulkanTimestamps::QueryResult VulkanTimestamps::getResult(VulkanTimerQuery const* query) {
|
||||
uint32_t const index = query->startingQueryIndex;
|
||||
uint32_t const index = query->getStartingQueryIndex();
|
||||
QueryResult result;
|
||||
size_t const dataSize = result.size() * sizeof(uint64_t);
|
||||
VkDeviceSize const stride = sizeof(uint64_t) * 2;
|
||||
|
||||
@@ -297,20 +297,25 @@ void VulkanRenderPrimitive::setBuffers(VulkanVertexBuffer* vertexBuffer,
|
||||
}
|
||||
|
||||
VulkanTimerQuery::VulkanTimerQuery(std::tuple<uint32_t, uint32_t> indices)
|
||||
: startingQueryIndex(std::get<0>(indices)), stoppingQueryIndex(std::get<1>(indices)) {}
|
||||
: mStartingQueryIndex(std::get<0>(indices)), mStoppingQueryIndex(std::get<1>(indices)) {}
|
||||
|
||||
bool VulkanTimerQuery::isCompleted() const noexcept {
|
||||
void VulkanTimerQuery::setFence(std::shared_ptr<VulkanCmdFence> fence) noexcept {
|
||||
std::unique_lock<utils::Mutex> lock(mFenceMutex);
|
||||
mFence = fence;
|
||||
}
|
||||
|
||||
bool VulkanTimerQuery::isCompleted() noexcept {
|
||||
std::unique_lock<utils::Mutex> lock(mFenceMutex);
|
||||
// QueryValue is a synchronous call and might occur before beginTimerQuery has written anything
|
||||
// into the command buffer, which is an error according to the validation layer that ships in
|
||||
// the Android NDK. Even when AVAILABILITY_BIT is set, validation seems to require that the
|
||||
// timestamp has at least been written into a processed command buffer.
|
||||
|
||||
// This fence indicates that the corresponding buffer has been completed.
|
||||
if (!fence) {
|
||||
if (!mFence) {
|
||||
return false;
|
||||
}
|
||||
|
||||
VkResult status = fence->status.load(std::memory_order_relaxed);
|
||||
VkResult status = mFence->status.load(std::memory_order_relaxed);
|
||||
if (status != VK_SUCCESS) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
|
||||
#include "private/backend/SamplerGroup.h"
|
||||
|
||||
#include "utils/Mutex.h"
|
||||
|
||||
namespace filament::backend {
|
||||
|
||||
class VulkanTimestamps;
|
||||
@@ -106,7 +108,7 @@ struct VulkanBufferObject : public HwBufferObject {
|
||||
VulkanStagePool& stagePool, uint32_t byteCount, BufferObjectBinding bindingType,
|
||||
BufferUsage usage);
|
||||
void terminate() {
|
||||
buffer.terminate();
|
||||
buffer.terminate();
|
||||
}
|
||||
VulkanBuffer buffer;
|
||||
const BufferObjectBinding bindingType;
|
||||
@@ -141,14 +143,24 @@ struct VulkanTimerQuery : public HwTimerQuery {
|
||||
explicit VulkanTimerQuery(std::tuple<uint32_t, uint32_t> indices);
|
||||
~VulkanTimerQuery();
|
||||
|
||||
bool isCompleted() const noexcept;
|
||||
void setFence(std::shared_ptr<VulkanCmdFence> fence) noexcept;
|
||||
|
||||
bool isCompleted() noexcept;
|
||||
|
||||
uint32_t getStartingQueryIndex() const {
|
||||
return mStartingQueryIndex;
|
||||
}
|
||||
|
||||
uint32_t getStoppingQueryIndex() const {
|
||||
return mStoppingQueryIndex;
|
||||
}
|
||||
|
||||
private:
|
||||
uint32_t startingQueryIndex;
|
||||
uint32_t stoppingQueryIndex;
|
||||
uint32_t mStartingQueryIndex;
|
||||
uint32_t mStoppingQueryIndex;
|
||||
|
||||
std::shared_ptr<VulkanCmdFence> fence;
|
||||
friend class VulkanTimestamps;
|
||||
std::shared_ptr<VulkanCmdFence> mFence;
|
||||
utils::Mutex mFenceMutex;
|
||||
};
|
||||
|
||||
inline constexpr VkBufferUsageFlagBits getBufferObjectUsage(
|
||||
|
||||
@@ -107,7 +107,7 @@ void VulkanSwapChain::acquire(bool& resized) {
|
||||
}
|
||||
|
||||
// Check if the swapchain should be resized.
|
||||
if (!mHeadless && (resized = mPlatform->hasResized(swapChain))) {
|
||||
if ((resized = mPlatform->hasResized(swapChain))) {
|
||||
mCommands->flush();
|
||||
mCommands->wait();
|
||||
mPlatform->recreate(swapChain);
|
||||
|
||||
@@ -1050,7 +1050,7 @@ void FRenderer::renderJob(ArenaScope& arena, FView& view) {
|
||||
if (scaled) {
|
||||
mightNeedFinalBlit = false;
|
||||
auto viewport = DEBUG_DYNAMIC_SCALING ? xvp : vp;
|
||||
input = ppm.upscale(fg, blendModeTranslucent, dsrOptions, input, xvp, {
|
||||
input = ppm.upscale(fg, needsAlphaChannel, dsrOptions, input, xvp, {
|
||||
.width = viewport.width, .height = viewport.height,
|
||||
.format = colorGradingConfig.ldrFormat });
|
||||
xvp.left = xvp.bottom = 0;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
Pod::Spec.new do |spec|
|
||||
spec.name = "Filament"
|
||||
spec.version = "1.40.0"
|
||||
spec.version = "1.40.3"
|
||||
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.40.0/filament-v1.40.0-ios.tgz" }
|
||||
spec.source = { :http => "https://github.com/google/filament/releases/download/v1.40.3/filament-v1.40.3-ios.tgz" }
|
||||
|
||||
# Fix linking error with Xcode 12; we do not yet support the simulator on Apple silicon.
|
||||
spec.pod_target_xcconfig = {
|
||||
|
||||
@@ -120,6 +120,11 @@ Material* ArchiveCache::getMaterial(const ArchiveRequirements& reqs) {
|
||||
.build(mEngine);
|
||||
}
|
||||
|
||||
// Don't attempt to precompile shaders on WebGL.
|
||||
// Chrome already suffers from slow shader compilation:
|
||||
// https://github.com/google/filament/issues/6615
|
||||
// Precompiling shaders exacerbates the problem.
|
||||
#if !defined(__EMSCRIPTEN__)
|
||||
// compile everything at low priority
|
||||
mMaterials[i]->compile(Material::CompilerPriorityQueue::LOW);
|
||||
|
||||
@@ -128,6 +133,7 @@ Material* ArchiveCache::getMaterial(const ArchiveRequirements& reqs) {
|
||||
UserVariantFilterBit::DIRECTIONAL_LIGHTING |
|
||||
UserVariantFilterBit::DYNAMIC_LIGHTING |
|
||||
UserVariantFilterBit::SHADOW_RECEIVER);
|
||||
#endif
|
||||
|
||||
return mMaterials[i];
|
||||
}
|
||||
|
||||
@@ -27,6 +27,10 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(__EMSCRIPTEN__)
|
||||
#include <emscripten/console.h>
|
||||
#endif
|
||||
|
||||
namespace utils {
|
||||
namespace io {
|
||||
|
||||
@@ -66,7 +70,23 @@ ostream& LogStream::flush() noexcept {
|
||||
__android_log_write(ANDROID_LOG_VERBOSE, UTILS_LOG_TAG, buf.get());
|
||||
break;
|
||||
}
|
||||
#else // ANDROID
|
||||
#elif defined(__EMSCRIPTEN__)
|
||||
switch (mPriority) {
|
||||
case LOG_DEBUG:
|
||||
case LOG_WARNING:
|
||||
case LOG_INFO:
|
||||
_emscripten_out(buf.get());
|
||||
break;
|
||||
case LOG_ERROR:
|
||||
_emscripten_err(buf.get());
|
||||
break;
|
||||
case LOG_VERBOSE:
|
||||
#ifndef NFIL_DEBUG
|
||||
_emscripten_out(buf.get());
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
#else // not ANDROID or EMSCRIPTEN
|
||||
switch (mPriority) {
|
||||
case LOG_DEBUG:
|
||||
case LOG_WARNING:
|
||||
@@ -82,7 +102,7 @@ ostream& LogStream::flush() noexcept {
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
#endif // __ANDROID__
|
||||
#endif // __ANDROID__ or __EMSCRIPTEN__
|
||||
buf.reset();
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -50,8 +50,13 @@ Path::Path(const std::string& path)
|
||||
}
|
||||
|
||||
bool Path::exists() const {
|
||||
#if defined(_WIN64) || defined(_M_X64)
|
||||
struct _stat64 file;
|
||||
return _stat64(c_str(), &file) == 0;
|
||||
#else
|
||||
struct stat file;
|
||||
return stat(c_str(), &file) == 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool Path::isFile() const {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "filament",
|
||||
"version": "1.40.0",
|
||||
"version": "1.40.3",
|
||||
"description": "Real-time physically based rendering engine",
|
||||
"main": "filament.js",
|
||||
"module": "filament.js",
|
||||
|
||||
Reference in New Issue
Block a user