Merge branch 'rc/1.54.5' into release
This commit is contained in:
@@ -17,7 +17,7 @@ jobs:
|
||||
- name: Run build script
|
||||
run: |
|
||||
cd build/ios && printf "y" | ./build.sh continuous
|
||||
- uses: actions/upload-artifact@v1.0.0
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: filament-ios
|
||||
path: out/filament-release-ios.tgz
|
||||
|
||||
@@ -17,7 +17,7 @@ jobs:
|
||||
- name: Run build script
|
||||
run: |
|
||||
cd build/linux && printf "y" | ./build.sh continuous
|
||||
- uses: actions/upload-artifact@v1.0.0
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: filament-linux
|
||||
path: out/filament-release-linux.tgz
|
||||
|
||||
@@ -17,7 +17,7 @@ jobs:
|
||||
- name: Run build script
|
||||
run: |
|
||||
cd build/mac && printf "y" | ./build.sh continuous
|
||||
- uses: actions/upload-artifact@v1.0.0
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: filament-mac
|
||||
path: out/filament-release-darwin.tgz
|
||||
|
||||
@@ -15,7 +15,7 @@ jobs:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
os: [macos-14, ubuntu-22.04]
|
||||
os: [macos-14-xlarge, ubuntu-22.04-16core]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4.1.6
|
||||
@@ -29,7 +29,7 @@ jobs:
|
||||
|
||||
build-windows:
|
||||
name: build-windows
|
||||
runs-on: windows-2019
|
||||
runs-on: windows-2019-32core
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4.1.6
|
||||
@@ -40,7 +40,7 @@ jobs:
|
||||
|
||||
build-android:
|
||||
name: build-android
|
||||
runs-on: macos-14
|
||||
runs-on: ubuntu-22.04-16core
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4.1.6
|
||||
@@ -56,7 +56,7 @@ jobs:
|
||||
|
||||
build-ios:
|
||||
name: build-iOS
|
||||
runs-on: macos-14
|
||||
runs-on: macos-14-xlarge
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4.1.6
|
||||
@@ -69,7 +69,7 @@ jobs:
|
||||
|
||||
build-web:
|
||||
name: build-web
|
||||
runs-on: macos-14
|
||||
runs-on: ubuntu-22.04-16core
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4.1.6
|
||||
|
||||
@@ -17,7 +17,7 @@ jobs:
|
||||
- name: Run build script
|
||||
run: |
|
||||
cd build/web && printf "y" | ./build.sh continuous
|
||||
- uses: actions/upload-artifact@v1.0.0
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: filament-web
|
||||
path: out/filament-release-web.tgz
|
||||
|
||||
@@ -10,7 +10,7 @@ on:
|
||||
jobs:
|
||||
build-windows:
|
||||
name: build-windows
|
||||
runs-on: windows-2019
|
||||
runs-on: windows-2019-32core
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4.1.6
|
||||
@@ -18,7 +18,7 @@ jobs:
|
||||
run: |
|
||||
build\windows\build-github.bat continuous
|
||||
shell: cmd
|
||||
- uses: actions/upload-artifact@v1.0.0
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: filament-windows
|
||||
path: out/filament-windows.tgz
|
||||
|
||||
@@ -31,7 +31,7 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.google.android.filament:filament-android:1.54.4'
|
||||
implementation 'com.google.android.filament:filament-android:1.54.5'
|
||||
}
|
||||
```
|
||||
|
||||
@@ -51,7 +51,7 @@ Here are all the libraries available in the group `com.google.android.filament`:
|
||||
iOS projects can use CocoaPods to install the latest release:
|
||||
|
||||
```shell
|
||||
pod 'Filament', '~> 1.54.4'
|
||||
pod 'Filament', '~> 1.54.5'
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
@@ -7,6 +7,9 @@ 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.54.5
|
||||
|
||||
|
||||
## v1.54.4
|
||||
|
||||
- Add support for multi-layered render target with array textures.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
GROUP=com.google.android.filament
|
||||
VERSION_NAME=1.54.4
|
||||
VERSION_NAME=1.54.5
|
||||
|
||||
POM_DESCRIPTION=Real-time physically based rendering engine for Android.
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#!/bin/bash
|
||||
if [ `uname` == "Linux" ];then
|
||||
curl -OL https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-linux.zip
|
||||
unzip -q ninja-linux.zip
|
||||
source `dirname $0`/../linux/ci-common.sh
|
||||
elif [ `uname` == "Darwin" ];then
|
||||
curl -OL https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-mac.zip
|
||||
unzip -q ninja-mac.zip
|
||||
@@ -13,9 +12,6 @@ fi
|
||||
chmod +x ninja
|
||||
export PATH="$PWD:$PATH"
|
||||
|
||||
# FIXME: kokoro machines have node and npm but currently they are symlinked to non-existent files
|
||||
# npm install -g typescript
|
||||
|
||||
# Install emscripten.
|
||||
curl -L https://github.com/emscripten-core/emsdk/archive/refs/tags/3.1.15.zip > emsdk.zip
|
||||
unzip emsdk.zip ; mv emsdk-* emsdk ; cd emsdk
|
||||
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -1148,6 +1148,7 @@ void OpenGLDriver::framebufferTexture(TargetBufferInfo const& binfo,
|
||||
if (any(t->usage & TextureUsage::SAMPLEABLE)) {
|
||||
switch (t->target) {
|
||||
case SamplerType::SAMPLER_2D:
|
||||
case SamplerType::SAMPLER_3D:
|
||||
case SamplerType::SAMPLER_2D_ARRAY:
|
||||
case SamplerType::SAMPLER_CUBEMAP_ARRAY:
|
||||
// this could be GL_TEXTURE_2D_MULTISAMPLE or GL_TEXTURE_2D_ARRAY
|
||||
@@ -1158,7 +1159,9 @@ void OpenGLDriver::framebufferTexture(TargetBufferInfo const& binfo,
|
||||
target = getCubemapTarget(binfo.layer);
|
||||
// note: cubemaps can't be multi-sampled
|
||||
break;
|
||||
default:
|
||||
case SamplerType::SAMPLER_EXTERNAL:
|
||||
// This is an error. We have asserted in debug build.
|
||||
target = t->gl.target;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1176,7 +1179,7 @@ void OpenGLDriver::framebufferTexture(TargetBufferInfo const& binfo,
|
||||
|
||||
if (rt->gl.samples <= 1 ||
|
||||
(rt->gl.samples > 1 && t->samples > 1 && gl.features.multisample_texture)) {
|
||||
// on GL3.2 / GLES3.1 and above multisample is handled when creating the texture.
|
||||
// On GL3.2 / GLES3.1 and above multisample is handled when creating the texture.
|
||||
// If multisampled textures are not supported and we end-up here, things should
|
||||
// still work, albeit without MSAA.
|
||||
gl.bindFramebuffer(GL_FRAMEBUFFER, rt->gl.fbo);
|
||||
@@ -1200,6 +1203,7 @@ void OpenGLDriver::framebufferTexture(TargetBufferInfo const& binfo,
|
||||
GL_RENDERBUFFER, t->gl.id);
|
||||
}
|
||||
break;
|
||||
case GL_TEXTURE_3D:
|
||||
case GL_TEXTURE_2D_ARRAY:
|
||||
case GL_TEXTURE_CUBE_MAP_ARRAY:
|
||||
#ifndef FILAMENT_SILENCE_NOT_SUPPORTED_BY_ES2
|
||||
@@ -1313,6 +1317,7 @@ void OpenGLDriver::framebufferTexture(TargetBufferInfo const& binfo,
|
||||
GL_RENDERBUFFER, t->gl.id);
|
||||
}
|
||||
break;
|
||||
case GL_TEXTURE_3D:
|
||||
case GL_TEXTURE_2D_ARRAY:
|
||||
case GL_TEXTURE_CUBE_MAP_ARRAY:
|
||||
#ifndef FILAMENT_SILENCE_NOT_SUPPORTED_BY_ES2
|
||||
@@ -2379,9 +2384,7 @@ void OpenGLDriver::updateSamplerGroup(Handle<HwSamplerGroup> sbh,
|
||||
GLSamplerGroup* const sb = handle_cast<GLSamplerGroup *>(sbh);
|
||||
assert_invariant(sb->textureUnitEntries.size() == data.size / sizeof(SamplerDescriptor));
|
||||
|
||||
#ifndef FILAMENT_SILENCE_NOT_SUPPORTED_BY_ES2
|
||||
bool const es2 = context.isES2();
|
||||
#endif
|
||||
|
||||
auto const* const pSamplers = (SamplerDescriptor const*)data.buffer;
|
||||
for (size_t i = 0, c = sb->textureUnitEntries.size(); i < c; i++) {
|
||||
|
||||
@@ -21,9 +21,19 @@
|
||||
|
||||
#include "FilamentAPI-impl.h"
|
||||
|
||||
#include <utils/Panic.h>
|
||||
#include <filament/RenderTarget.h>
|
||||
|
||||
#include <utils/compiler.h>
|
||||
#include <utils/BitmaskEnum.h>
|
||||
#include <utils/Panic.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
#include <limits>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
namespace filament {
|
||||
|
||||
@@ -73,11 +83,15 @@ RenderTarget* RenderTarget::Builder::build(Engine& engine) {
|
||||
if (color.texture) {
|
||||
FILAMENT_CHECK_PRECONDITION(color.texture->getUsage() & TextureUsage::COLOR_ATTACHMENT)
|
||||
<< "Texture usage must contain COLOR_ATTACHMENT";
|
||||
FILAMENT_CHECK_PRECONDITION(color.texture->getTarget() != Texture::Sampler::SAMPLER_EXTERNAL)
|
||||
<< "Color attachment can't be an external texture";
|
||||
}
|
||||
|
||||
if (depth.texture) {
|
||||
FILAMENT_CHECK_PRECONDITION(depth.texture->getUsage() & TextureUsage::DEPTH_ATTACHMENT)
|
||||
<< "Texture usage must contain DEPTH_ATTACHMENT";
|
||||
FILAMENT_CHECK_PRECONDITION(depth.texture->getTarget() != Texture::Sampler::SAMPLER_EXTERNAL)
|
||||
<< "Depth attachment can't be an external texture";
|
||||
}
|
||||
|
||||
const size_t maxDrawBuffers = downcast(engine).getDriverApi().getMaxDrawBuffers();
|
||||
|
||||
@@ -536,6 +536,12 @@ void FRenderer::renderStandaloneView(FView const* view) {
|
||||
renderInternal(view);
|
||||
|
||||
driver.endFrame(mFrameId);
|
||||
|
||||
// This is a workaround for internal bug b/361822355.
|
||||
// TODO: properly address the bug and remove this workaround.
|
||||
if (engine.getBackend() == backend::Backend::VULKAN) {
|
||||
engine.flushAndWait();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
Pod::Spec.new do |spec|
|
||||
spec.name = "Filament"
|
||||
spec.version = "1.54.4"
|
||||
spec.version = "1.54.5"
|
||||
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.54.4/filament-v1.54.4-ios.tgz" }
|
||||
spec.source = { :http => "https://github.com/google/filament/releases/download/v1.54.5/filament-v1.54.5-ios.tgz" }
|
||||
|
||||
# Fix linking error with Xcode 12; we do not yet support the simulator on Apple silicon.
|
||||
spec.pod_target_xcconfig = {
|
||||
|
||||
@@ -47,6 +47,7 @@ set(LIBS
|
||||
geometry
|
||||
getopt
|
||||
image
|
||||
imageio
|
||||
imgui
|
||||
ktxreader
|
||||
math
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <math/vec3.h>
|
||||
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
|
||||
namespace filament {
|
||||
class Engine;
|
||||
|
||||
@@ -552,6 +552,9 @@ void FilamentApp::loadIBL(std::string_view path) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Note that IBL holds a skybox, and Scene also holds a reference. We cannot release IBL's
|
||||
// skybox until after new skybox has been set in the scene.
|
||||
std::unique_ptr<IBL> oldIBL = std::move(mIBL);
|
||||
mIBL = std::make_unique<IBL>(*mEngine);
|
||||
|
||||
if (!iblPath.isDirectory()) {
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
|
||||
#include <ktxreader/Ktx1Reader.h>
|
||||
|
||||
#include <imageio/ImageDecoder.h>
|
||||
|
||||
#include <filament-iblprefilter/IBLPrefilterContext.h>
|
||||
|
||||
#include <stb_image.h>
|
||||
@@ -37,6 +39,8 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <utils/Log.h>
|
||||
|
||||
using namespace filament;
|
||||
using namespace filament::math;
|
||||
using namespace ktxreader;
|
||||
@@ -60,26 +64,51 @@ bool IBL::loadFromEquirect(Path const& path) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int w, h;
|
||||
stbi_info(path.getAbsolutePath().c_str(), &w, &h, nullptr);
|
||||
if (w != h * 2) {
|
||||
std::cerr << "not an equirectangular image!" << std::endl;
|
||||
int w = 0, h = 0;
|
||||
int n = 0;
|
||||
size_t size = 0;
|
||||
void* data = nullptr;
|
||||
void* user = nullptr;
|
||||
Texture::PixelBufferDescriptor::Callback destroyer{};
|
||||
|
||||
if (path.getExtension() == "exr") {
|
||||
std::ifstream in_stream(path.getAbsolutePath().c_str(), std::ios::binary);
|
||||
image::LinearImage* image = new image::LinearImage(
|
||||
image::ImageDecoder::decode(in_stream, path.getAbsolutePath().c_str()));
|
||||
w = image->getWidth();
|
||||
h = image->getHeight();
|
||||
n = image->getChannels();
|
||||
size = w * h * n * sizeof(float);
|
||||
data = image->getPixelRef();
|
||||
user = image;
|
||||
destroyer = [](void*, size_t, void* user) {
|
||||
delete reinterpret_cast<image::LinearImage*>(user);
|
||||
};
|
||||
} else {
|
||||
stbi_info(path.getAbsolutePath().c_str(), &w, &h, nullptr);
|
||||
// load image as float
|
||||
size = w * h * sizeof(float3);
|
||||
data = (float3*)stbi_loadf(path.getAbsolutePath().c_str(), &w, &h, &n, 3);
|
||||
destroyer = [](void* data, size_t, void*) {
|
||||
stbi_image_free(data);
|
||||
};
|
||||
}
|
||||
|
||||
if (data == nullptr || n != 3) {
|
||||
std::cerr << "Could not decode image " << std::endl;
|
||||
destroyer(data, size, user);
|
||||
return false;
|
||||
}
|
||||
|
||||
// load image as float
|
||||
int n;
|
||||
const size_t size = w * h * sizeof(float3);
|
||||
float3* const data = (float3*)stbi_loadf(path.getAbsolutePath().c_str(), &w, &h, &n, 3);
|
||||
if (data == nullptr || n != 3) {
|
||||
std::cerr << "Could not decode image " << std::endl;
|
||||
if (w != h * 2) {
|
||||
std::cerr << "not an equirectangular image!" << std::endl;
|
||||
destroyer(data, size, user);
|
||||
return false;
|
||||
}
|
||||
|
||||
// now load texture
|
||||
Texture::PixelBufferDescriptor buffer(
|
||||
data, size,Texture::Format::RGB, Texture::Type::FLOAT,
|
||||
[](void* buffer, size_t size, void* user) { stbi_image_free(buffer); });
|
||||
data, size,Texture::Format::RGB, Texture::Type::FLOAT, destroyer, user);
|
||||
|
||||
Texture* const equirect = Texture::Builder()
|
||||
.width((uint32_t)w)
|
||||
@@ -102,7 +131,7 @@ bool IBL::loadFromEquirect(Path const& path) {
|
||||
|
||||
mTexture = specularFilter(mSkyboxTexture);
|
||||
|
||||
mFogTexture = irradianceFilter({ .generateMipmap=false }, mSkyboxTexture);
|
||||
mFogTexture = irradianceFilter({ .generateMipmap = false }, mSkyboxTexture);
|
||||
mFogTexture->generateMipmaps(mEngine);
|
||||
|
||||
mIndirectLight = IndirectLight::Builder()
|
||||
|
||||
+14
-9
@@ -515,7 +515,9 @@ static void onClick(App& app, View* view, ImVec2 pos) {
|
||||
|
||||
static utils::Path getPathForIBLAsset(std::string_view string) {
|
||||
auto isIBL = [] (utils::Path file) -> bool {
|
||||
return file.getExtension() == "ktx" || file.getExtension() == "hdr";
|
||||
return file.getExtension() == "ktx" || file.getExtension() == "hdr" ||
|
||||
file.getExtension() == "exr";
|
||||
|
||||
};
|
||||
|
||||
utils::Path filename{ string };
|
||||
@@ -671,7 +673,15 @@ int main(int argc, char** argv) {
|
||||
buffer.shrink_to_fit();
|
||||
};
|
||||
|
||||
auto loadResources = [&app] (const utils::Path& filename) {
|
||||
auto setupIBL = [&app]() {
|
||||
auto ibl = FilamentApp::get().getIBL();
|
||||
if (ibl) {
|
||||
app.viewer->setIndirectLight(ibl->getIndirectLight(), ibl->getSphericalHarmonics());
|
||||
app.viewer->getSettings().view.fogSettings.fogColorTexture = ibl->getFogTexture();
|
||||
}
|
||||
};
|
||||
|
||||
auto loadResources = [&app, &setupIBL] (const utils::Path& filename) {
|
||||
// Load external textures and buffers.
|
||||
std::string const gltfPath = filename.getAbsolutePath();
|
||||
ResourceConfiguration configuration = {};
|
||||
@@ -708,12 +718,7 @@ int main(int argc, char** argv) {
|
||||
instances[mi]->setStencilWrite(true);
|
||||
instances[mi]->setStencilOpDepthStencilPass(MaterialInstance::StencilOperation::INCR);
|
||||
}
|
||||
|
||||
auto ibl = FilamentApp::get().getIBL();
|
||||
if (ibl) {
|
||||
app.viewer->setIndirectLight(ibl->getIndirectLight(), ibl->getSphericalHarmonics());
|
||||
app.viewer->getSettings().view.fogSettings.fogColorTexture = ibl->getFogTexture();
|
||||
}
|
||||
setupIBL();
|
||||
};
|
||||
|
||||
auto setup = [&](Engine* engine, View* view, Scene* scene) {
|
||||
@@ -1190,7 +1195,7 @@ int main(int argc, char** argv) {
|
||||
filename = getPathForIBLAsset(path);
|
||||
if (!filename.isEmpty()) {
|
||||
FilamentApp::get().loadIBL(path);
|
||||
return;
|
||||
setupIBL();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "filament",
|
||||
"version": "1.54.4",
|
||||
"version": "1.54.5",
|
||||
"description": "Real-time physically based rendering engine",
|
||||
"main": "filament.js",
|
||||
"module": "filament.js",
|
||||
|
||||
Reference in New Issue
Block a user