Skip to content

Commit

Permalink
Merge branch 'rc/1.9.25' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
bejado committed May 17, 2021
2 parents 46e52c7 + 74fe102 commit 77891ac
Show file tree
Hide file tree
Showing 173 changed files with 7,884 additions and 3,733 deletions.
8 changes: 4 additions & 4 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

To build Filament, you must first install the following tools:

- CMake 3.10 (or more recent)
- CMake 3.19 (or more recent)
- clang 7.0 (or more recent)
- [ninja 1.8](https://github.com/ninja-build/ninja/wiki/Pre-built-Ninja-packages) (or more recent)
- [ninja 1.10](https://github.com/ninja-build/ninja/wiki/Pre-built-Ninja-packages) (or more recent)

To build the Java based components of the project you can optionally install (recommended):

Expand All @@ -17,9 +17,9 @@ section below.

To build Filament for Android you must also install the following:

- Android Studio 4.1.0 or more recent
- Android Studio 4.2.0 or more recent
- Android SDK
- Android NDK "side-by-side" 22.0 or higher
- Android NDK "side-by-side" 22.1 or higher

### Environment variables

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ==================================================================================================
# CMake
# ==================================================================================================
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.19)

# ==================================================================================================
# Project declaration
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ repositories {
}
dependencies {
implementation 'com.google.android.filament:filament-android:1.9.24'
implementation 'com.google.android.filament:filament-android:1.9.25'
}
```

Expand Down Expand Up @@ -63,7 +63,7 @@ A much smaller alternative to `filamat-android` that can only generate OpenGL sh
iOS projects can use CocoaPods to install the latest release:

```
pod 'Filament', '~> 1.9.24'
pod 'Filament', '~> 1.9.25'
```

### Snapshots
Expand Down
11 changes: 10 additions & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,16 @@
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.

## Next release (main branch)
## v1.9.26 (currently main branch)

## v1.9.25

- NEW API: Screen-space lens flare effect.
- engine: Fix several memory leaks in the GL backend.
- Vulkan: General bug fixes and improvements.
- Vulkan: Fix some problems seen on Mali devices.
- ios: Fix VSM shadows not working.
- webgl: Fix black screen seen with some samples.

## v1.9.24

Expand Down
9 changes: 4 additions & 5 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ buildscript {
'minSdk': 19,
'targetSdk': 30,
'compileSdk': 30,
'kotlin': '1.4.31',
'kotlin': '1.5.0',
'buildTools': '30.0.3',
'ndk': '22.0.7026061'
'ndk': '22.1.7171670'
]

ext.deps = [
Expand All @@ -78,7 +78,7 @@ buildscript {
]

dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'
classpath 'com.android.tools.build:gradle:4.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"
}

Expand Down Expand Up @@ -116,7 +116,6 @@ buildscript {
repositories {
mavenCentral()
google()
jcenter()
}
}

Expand All @@ -138,7 +137,6 @@ subprojects {
repositories {
mavenCentral()
google()
jcenter()
}

if (!name.startsWith("sample")) {
Expand Down Expand Up @@ -168,6 +166,7 @@ subprojects {

externalNativeBuild {
cmake {
version "3.19.0+"
path "CMakeLists.txt"
}
}
Expand Down
82 changes: 40 additions & 42 deletions android/buildSrc/src/main/groovy/FilamentPlugin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ import org.gradle.api.file.FileType
import org.gradle.api.file.RegularFileProperty
import org.gradle.api.logging.LogLevel
import org.gradle.api.logging.Logger
import org.gradle.api.provider.Property
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputDirectory
import org.gradle.api.tasks.InputFile
import org.gradle.api.tasks.Optional
import org.gradle.api.tasks.OutputDirectory
import org.gradle.api.tasks.TaskAction
import org.gradle.api.tasks.incremental.InputFileDetails
Expand All @@ -33,24 +36,23 @@ import java.nio.file.Paths

class TaskWithBinary extends DefaultTask {
private final String binaryName
private File binaryPath = null
private Property<String> binaryPath = null

TaskWithBinary(String name) {
binaryName = name
}

String getBinaryName() {
return binaryName
}

File getBinary() {
@Input
Property<String> getBinary() {
if (binaryPath == null) {
def tool = ["/bin/${binaryName}.exe", "/bin/${binaryName}"]
def fullPath = tool.collect { path ->
Paths.get(project.ext.filamentToolsPath.absolutePath, path).toFile()
}

binaryPath = OperatingSystem.current().isWindows() ? fullPath[0] : fullPath[1]
binaryPath = project.objects.property(String.class)
binaryPath.set(
(OperatingSystem.current().isWindows() ? fullPath[0] : fullPath[1]).toString())
}
return binaryPath
}
Expand All @@ -65,14 +67,6 @@ class LogOutputStream extends ByteArrayOutputStream {
this.level = level
}

Logger getLogger() {
return logger
}

LogLevel getLevel() {
return level
}

@Override
void flush() {
logger.log(level, toString())
Expand All @@ -85,10 +79,10 @@ class LogOutputStream extends ByteArrayOutputStream {
abstract class MaterialCompiler extends TaskWithBinary {
@Incremental
@InputDirectory
final DirectoryProperty inputDir = project.objects.directoryProperty()
abstract DirectoryProperty getInputDir()

@OutputDirectory
final DirectoryProperty outputDir = project.objects.directoryProperty()
abstract DirectoryProperty getOutputDir()

MaterialCompiler() {
super("matc")
Expand All @@ -115,8 +109,8 @@ abstract class MaterialCompiler extends TaskWithBinary {
out.write(header)
out.flush()

if (!getBinary().exists()) {
throw new GradleException("Could not find ${getBinary()}." +
if (!new File(binary.get()).exists()) {
throw new GradleException("Could not find ${binary.get()}." +
" Ensure Filament has been built/installed before building this app.")
}

Expand All @@ -129,7 +123,7 @@ abstract class MaterialCompiler extends TaskWithBinary {
project.exec {
standardOutput out
errorOutput err
executable "${getBinary()}"
executable "${binary.get()}"
args matcArgs
}
}
Expand All @@ -143,15 +137,17 @@ abstract class MaterialCompiler extends TaskWithBinary {

// Custom task to process IBLs using cmgen
// This task handles incremental builds
class IblGenerator extends TaskWithBinary {
String cmgenArgs = null
abstract class IblGenerator extends TaskWithBinary {
@Input
@Optional
abstract Property<String> getCmgenArgs()

@Incremental
@InputFile
final RegularFileProperty inputFile = project.objects.fileProperty()
abstract RegularFileProperty getInputFile()

@OutputDirectory
final DirectoryProperty outputDir = project.objects.directoryProperty()
abstract DirectoryProperty getOutputDir()

IblGenerator() {
super("cmgen")
Expand All @@ -178,23 +174,25 @@ class IblGenerator extends TaskWithBinary {
out.write(header)
out.flush()

if (!getBinary().exists()) {
throw new GradleException("Could not find ${getBinary()}." +
if (!new File(binary.get()).exists()) {
throw new GradleException("Could not find ${binary.get()}." +
" Ensure Filament has been built/installed before building this app.")
}

def outputPath = outputDir.get().asFile
def commandArgs = cmgenArgs.getOrNull()
if (commandArgs == null) {
commandArgs =
'-q -x ' + outputPath + ' --format=rgb32f ' +
'--extract-blur=0.08 --extract=' + outputPath.absolutePath
}
commandArgs = commandArgs + " " + file

project.exec {
standardOutput out
if (!cmgenArgs) {
cmgenArgs =
'-q -x ' + outputPath + ' --format=rgb32f ' +
'--extract-blur=0.08 --extract=' + outputPath.absolutePath
}
cmgenArgs = cmgenArgs + " " + file
errorOutput err
executable "${getBinary()}"
args(cmgenArgs.split())
executable "${binary.get()}"
args(commandArgs.split())
}
}
}
Expand All @@ -207,13 +205,13 @@ class IblGenerator extends TaskWithBinary {

// Custom task to compile mesh files using filamesh
// This task handles incremental builds
class MeshCompiler extends TaskWithBinary {
abstract class MeshCompiler extends TaskWithBinary {
@Incremental
@InputFile
final RegularFileProperty inputFile = project.objects.fileProperty()
abstract RegularFileProperty getInputFile()

@OutputDirectory
final DirectoryProperty outputDir = project.objects.directoryProperty()
abstract DirectoryProperty getOutputDir()

MeshCompiler() {
super("filamesh")
Expand All @@ -240,15 +238,15 @@ class MeshCompiler extends TaskWithBinary {
out.write(header)
out.flush()

if (!getBinary().exists()) {
throw new GradleException("Could not find ${getBinary()}." +
if (!new File(binary.get()).exists()) {
throw new GradleException("Could not find ${binary.get()}." +
" Ensure Filament has been built/installed before building this app.")
}

project.exec {
standardOutput out
errorOutput err
executable "${getBinary()}"
executable "${binary.get()}"
args(file, getOutputFile(file))
}
}
Expand Down Expand Up @@ -291,8 +289,8 @@ class FilamentToolsPlugin implements Plugin<Project> {
enabled =
extension.materialInputDir.isPresent() &&
extension.materialOutputDir.isPresent()
inputDir = extension.materialInputDir.getOrNull()
outputDir = extension.materialOutputDir.getOrNull()
inputDir.set(extension.materialInputDir.getOrNull())
outputDir.set(extension.materialOutputDir.getOrNull())
}

project.preBuild.dependsOn "filamentCompileMaterials"
Expand Down
3 changes: 2 additions & 1 deletion android/filamat-android/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.6)
cmake_minimum_required(VERSION 3.19)
project(filamat-android)

option(FILAMENT_ENABLE_MATDBG "Enables Material debugger" OFF)

Expand Down
3 changes: 2 additions & 1 deletion android/filament-android/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.6)
cmake_minimum_required(VERSION 3.19)
project(filament-android)

option(FILAMENT_SUPPORTS_VULKAN "Enables Vulkan on Android" OFF)
option(FILAMENT_ENABLE_MATDBG "Enables Material debugger" OFF)
Expand Down
16 changes: 14 additions & 2 deletions android/filament-android/src/main/cpp/View.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,10 @@ extern "C" JNIEXPORT void JNICALL
Java_com_google_android_filament_View_nSetBloomOptions(JNIEnv*, jclass,
jlong nativeView, jlong nativeTexture,
jfloat dirtStrength, jfloat strength, jint resolution, jfloat anamorphism, jint levels,
jint blendMode, jboolean threshold, jboolean enabled, jfloat highlight) {
jint blendMode, jboolean threshold, jboolean enabled, jfloat highlight,
jboolean lensFlare, jboolean starburst, jfloat chromaticAberration, jint ghostCount,
jfloat ghostSpacing, jfloat ghostThreshold, jfloat haloThickness, jfloat haloRadius,
jfloat haloThreshold) {
View* view = (View*) nativeView;
Texture* dirt = (Texture*) nativeTexture;
View::BloomOptions options = {
Expand All @@ -266,7 +269,16 @@ Java_com_google_android_filament_View_nSetBloomOptions(JNIEnv*, jclass,
.blendMode = (View::BloomOptions::BlendMode)blendMode,
.threshold = (bool)threshold,
.enabled = (bool)enabled,
.highlight = highlight
.highlight = highlight,
.lensFlare = (bool)lensFlare,
.starburst = (bool)starburst,
.chromaticAberration = chromaticAberration,
.ghostCount = (uint8_t)ghostCount,
.ghostSpacing = ghostSpacing,
.ghostThreshold = ghostThreshold,
.haloThickness = haloThickness,
.haloRadius = haloRadius,
.haloThreshold = haloThreshold
};
view->setBloomOptions(options);
}
Expand Down
Loading

0 comments on commit 77891ac

Please sign in to comment.