Compare commits

...

2 Commits

Author SHA1 Message Date
Benjamin Doherty
b236bd4f50 Fix cancelled vertices on iOS OpenGL ES simulator 2022-11-15 20:24:21 -08:00
Benjamin Doherty
b7b7afb62a Bump version to 1.29.0 2022-11-09 16:43:08 -08:00
9 changed files with 33 additions and 13 deletions

View File

@@ -31,7 +31,7 @@ repositories {
}
dependencies {
implementation 'com.google.android.filament:filament-android:1.28.3'
implementation 'com.google.android.filament:filament-android:1.29.0'
}
```
@@ -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:
```
pod 'Filament', '~> 1.28.3'
pod 'Filament', '~> 1.29.0'
```
### Snapshots

View File

@@ -1,5 +1,5 @@
GROUP=com.google.android.filament
VERSION_NAME=1.28.3
VERSION_NAME=1.29.0
POM_DESCRIPTION=Real-time physically based rendering engine for Android.

View File

@@ -442,9 +442,15 @@ Program FMaterial::getProgramBuilderWithVariants(
}
}
int platformId = 0;
#if defined(IOS)
platformId = 1;
#endif
program.specializationConstants({
{ 0, (int)mEngine.getSupportedFeatureLevel() },
{ 1, (int)CONFIG_MAX_INSTANCES }
{ 1, (int)CONFIG_MAX_INSTANCES },
{ 2, platformId }
});
return program;

View File

@@ -1,12 +1,12 @@
Pod::Spec.new do |spec|
spec.name = "Filament"
spec.version = "1.28.3"
spec.version = "1.29.0"
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.28.3/filament-v1.28.3-ios.tgz" }
spec.source = { :http => "https://github.com/google/filament/releases/download/v1.29.0/filament-v1.29.0-ios.tgz" }
# Fix linking error with Xcode 12; we do not yet support the simulator on Apple silicon.
spec.pod_target_xcconfig = {

View File

@@ -123,6 +123,7 @@ utils::io::sstream& CodeGenerator::generateProlog(utils::io::sstream& out, Shade
out << '\n';
generateSpecificationConstant(out, "BACKEND_FEATURE_LEVEL", 0, 1);
generateSpecificationConstant(out, "CONFIG_MAX_INSTANCES", 1, (int)CONFIG_MAX_INSTANCES);
generateSpecificationConstant(out, "TARGET_PLATFORM", 2, 0);
out << '\n';
out << SHADERS_COMMON_DEFINES_GLSL_DATA;

View File

@@ -22,3 +22,11 @@
#define float3x3 mat3
#define float4x4 mat4
#define TARGET_PLATFORM_UNKNOWN 0
#define TARGET_PLATFORM_IOS 1
#if defined(TARGET_GLES_ENVIRONMENT)
const bool openGlesIos = TARGET_PLATFORM == TARGET_PLATFORM_IOS;
#else
const bool openGlesIos = false;
#endif

View File

@@ -128,7 +128,7 @@ highp vec4 getCascadeLightSpacePosition(uint cascade) {
// For the first cascade, return the interpolated light space position.
// This branch will be coherent (mostly) for neighboring fragments, and it's worth avoiding
// the matrix multiply inside computeLightSpacePosition.
if (cascade == 0u) {
if (cascade == 0u && !openGlesIos) {
// Note: this branch may cause issues with derivatives
return vertex_lightSpacePosition;
}

View File

@@ -141,11 +141,16 @@ void main() {
#endif
#if defined(VARIANT_HAS_SHADOWING) && defined(VARIANT_HAS_DIRECTIONAL_LIGHTING)
vertex_lightSpacePosition = computeLightSpacePosition(
vertex_worldPosition.xyz, vertex_worldNormal,
frameUniforms.lightDirection,
shadowUniforms.shadows[0].normalBias,
shadowUniforms.shadows[0].lightFromWorldMatrix);
if (openGlesIos) {
// Hack for OpenGL ES on iOS.
vertex_lightSpacePosition = vec4(1.0);
} else {
vertex_lightSpacePosition = computeLightSpacePosition(
vertex_worldPosition.xyz, vertex_worldNormal,
frameUniforms.lightDirection,
shadowUniforms.shadows[0].normalBias,
shadowUniforms.shadows[0].lightFromWorldMatrix);
}
#endif
#endif // !defined(USE_OPTIMIZED_DEPTH_VERTEX_SHADER)

View File

@@ -1,6 +1,6 @@
{
"name": "filament",
"version": "1.28.3",
"version": "1.29.0",
"description": "Real-time physically based rendering engine",
"main": "filament.js",
"module": "filament.js",