Skip to content

Commit

Permalink
Moved Support into Assets for accessibility
Browse files Browse the repository at this point in the history
  • Loading branch information
msub2 committed Feb 7, 2021
1 parent fff07d6 commit e1b3de5
Show file tree
Hide file tree
Showing 638 changed files with 114,532 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Assets/Scenes/Loading.unity
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4662475461949518, guid: 770ce3c2e018d6242be0bad3df133810, type: 3}
propertyPath: m_LocalPosition.z
value: 0
value: 5
objectReference: {fileID: 0}
- target: {fileID: 4662475461949518, guid: 770ce3c2e018d6242be0bad3df133810, type: 3}
propertyPath: m_LocalRotation.w
Expand Down
2 changes: 1 addition & 1 deletion Assets/Scripts/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public class App : MonoBehaviour
public const string kGoogleServicesAppName = kAppDisplayName;
// The name of the configuration file. You may want to change this if you think your users may
// want to have a different config file for your edition of the app.
public const string kConfigFileName = "Tilt Brush.cfg";
public const string kConfigFileName = "Silk Brush.cfg";
// The name of the App folder (In the user's Documents folder) - you may want to share this with
// the original Tilt Brush, or not.
public const string kAppFolderName = "Silk Brush";
Expand Down
2 changes: 0 additions & 2 deletions Assets/Scripts/Save/SaveLoadScript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,6 @@ public IEnumerator<Timeslice> SaveNewName(bool tiltasaurusMode = false)
private IEnumerator<Timeslice> SaveLow(
SceneFileInfo info, bool bNotify = true, SketchSnapshot snapshot = null)
{
Debug.Log("Starting SaveLow");
Debug.Assert(!SelectionManager.m_Instance.HasSelection);
if (snapshot != null && info.AssetId != snapshot.AssetId)
{
Expand All @@ -426,7 +425,6 @@ private IEnumerator<Timeslice> SaveLow(
private IEnumerator<Timeslice> ThreadedSave(SceneFileInfo fileInfo,
bool bNotify = true, SketchSnapshot snapshot = null)
{
Debug.Log("Starting ThreadedSave");
// Cancel any pending transfers of this file.
var cancelTask = App.DriveSync.CancelTransferAsync(fileInfo.FullPath);

Expand Down
8 changes: 8 additions & 0 deletions Assets/Support.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Assets/Support/GlTFShaders.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Assets/Support/GlTFShaders/Generators.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// Copyright 2020 The Tilt Brush Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Brush-specific shader for GlTF web preview, based on Diffuse.glsl
// generator with parameters: a=0.067.

precision mediump float;

uniform vec4 u_ambient_light_color;
uniform vec4 u_SceneLight_0_color;
uniform vec4 u_SceneLight_1_color;
uniform vec3 u_SpecColor;
uniform float u_Shininess;

varying vec4 v_color;
varying vec3 v_normal;
varying vec3 v_position;
varying vec3 v_light_dir_0;
varying vec3 v_light_dir_1;
varying vec2 v_texcoord0;

#include "Fog.glsl"
#include "SurfaceShader.glsl"

vec3 computeLighting() {
vec3 normal = normalize(v_normal);
if (!gl_FrontFacing) {
// Always use front-facing normal for double-sided surfaces.
normal *= -1.0;
}
vec3 lightDir0 = normalize(v_light_dir_0);
vec3 lightDir1 = normalize(v_light_dir_1);
vec3 eyeDir = -normalize(v_position);

vec3 lightOut0 = SurfaceShaderSpecularGloss(normal, lightDir0, eyeDir, u_SceneLight_0_color.rgb,
v_color.rgb, u_SpecColor, u_Shininess);
vec3 lightOut1 = ShShaderWithSpec(normal, lightDir1, u_SceneLight_1_color.rgb, v_color.rgb, u_SpecColor);
vec3 ambientOut = v_color.rgb * u_ambient_light_color.rgb;

return (lightOut0 + lightOut1 + ambientOut);
}

void main() {
gl_FragColor.rgb = ApplyFog(computeLighting());
gl_FragColor.a = 1.0;
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Copyright 2020 The Tilt Brush Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#include "VertDefault.glsl"

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
// Copyright 2020 The Tilt Brush Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#extension GL_OES_standard_derivatives : enable

precision mediump float;

uniform vec4 u_ambient_light_color;
uniform vec4 u_SceneLight_0_color;
uniform vec4 u_SceneLight_1_color;
uniform float u_Shininess;
uniform float u_RimIntensity;
uniform float u_RimPower;
uniform vec4 u_Color;
uniform float u_Frequency;
uniform float u_Jitter;

varying vec4 v_color;
varying vec3 v_normal;
varying vec3 v_position;
varying vec3 v_local_position;
varying vec3 v_light_dir_0;
varying vec3 v_light_dir_1;
varying vec2 v_texcoord0;

#include "SurfaceShader.glsl"
#include "third_party/voronoi.glsl"

// Specular only lighting
vec3 computeGemReflection() {
vec3 normal = normalize(v_normal);

// Get Voronoi
vec2 F = fBm_F0(v_local_position, OCTAVES);
float gem = (F.y - F.x);

// Perturb normal with voronoi cells
float perturbIntensity = 50.; //was 10. in unity. Presumably glsl vs. hlsl is the source of the discrepancy.
normal.y += dFdy(gem) * perturbIntensity;
normal.x += dFdx(gem) * perturbIntensity;
normal = normalize(normal);

vec3 lightDir0 = normalize(v_light_dir_0);
vec3 lightDir1 = normalize(v_light_dir_1);
vec3 eyeDir = -normalize(v_position);
vec3 diffuseColor = vec3(0.,0.,0.);

// Artifical diffraction highlights to simulate what I see in blocks. Tuned to taste.
vec3 refl = eyeDir - 2. * dot(eyeDir, normal) * normal + gem;
vec3 colorRamp = vec3(1.,.3,0)*sin(refl.x * 30.) + vec3(0.,1.,.5)*cos(refl.y * 37.77) + vec3(0.,0.,1.)*sin(refl.z*43.33);

// was colorRamp * .1 in unity, but boosting since
// we don't have an environment map on Poly
vec3 specularColor = u_Color.rgb + colorRamp * .5;
float smoothness = u_Shininess;

vec3 lightOut0 = SurfaceShaderSpecularGloss(normal, lightDir0, eyeDir, u_SceneLight_0_color.rgb,
diffuseColor, specularColor, smoothness);

// Calculate rim lighting
float viewAngle = clamp(dot(eyeDir, normal),0.,1.);
float rim = pow(1. - viewAngle, u_RimPower);
vec3 rimColor = vec3(rim,rim,rim) * u_RimIntensity;

return (lightOut0 + rimColor);
}

void main() {
gl_FragColor.rgb = computeGemReflection();
gl_FragColor.a = 1.0;
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Copyright 2020 The Tilt Brush Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// DefaultVS.glsl
attribute vec4 a_position;
attribute vec3 a_normal;
attribute vec4 a_color;
attribute vec2 a_texcoord0;

varying vec4 v_color;
varying vec3 v_normal; // Camera-space normal.
varying vec3 v_position; // Camera-space position.
varying vec3 v_local_position;
varying vec2 v_texcoord0;
varying vec3 v_light_dir_0; // Camera-space light direction, main light.
varying vec3 v_light_dir_1; // Camera-space light direction, other light.

uniform mat4 modelViewMatrix;
uniform mat4 projectionMatrix;
uniform mat3 normalMatrix;
uniform mat4 u_SceneLight_0_matrix;
uniform mat4 u_SceneLight_1_matrix;

void main() {
gl_Position = projectionMatrix * modelViewMatrix * a_position;
v_normal = normalMatrix * a_normal;
v_position = (modelViewMatrix * a_position).xyz;
v_local_position = a_position.xyz;
v_light_dir_0 = mat3(u_SceneLight_0_matrix) * vec3(0, 0, 1);
v_light_dir_1 = mat3(u_SceneLight_1_matrix) * vec3(0, 0, 1);
v_color = a_color;
v_texcoord0 = a_texcoord0;
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// Copyright 2020 The Tilt Brush Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Brush-specific shader for GlTF web preview, based on Diffuse.glsl
// generator with parameters: a=0.067.

precision mediump float;

uniform vec4 u_ambient_light_color;
uniform vec4 u_SceneLight_0_color;
uniform vec4 u_SceneLight_1_color;
uniform float u_Shininess;
uniform float u_RimIntensity;
uniform float u_RimPower;
uniform vec4 u_Color;

varying vec4 v_color;
varying vec3 v_normal;
varying vec3 v_position;
varying vec3 v_light_dir_0;
varying vec3 v_light_dir_1;
varying vec2 v_texcoord0;

#include "SurfaceShader.glsl"

// Specular only lighting
vec3 computeGlassReflection() {
vec3 normal = normalize(v_normal);
float backfaceDimming = 1.;
if (!gl_FrontFacing) {
// Always use front-facing normal for double-sided surfaces.
normal *= -1.0;
backfaceDimming = .25;
}
vec3 lightDir0 = normalize(v_light_dir_0);
vec3 lightDir1 = normalize(v_light_dir_1);
vec3 eyeDir = -normalize(v_position);

vec3 diffuseColor = vec3(0.,0.,0.);
vec3 specularColor = vec3(u_Color.r, u_Color.g, u_Color.b);
vec3 lightOut0 = SurfaceShaderSpecularGloss(normal, lightDir0, eyeDir, u_SceneLight_0_color.rgb,
diffuseColor, specularColor, u_Shininess);

// Calculate rim lighting
float viewAngle = clamp(dot(eyeDir, normal),0.,1.);
float rim = pow(1. - viewAngle, u_RimPower) * u_RimIntensity;
vec3 rimColor = vec3(rim,rim,rim);

return (lightOut0 + rimColor) * backfaceDimming;
}

void main() {
gl_FragColor.rgb = computeGlassReflection();
gl_FragColor.a = 1.0;
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Copyright 2020 The Tilt Brush Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#include "VertDefault.glsl"

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e1b3de5

Please sign in to comment.