Skip to content

Commit

Permalink
Merge branch 'feature/glb2'
Browse files Browse the repository at this point in the history
Change-Id: Id000b015158f47021206ef93e9d23aafed2d0b72
  • Loading branch information
dubois committed Nov 6, 2019
2 parents f30d95b + 195531d commit 9ead5bb
Show file tree
Hide file tree
Showing 19 changed files with 637 additions and 58 deletions.
84 changes: 84 additions & 0 deletions UnitySDK/Assets/TiltBrush/Materials/BasePbrBlendSingleSided.mat
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: BasePbrBlendSingleSided
m_Shader: {fileID: 4800000, guid: f2ac7f21f7ce99242a92ce666e3a7df8, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseColorTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _MetallicFactor: 1
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _RoughnessFactor: 1
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _BaseColorFactor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

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

84 changes: 84 additions & 0 deletions UnitySDK/Assets/TiltBrush/Materials/BasePbrOpaqueSingleSided.mat
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: BasePbrOpaqueSingleSided
m_Shader: {fileID: 4800000, guid: c3d2397b0f2a38a478072d4d66b2410c, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseColorTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _MetallicFactor: 1
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _RoughnessFactor: 1
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _BaseColorFactor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

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

63 changes: 63 additions & 0 deletions UnitySDK/Assets/TiltBrush/Materials/PbrBlendSingleSided.shader
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// Copyright 2017 Google Inc. All rights reserved.
//
// 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
//
// https://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.

// GLTF2 PBR Transparent Shader. For spec info, see:
// https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/schema/material.pbrMetallicRoughness.schema.json
Shader "Poly/PbrBlendSingleSided" {
Properties {
_BaseColorFactor ("Base Color Factor", Color) = (1,1,1,1)
_BaseColorTex ("Base Color Texture", 2D) = "white" {}
_MetallicFactor ("Metallic Factor", Range(0,1)) = 1.0
_RoughnessFactor ("Roughness Factor", Range(0,1)) = 1.0
}
SubShader {
Cull Back
ZWrite Off
Tags { "Queue"="Transparent" "RenderType"="Transparent" }

CGPROGRAM
// Physically based Standard lighting model
// No shadow-receiving passes
#pragma surface surf Standard noshadow alpha:blend

// Use shader model 3.0 target, because we use VFACE and to get nicer looking lighting
#pragma target 3.0

sampler2D _BaseColorTex;

struct Input {
float2 uv_BaseColorTex;
// Filled in with (rgb=1, a=1) if the mesh doesn't have color
float4 color : COLOR;
fixed vface : VFACE;
};

fixed4 _BaseColorFactor;
half _MetallicFactor;
half _RoughnessFactor;

void surf (Input IN, inout SurfaceOutputStandard o) {
// Albedo comes from a texture tinted by color
float4 c = tex2D(_BaseColorTex, IN.uv_BaseColorTex) * _BaseColorFactor * IN.color;
o.Normal = float3(0, 0, IN.vface);
o.Albedo = c.rgb;
o.Alpha = c.a;
// Metallic and smoothness come from parameters.
o.Metallic = _MetallicFactor;
// Smoothness is the opposite of roughness.
o.Smoothness = 1.0 - _RoughnessFactor;
}
ENDCG
}
}

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

64 changes: 64 additions & 0 deletions UnitySDK/Assets/TiltBrush/Materials/PbrOpaqueSingleSided.shader
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
// Copyright 2017 Google Inc. All rights reserved.
//
// 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
//
// https://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.

// GLTF2 PBR Basic Shader. For spec info, see:
// https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/schema/material.pbrMetallicRoughness.schema.json
Shader "Poly/PbrOpaqueSingleSided" {
Properties {
_BaseColorFactor ("Base Color Factor", Color) = (1,1,1,1)
_BaseColorTex ("Base Color Texture", 2D) = "white" {}
_MetallicFactor ("Metallic Factor", Range(0,1)) = 1.0
_RoughnessFactor ("Roughness Factor", Range(0,1)) = 1.0
}
SubShader {
Cull Back
Zwrite On
Tags { "RenderType"="Opaque" }

CGPROGRAM
// Physically based Standard lighting model
// Add shadow-casting pass
// Stick with default shadow-receiving passes for now
#pragma surface surf Standard addshadow // fullforwardshadows

// Use shader model 3.0 target, because we use VFACE and to get nicer looking lighting
#pragma target 3.0

sampler2D _BaseColorTex;

struct Input {
float2 uv_BaseColorTex;
// Filled in with (rgb=1, a=1) if the mesh doesn't have color
float4 color : COLOR;
fixed vface : VFACE;
};

fixed4 _BaseColorFactor;
half _MetallicFactor;
half _RoughnessFactor;

void surf (Input IN, inout SurfaceOutputStandard o) {
// Albedo comes from a texture tinted by color
float4 c = tex2D(_BaseColorTex, IN.uv_BaseColorTex) * _BaseColorFactor * IN.color;
o.Normal = float3(0, 0, IN.vface);
o.Albedo = c.rgb;
// Metallic and smoothness come from parameters.
o.Metallic = _MetallicFactor;
// Smoothness is the opposite of roughness.
o.Smoothness = 1.0 - _RoughnessFactor;
}
ENDCG
}
FallBack "Diffuse"
}

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
Expand Up @@ -14,5 +14,9 @@ MonoBehaviour:
m_BrushManifest: {fileID: 11400000, guid: 2b3e59298bb8cfc47bddd1e1ea01be06, type: 2}
m_BasePbrOpaqueDoubleSidedMaterial: {fileID: 2100000, guid: a24c5cab5717b124889fe758761686b4,
type: 2}
m_BasePbrOpaqueSingleSidedMaterial: {fileID: 2100000, guid: bf9540d0511f2ff4eb1b0e4c5b4fe197,
type: 2}
m_BasePbrBlendDoubleSidedMaterial: {fileID: 2100000, guid: b2b07ce943390e34993803beeb1e8548,
type: 2}
m_BasePbrBlendSingleSidedMaterial: {fileID: 2100000, guid: 6247073d7a73b1143a8edf84c9b05aef,
type: 2}
1 change: 0 additions & 1 deletion UnitySDK/Assets/TiltBrush/Scripts/BrushDescriptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public enum Semantic {
XyIsUvZIsDistance,
UnitlessVector,
XyIsUv,
Timestamp,
}

public Material Material { get { return m_Material; } }
Expand Down
Loading

0 comments on commit 9ead5bb

Please sign in to comment.