Skip to content
This repository was archived by the owner on Jul 28, 2020. It is now read-only.

Commit 26185e7

Browse files
Sceneform SDK v1.6.0
1 parent ae9d3fa commit 26185e7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+6240
-198
lines changed

CONTRIBUTING.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# How to Contribute
2+
3+
We'd love to accept your patches and contributions to the source code included
4+
in this project. There are just a few small guidelines you need to follow.
5+
6+
## Contributor License Agreement
7+
8+
Contributions to this project must be accompanied by a Contributor License
9+
Agreement. You (or your employer) retain the copyright to your contribution;
10+
this simply gives us permission to use and redistribute your contributions as
11+
part of the project. Head over to <https://cla.developers.google.com/> to see
12+
your current agreements on file or to sign a new one.
13+
14+
You generally only need to submit a CLA once, so if you've already submitted one
15+
(even if it was for a different project), you probably don't need to do it
16+
again.
17+
18+
## Code reviews
19+
20+
Although we do not use the normal GitHub pull request process to incorporate
21+
contributions, it's okay to send us pull requests. Once we have received your
22+
CLA we will review and consider your contribution for inclusion in a future
23+
release of the SDK.
24+
25+
## Community Guidelines
26+
27+
This project follows
28+
[Google's Open Source Community
29+
Guidelines](https://opensource.google.com/conduct/).

samples/augmentedimage/app/build.gradle

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,18 @@ android {
1919
defaultConfig {
2020
applicationId "com.google.ar.sceneform.samples.augmentedimage"
2121

22-
// 24 is the minimum since Sceneform requires Android N.
22+
// Sceneform requires minSdkVersion >= 24.
2323
minSdkVersion 24
2424
targetSdkVersion 27
2525
versionCode 1
2626
versionName "1.0"
27-
28-
ndk {
29-
/*
30-
* Sceneform is available for the following ABIs: arm64-v8a, armeabi-v7a,
31-
* x86_64 and x86. This sample app enables arm64-v8a to run on
32-
* devices and x86 to run on the emulator. Your application should
33-
* list the ABIs most appropriate to minimize APK size (arm64-v8a recommended).
34-
*/
35-
abiFilters 'arm64-v8a', 'x86'
36-
}
3727
}
38-
28+
// Sceneform libraries use language constructs from Java 8.
29+
// Add these compile options if targeting minSdkVersion < 26.
30+
compileOptions {
31+
sourceCompatibility JavaVersion.VERSION_1_8
32+
targetCompatibility JavaVersion.VERSION_1_8
33+
}
3934
buildTypes {
4035
release {
4136
minifyEnabled false
@@ -52,10 +47,10 @@ dependencies {
5247
implementation 'com.android.support:appcompat-v7:27.1.1'
5348
implementation 'com.android.support:design:27.1.1'
5449

55-
// Use the Sceneform Ux Package pre-built from Maven.
56-
implementation "com.google.ar.sceneform.ux:sceneform-ux:1.5.1"
50+
// Use the Sceneform UX Package pre-built from Maven.
51+
implementation "com.google.ar.sceneform.ux:sceneform-ux:1.6.0"
5752

58-
// Use the Sceneform Ux Package built from the source files included in the sceneformux folder.
53+
// Use the Sceneform UX Package built from the source files included in the sceneformux folder.
5954
//api project(":sceneformux")
6055
}
6156

samples/augmentedimage/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ buildscript {
2323
}
2424
dependencies {
2525
classpath 'com.android.tools.build:gradle:3.1.4'
26-
classpath 'com.google.ar.sceneform:plugin:1.5.1'
26+
classpath 'com.google.ar.sceneform:plugin:1.6.0'
2727
// NOTE: Do not place your application dependencies here; they belong
2828
// in the individual module build.gradle files
2929
}
1.72 KB
Binary file not shown.

samples/chromakeyvideo/app/build.gradle

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,14 @@ android {
1919
defaultConfig {
2020
applicationId "com.google.ar.sceneform.samples.chromakeyvideo"
2121

22-
// 24 is the minimum since ARCore only works with 24 and higher.
22+
// Sceneform requires minSdkVersion >= 24.
2323
minSdkVersion 24
2424
targetSdkVersion 27
2525
versionCode 1
2626
versionName "1.0"
27-
ndk {
28-
/*
29-
* Sceneform is available for the following ABIs: arm64-v8a, armeabi-v7a,
30-
* x86_64 and x86. This sample app enables arm64-v8a to run on
31-
* devices and x86 to run on the emulator. Your application should
32-
* list the ABIs most appropriate to minimize APK size (arm64-v8a recommended).
33-
*/
34-
abiFilters 'arm64-v8a', 'x86'
35-
}
3627
}
28+
// Sceneform libraries use language constructs from Java 8.
29+
// Add these compile options if targeting minSdkVersion < 26.
3730
compileOptions {
3831
sourceCompatibility JavaVersion.VERSION_1_8
3932
targetCompatibility JavaVersion.VERSION_1_8
@@ -54,10 +47,10 @@ dependencies {
5447
implementation "com.android.support:appcompat-v7:27.1.1"
5548
implementation "com.android.support:design:27.1.1"
5649

57-
// Use the Sceneform Ux Package pre-built from Maven.
58-
implementation "com.google.ar.sceneform.ux:sceneform-ux:1.5.1"
50+
// Use the Sceneform UX Package pre-built from Maven.
51+
implementation "com.google.ar.sceneform.ux:sceneform-ux:1.6.0"
5952

60-
// Use the Sceneform Ux Package built from the source files included in the sceneformux folder.
53+
// Use the Sceneform UX Package built from the source files included in the sceneformux folder.
6154
//api project(":sceneformux")
6255
}
6356

samples/chromakeyvideo/app/sampledata/models/chroma_key_video_material.mat

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ material {
2626
// The color to filter out of the video.
2727
"type" : "float4",
2828
"name" : "keyColor"
29+
},
30+
{
31+
"type" : "bool",
32+
"name" : "disableChromaKey",
2933
}
3034
],
3135
"requires" : [
@@ -58,19 +62,24 @@ fragment {
5862
uv.x = 1.0 - uv.x;
5963
}
6064

61-
vec3 color = texture(materialParams_videoTexture, uv).rgb;
62-
vec3 keyColor = materialParams.keyColor.rgb;
65+
vec4 color = texture(materialParams_videoTexture, uv).rgba;
6366

64-
float threshold = 0.675;
65-
float slope = 0.2;
67+
if (!materialParams.disableChromaKey) {
68+
vec3 keyColor = materialParams.keyColor.rgb;
6669

67-
float distance = abs(length(abs(keyColor - color)));
68-
float edge0 = threshold * (1.0 - slope);
69-
float alpha = smoothstep(edge0, threshold, distance);
70-
color = desaturate(color, 1.0 - (alpha * alpha * alpha));
70+
float threshold = 0.675;
71+
float slope = 0.2;
7172

72-
material.baseColor.a = alpha;
73-
material.baseColor.rgb = inverseTonemapSRGB(color);
74-
material.baseColor.rgb *= material.baseColor.a;
73+
float distance = abs(length(abs(keyColor - color.rgb)));
74+
float edge0 = threshold * (1.0 - slope);
75+
float alpha = smoothstep(edge0, threshold, distance);
76+
color.rgb = desaturate(color.rgb, 1.0 - (alpha * alpha * alpha));
77+
78+
material.baseColor.a = alpha;
79+
material.baseColor.rgb = inverseTonemapSRGB(color.rgb);
80+
material.baseColor.rgb *= material.baseColor.a;
81+
} else {
82+
material.baseColor = color;
83+
}
7584
}
7685
}

samples/chromakeyvideo/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ buildscript {
2323
}
2424
dependencies {
2525
classpath 'com.android.tools.build:gradle:3.1.4'
26-
classpath 'com.google.ar.sceneform:plugin:1.5.1'
26+
classpath 'com.google.ar.sceneform:plugin:1.6.0'
2727
// NOTE: Do not place your application dependencies here; they belong
2828
// in the individual module build.gradle files
2929
}
1.72 KB
Binary file not shown.

samples/hellosceneform/app/build.gradle

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,11 @@ android {
1919
defaultConfig {
2020
applicationId "com.google.ar.sceneform.samples.hellosceneform"
2121

22-
// AR Optional apps must declare minSdkVersion >= 14.
23-
// AR Required apps must declare minSdkVersion >= 24.
22+
// Sceneform requires minSdkVersion >= 24.
2423
minSdkVersion 24
2524
targetSdkVersion 27
2625
versionCode 1
2726
versionName "1.0"
28-
ndk {
29-
/*
30-
* Sceneform is available for the following ABIs:
31-
* 'arm64-v8a', 'armeabi-v7a', 'x86_64' and 'x86'.
32-
* Your application should include the ABIs most appropriate to
33-
* minimize APK size. Listing 'arm64-v8a' is recommended.
34-
*
35-
* This sample app includes two ABIs:
36-
* 1. 'arm64-v8a' to run on devices
37-
* 2. 'x86' to run in the Android emulator
38-
*/
39-
abiFilters 'arm64-v8a', 'x86'
40-
}
4127
}
4228
// Sceneform libraries use language constructs from Java 8.
4329
// Add these compile options if targeting minSdkVersion < 26.
@@ -60,13 +46,13 @@ android {
6046
dependencies {
6147

6248
// Provides ArFragment, and other Sceneform UX resources:
63-
implementation "com.google.ar.sceneform.ux:sceneform-ux:1.5.1"
49+
implementation "com.google.ar.sceneform.ux:sceneform-ux:1.6.0"
6450

65-
// Use the Sceneform Ux Package built from the source files included in the sceneformux folder.
51+
// Use the Sceneform UX Package built from the source files included in the sceneformux folder.
6652
//api project(":sceneformux")
6753

6854
// Alternatively, use ArSceneView without the UX dependency.
69-
//implementation "com.google.ar.sceneform:core:1.5.1"
55+
//implementation "com.google.ar.sceneform:core:1.6.0"
7056

7157
implementation "com.android.support:appcompat-v7:27.1.1"
7258
}

samples/hellosceneform/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ buildscript {
2323
}
2424
dependencies {
2525
classpath 'com.android.tools.build:gradle:3.1.4'
26-
classpath 'com.google.ar.sceneform:plugin:1.5.1'
26+
classpath 'com.google.ar.sceneform:plugin:1.6.0'
2727
// NOTE: Do not place your application dependencies here; they belong
2828
// in the individual module build.gradle files
2929
}

0 commit comments

Comments
 (0)