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

Commit

Permalink
Sceneform SDK v1.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nvictornvictor committed Dec 6, 2018
1 parent ae9d3fa commit 26185e7
Show file tree
Hide file tree
Showing 57 changed files with 6,240 additions and 198 deletions.
29 changes: 29 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# How to Contribute

We'd love to accept your patches and contributions to the source code included
in this project. There are just a few small guidelines you need to follow.

## Contributor License Agreement

Contributions to this project must be accompanied by a Contributor License
Agreement. You (or your employer) retain the copyright to your contribution;
this simply gives us permission to use and redistribute your contributions as
part of the project. Head over to <https://cla.developers.google.com/> to see
your current agreements on file or to sign a new one.

You generally only need to submit a CLA once, so if you've already submitted one
(even if it was for a different project), you probably don't need to do it
again.

## Code reviews

Although we do not use the normal GitHub pull request process to incorporate
contributions, it's okay to send us pull requests. Once we have received your
CLA we will review and consider your contribution for inclusion in a future
release of the SDK.

## Community Guidelines

This project follows
[Google's Open Source Community
Guidelines](https://opensource.google.com/conduct/).
25 changes: 10 additions & 15 deletions samples/augmentedimage/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,18 @@ android {
defaultConfig {
applicationId "com.google.ar.sceneform.samples.augmentedimage"

// 24 is the minimum since Sceneform requires Android N.
// Sceneform requires minSdkVersion >= 24.
minSdkVersion 24
targetSdkVersion 27
versionCode 1
versionName "1.0"

ndk {
/*
* Sceneform is available for the following ABIs: arm64-v8a, armeabi-v7a,
* x86_64 and x86. This sample app enables arm64-v8a to run on
* devices and x86 to run on the emulator. Your application should
* list the ABIs most appropriate to minimize APK size (arm64-v8a recommended).
*/
abiFilters 'arm64-v8a', 'x86'
}
}

// Sceneform libraries use language constructs from Java 8.
// Add these compile options if targeting minSdkVersion < 26.
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
release {
minifyEnabled false
Expand All @@ -52,10 +47,10 @@ dependencies {
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'

// Use the Sceneform Ux Package pre-built from Maven.
implementation "com.google.ar.sceneform.ux:sceneform-ux:1.5.1"
// Use the Sceneform UX Package pre-built from Maven.
implementation "com.google.ar.sceneform.ux:sceneform-ux:1.6.0"

// Use the Sceneform Ux Package built from the source files included in the sceneformux folder.
// Use the Sceneform UX Package built from the source files included in the sceneformux folder.
//api project(":sceneformux")
}

Expand Down
2 changes: 1 addition & 1 deletion samples/augmentedimage/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.google.ar.sceneform:plugin:1.5.1'
classpath 'com.google.ar.sceneform:plugin:1.6.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
Binary file modified samples/augmentedimage/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
19 changes: 6 additions & 13 deletions samples/chromakeyvideo/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,14 @@ android {
defaultConfig {
applicationId "com.google.ar.sceneform.samples.chromakeyvideo"

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

// Use the Sceneform Ux Package pre-built from Maven.
implementation "com.google.ar.sceneform.ux:sceneform-ux:1.5.1"
// Use the Sceneform UX Package pre-built from Maven.
implementation "com.google.ar.sceneform.ux:sceneform-ux:1.6.0"

// Use the Sceneform Ux Package built from the source files included in the sceneformux folder.
// Use the Sceneform UX Package built from the source files included in the sceneformux folder.
//api project(":sceneformux")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ material {
// The color to filter out of the video.
"type" : "float4",
"name" : "keyColor"
},
{
"type" : "bool",
"name" : "disableChromaKey",
}
],
"requires" : [
Expand Down Expand Up @@ -58,19 +62,24 @@ fragment {
uv.x = 1.0 - uv.x;
}

vec3 color = texture(materialParams_videoTexture, uv).rgb;
vec3 keyColor = materialParams.keyColor.rgb;
vec4 color = texture(materialParams_videoTexture, uv).rgba;

float threshold = 0.675;
float slope = 0.2;
if (!materialParams.disableChromaKey) {
vec3 keyColor = materialParams.keyColor.rgb;

float distance = abs(length(abs(keyColor - color)));
float edge0 = threshold * (1.0 - slope);
float alpha = smoothstep(edge0, threshold, distance);
color = desaturate(color, 1.0 - (alpha * alpha * alpha));
float threshold = 0.675;
float slope = 0.2;

material.baseColor.a = alpha;
material.baseColor.rgb = inverseTonemapSRGB(color);
material.baseColor.rgb *= material.baseColor.a;
float distance = abs(length(abs(keyColor - color.rgb)));
float edge0 = threshold * (1.0 - slope);
float alpha = smoothstep(edge0, threshold, distance);
color.rgb = desaturate(color.rgb, 1.0 - (alpha * alpha * alpha));

material.baseColor.a = alpha;
material.baseColor.rgb = inverseTonemapSRGB(color.rgb);
material.baseColor.rgb *= material.baseColor.a;
} else {
material.baseColor = color;
}
}
}
2 changes: 1 addition & 1 deletion samples/chromakeyvideo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.google.ar.sceneform:plugin:1.5.1'
classpath 'com.google.ar.sceneform:plugin:1.6.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
Binary file modified samples/chromakeyvideo/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
22 changes: 4 additions & 18 deletions samples/hellosceneform/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,11 @@ android {
defaultConfig {
applicationId "com.google.ar.sceneform.samples.hellosceneform"

// AR Optional apps must declare minSdkVersion >= 14.
// AR Required apps must declare minSdkVersion >= 24.
// Sceneform requires minSdkVersion >= 24.
minSdkVersion 24
targetSdkVersion 27
versionCode 1
versionName "1.0"
ndk {
/*
* Sceneform is available for the following ABIs:
* 'arm64-v8a', 'armeabi-v7a', 'x86_64' and 'x86'.
* Your application should include the ABIs most appropriate to
* minimize APK size. Listing 'arm64-v8a' is recommended.
*
* This sample app includes two ABIs:
* 1. 'arm64-v8a' to run on devices
* 2. 'x86' to run in the Android emulator
*/
abiFilters 'arm64-v8a', 'x86'
}
}
// Sceneform libraries use language constructs from Java 8.
// Add these compile options if targeting minSdkVersion < 26.
Expand All @@ -60,13 +46,13 @@ android {
dependencies {

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

// Use the Sceneform Ux Package built from the source files included in the sceneformux folder.
// Use the Sceneform UX Package built from the source files included in the sceneformux folder.
//api project(":sceneformux")

// Alternatively, use ArSceneView without the UX dependency.
//implementation "com.google.ar.sceneform:core:1.5.1"
//implementation "com.google.ar.sceneform:core:1.6.0"

implementation "com.android.support:appcompat-v7:27.1.1"
}
Expand Down
2 changes: 1 addition & 1 deletion samples/hellosceneform/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.google.ar.sceneform:plugin:1.5.1'
classpath 'com.google.ar.sceneform:plugin:1.6.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
Binary file modified samples/hellosceneform/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
15 changes: 4 additions & 11 deletions samples/solarsystem/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,14 @@ android {
defaultConfig {
applicationId "com.google.ar.sceneform.samples.solarsystem"

// 24 is the minimum since ARCore only works with 24 and higher.
// Sceneform requires minSdkVersion >= 24.
minSdkVersion 24
targetSdkVersion 27
versionCode 1
versionName "1.0"
ndk {
/*
* Sceneform is available for the following ABIs: arm64-v8a, armeabi-v7a,
* x86_64 and x86. This sample app enables arm64-v8a to run on
* devices and x86 to run on the emulator. Your application should
* list the ABIs most appropriate to minimize APK size (arm64-v8a recommended).
*/
abiFilters 'arm64-v8a','x86'
}
}
// Sceneform libraries use language constructs from Java 8.
// Add these compile options if targeting minSdkVersion < 26.
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
Expand All @@ -51,7 +44,7 @@ android {
}

dependencies {
implementation "com.google.ar.sceneform:core:1.5.1"
implementation "com.google.ar.sceneform:core:1.6.0"
implementation "com.android.support:appcompat-v7:27.1.1"
implementation "com.android.support:design:27.1.1"
}
Expand Down
6 changes: 0 additions & 6 deletions samples/solarsystem/app/sampledata/models/Earth/Earth.sfa
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@
{
emissive: null,
},
{
reflectance: null,
},
{
opacity: null,
},
Expand Down Expand Up @@ -125,9 +122,6 @@
{
emissive: null,
},
{
reflectance: null,
},
{
opacity: null,
},
Expand Down
6 changes: 0 additions & 6 deletions samples/solarsystem/app/sampledata/models/Jupiter/Jupiter.sfa
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@
{
emissive: null,
},
{
reflectance: null,
},
{
opacity: null,
},
Expand Down Expand Up @@ -125,9 +122,6 @@
{
emissive: null,
},
{
reflectance: null,
},
{
opacity: null,
},
Expand Down
3 changes: 0 additions & 3 deletions samples/solarsystem/app/sampledata/models/Luna/Luna.sfa
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@
{
emissive: null,
},
{
reflectance: null,
},
{
opacity: null,
},
Expand Down
6 changes: 0 additions & 6 deletions samples/solarsystem/app/sampledata/models/Mars/Mars.sfa
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@
{
emissive: null,
},
{
reflectance: null,
},
{
opacity: null,
},
Expand Down Expand Up @@ -125,9 +122,6 @@
{
emissive: null,
},
{
reflectance: null,
},
{
opacity: null,
},
Expand Down
3 changes: 0 additions & 3 deletions samples/solarsystem/app/sampledata/models/Mercury/Mercury.sfa
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@
{
emissive: null,
},
{
reflectance: null,
},
{
opacity: null,
},
Expand Down
6 changes: 0 additions & 6 deletions samples/solarsystem/app/sampledata/models/Neptune/Neptune.sfa
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@
{
emissive: null,
},
{
reflectance: null,
},
{
opacity: null,
},
Expand Down Expand Up @@ -125,9 +122,6 @@
{
emissive: null,
},
{
reflectance: null,
},
{
opacity: null,
},
Expand Down
9 changes: 0 additions & 9 deletions samples/solarsystem/app/sampledata/models/Saturn/Saturn.sfa
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@
{
emissive: null,
},
{
reflectance: null,
},
{
opacity: null,
},
Expand Down Expand Up @@ -125,9 +122,6 @@
{
emissive: null,
},
{
reflectance: null,
},
{
opacity: null,
},
Expand Down Expand Up @@ -192,9 +186,6 @@
{
emissive: null,
},
{
reflectance: null,
},
{
opacity: null,
},
Expand Down
Loading

0 comments on commit 26185e7

Please sign in to comment.