diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/AllBrushes.asset b/UnitySDK/Assets/TiltBrush/Assets/Brushes/AllBrushes.asset index e609df3e..be4eecba 100644 --- a/UnitySDK/Assets/TiltBrush/Assets/Brushes/AllBrushes.asset +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/AllBrushes.asset @@ -55,3 +55,6 @@ MonoBehaviour: - {fileID: 11400000, guid: 5398e778cce3fdf469bbfa388aa46d5d, type: 2} - {fileID: 11400000, guid: ebe8a9d99afbd6b46909ea24a9896258, type: 2} - {fileID: 11400000, guid: 3a72bd3c1fe3d784ab8896ec9fdfd058, type: 2} + - {fileID: 11400000, guid: 71dc5ead67382b75789dd72c8058d553, type: 2} + - {fileID: 11400000, guid: 185ca6407d6d6095e95d6695d994a12b, type: 2} + - {fileID: 11400000, guid: d6f6de76308b4b05386f187491479d94, type: 2} diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Bubbles/Bubbles.shader b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Bubbles/Bubbles.shader index 69045059..83d28303 100644 --- a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Bubbles/Bubbles.shader +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Bubbles/Bubbles.shader @@ -91,7 +91,7 @@ Category { float3 displacement_OS = mul(unity_WorldToObject, displacement_WS); center.xyz += displacement_OS; float4 corner = OrientParticle(center.xyz, halfSize, v.vid, rotation); - o.vertex = mul(UNITY_MATRIX_MVP, corner); + o.vertex = UnityObjectToClipPos(corner); // Brighten up the bubbles o.color = v.color; diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/ChromaticWave/ChromaticWave.shader b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/ChromaticWave/ChromaticWave.shader index 08ebafd7..207c3651 100644 --- a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/ChromaticWave/ChromaticWave.shader +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/ChromaticWave/ChromaticWave.shader @@ -59,7 +59,7 @@ Category { { v.color = TbVertToSrgb(v.color); v2f o; - o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); + o.vertex = UnityObjectToClipPos(v.vertex); o.texcoord = v.texcoord; o.color = bloomColor(v.color, _EmissionGain); o.unbloomedColor = v.color; diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Dots/Dots.shader b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Dots/Dots.shader index fdf5a3a1..0aa7258b 100644 --- a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Dots/Dots.shader +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Dots/Dots.shader @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld' - Shader "Brush/Visualizer/Dots" { Properties { _TintColor ("Tint Color", Color) = (0.5,0.5,0.5,0.5) @@ -82,7 +80,7 @@ Category { dispVec.xyz += waveform * _WaveformIntensity.xyz; corner = corner + dispVec; #endif - o.vertex = mul(UNITY_MATRIX_MVP, corner); + o.vertex = UnityObjectToClipPos(corner); o.color = v.color * _BaseGain; o.texcoord = TRANSFORM_TEX(v.texcoord.xy,_MainTex); o.waveform = waveform * 15; diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/DoubleTaperedMarker/DoubleTaperedMarker.shader b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/DoubleTaperedMarker/DoubleTaperedMarker.shader index 95a1b8db..195dc7e4 100644 --- a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/DoubleTaperedMarker/DoubleTaperedMarker.shader +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/DoubleTaperedMarker/DoubleTaperedMarker.shader @@ -61,7 +61,7 @@ Category { float envelope = sin(v.texcoord0.x * 3.14159); float widthMultiplier = 1 - envelope; v.vertex.xyz += -v.texcoord1 * widthMultiplier; - o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); + o.vertex = UnityObjectToClipPos(v.vertex); o.color = TbVertToNative(v.color); o.texcoord = v.texcoord0; UNITY_TRANSFER_FOG(o, o.vertex); diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Electricity/Electricity.shader b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Electricity/Electricity.shader index 330eecb0..172db8fc 100644 --- a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Electricity/Electricity.shader +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Electricity/Electricity.shader @@ -89,7 +89,7 @@ CGINCLUDE // This adds curl noise v.vertex.xyz += disp * _DisplacementIntensity * envelopePow; - o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); + o.vertex = UnityObjectToClipPos(v.vertex); o.color = bloomColor(v.color, _EmissionGain); o.texcoord = v.texcoord0; diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Embers/Embers.shader b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Embers/Embers.shader index 03060a95..e5d1edb1 100644 --- a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Embers/Embers.shader +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Embers/Embers.shader @@ -130,7 +130,7 @@ Category { // Note that we assume object space == canvas space (which it is, for TB) center = center + float4(disp.xyz, 0); float4 corner = OrientParticle(center.xyz, halfSize, v.vid, rotation); - o.vertex = mul(UNITY_MATRIX_MVP, corner); + o.vertex = UnityObjectToClipPos(corner); #endif o.color = v.color; diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Fire/Fire.shader b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Fire/Fire.shader index 17bd6c36..16b076c3 100644 --- a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Fire/Fire.shader +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Fire/Fire.shader @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld' - Shader "Brush/Special/Fire" { Properties { _MainTex ("Particle Texture", 2D) = "white" {} @@ -73,7 +71,7 @@ Category { v2f o; o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); o.color = bloomColor(v.color, _EmissionGain); - o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); + o.vertex = UnityObjectToClipPos(v.vertex); o.worldPos = mul(unity_ObjectToWorld, v.vertex); return o; } diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Highlighter/AdditiveCutout.shader b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Highlighter/AdditiveCutout.shader index 9537d8a9..166621b8 100644 --- a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Highlighter/AdditiveCutout.shader +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Highlighter/AdditiveCutout.shader @@ -57,7 +57,7 @@ Category { { v2f o; - o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); + o.vertex = UnityObjectToClipPos(v.vertex); o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); o.color = TbVertToNative(v.color); return o; diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/HyperGrid/HyperGrid.shader b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/HyperGrid/HyperGrid.shader index 15f8e960..19474872 100644 --- a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/HyperGrid/HyperGrid.shader +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/HyperGrid/HyperGrid.shader @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld' - Shader "Brush/Special/HyperGrid" { Properties { _TintColor ("Tint Color", Color) = (0.5,0.5,0.5,0.5) diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Plasma/Plasma.shader b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Plasma/Plasma.shader index 8afd12e8..6700c3ee 100644 --- a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Plasma/Plasma.shader +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Plasma/Plasma.shader @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld' - Shader "Brush/Special/Plasma" { Properties { _MainTex ("Particle Texture", 2D) = "white" {} @@ -80,7 +78,7 @@ Category { v2f o; o.worldPos = mul(unity_ObjectToWorld, v.vertex); - o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); + o.vertex = UnityObjectToClipPos(v.vertex); o.color = v.color; o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); return o; diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Rainbow/Rainbow.shader b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Rainbow/Rainbow.shader index 1c9c16c4..648b4f8d 100644 --- a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Rainbow/Rainbow.shader +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Rainbow/Rainbow.shader @@ -61,7 +61,7 @@ Category { v.color = TbVertToSrgb(v.color); v2f o; - o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); + o.vertex = UnityObjectToClipPos(v.vertex); o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); o.color = v.color; return o; diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/SoftHighlighter/SoftHighlighter.shader b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/SoftHighlighter/SoftHighlighter.shader index 3ac7d78b..e2b6161c 100644 --- a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/SoftHighlighter/SoftHighlighter.shader +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/SoftHighlighter/SoftHighlighter.shader @@ -66,7 +66,7 @@ Category { #else o.color = TbVertToNative(v.color); #endif - o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); + o.vertex = UnityObjectToClipPos(v.vertex); return o; diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Stars/Stars.shader b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Stars/Stars.shader index 6b450dd8..ee993d5b 100644 --- a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Stars/Stars.shader +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Stars/Stars.shader @@ -78,7 +78,7 @@ Category { o.texcoord = TRANSFORM_TEX(v.texcoord.xy,_MainTex); float4 corner = OrientParticle(center.xyz, halfSize, v.vid, rotation); - o.vertex = mul(UNITY_MATRIX_MVP, corner); + o.vertex = UnityObjectToClipPos(corner); return o; } diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Streamers/Streamers.shader b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Streamers/Streamers.shader index a8b3d3af..8353d058 100644 --- a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Streamers/Streamers.shader +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Streamers/Streamers.shader @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld' - Shader "Brush/Special/Streamers" { Properties { _MainTex ("Particle Texture", 2D) = "white" {} @@ -73,7 +71,7 @@ Category { v2f o; o.worldPos = mul(unity_ObjectToWorld, v.vertex); - o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); + o.vertex = UnityObjectToClipPos(v.vertex); o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); o.color = v.color; return o; diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Toon/Toon.shader b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Toon/Toon.shader index 7fb6a684..73efff32 100644 --- a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Toon/Toon.shader +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Toon/Toon.shader @@ -65,9 +65,8 @@ CGINCLUDE // Technically these are not yet in NDC because they haven't been divided by W, so their // range is currently [-W, W]. - o.vertex = mul(UNITY_MATRIX_MVP, float4(v.vertex.xyz + v.normal.xyz * bulge, v.vertex.w)); - float4 outline_NDC = mul(UNITY_MATRIX_MVP, - float4(v.vertex.xyz + v.normal.xyz * inflate, v.vertex.w)); + o.vertex = UnityObjectToClipPos(float4(v.vertex.xyz + v.normal.xyz * bulge, v.vertex.w)); + float4 outline_NDC = UnityObjectToClipPos(float4(v.vertex.xyz + v.normal.xyz * inflate, v.vertex.w)); // Displacement in proper NDC coords (e.g. [-1, 1]) float3 disp = outline_NDC.xyz / outline_NDC.w - o.vertex.xyz / o.vertex.w; diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/VelvetInk/VelvetInk.shader b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/VelvetInk/VelvetInk.shader index cb457c64..db2dd2b3 100644 --- a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/VelvetInk/VelvetInk.shader +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/VelvetInk/VelvetInk.shader @@ -66,7 +66,7 @@ Category { #else o.color = TbVertToNative(v.color); #endif - o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); + o.vertex = UnityObjectToClipPos(v.vertex); return o; } diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Waveform/Waveform.shader b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Waveform/Waveform.shader index ee4e467a..f278ce1c 100644 --- a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Waveform/Waveform.shader +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Waveform/Waveform.shader @@ -62,7 +62,7 @@ Category { v.color = TbVertToSrgb(v.color); v2f o; - o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); + o.vertex = UnityObjectToClipPos(v.vertex); o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); o.color = bloomColor(v.color, _EmissionGain); o.unbloomedColor = v.color; diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks.meta b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks.meta new file mode 100644 index 00000000..5c999ab8 --- /dev/null +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: d086c32b105e6ae4e82b91075e02682a +folderAsset: yes +timeCreated: 1507248510 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksGem.meta b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksGem.meta new file mode 100644 index 00000000..c14397dd --- /dev/null +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksGem.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 7510be7e36a9313459cd08af1865366b +folderAsset: yes +timeCreated: 1507248510 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksGem/BlocksGem.asset b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksGem/BlocksGem.asset new file mode 100644 index 00000000..0a94a0e6 --- /dev/null +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksGem/BlocksGem.asset @@ -0,0 +1,25 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 103cd3480fe93f646be28a7da5812871, type: 3} + m_Name: BlocksGem + m_EditorClassIdentifier: + m_Guid: + m_storage: 232998f8-d357-47a2-993a-53415df9be10 + m_DurableName: BlocksGem + m_Material: {fileID: 2100000, guid: 232998f8d35747a2993a53415df9be10, type: 2} + m_IsParticle: 0 + m_uv0Size: 0 + m_uv0Semantic: 0 + m_uv1Size: 0 + m_uv1Semantic: 0 + m_bUseNormals: 1 + m_normalSemantic: 0 + m_bFbxExportNormalAsTexcoord1: 0 diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksGem/BlocksGem.asset.meta b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksGem/BlocksGem.asset.meta new file mode 100644 index 00000000..3c851ae4 --- /dev/null +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksGem/BlocksGem.asset.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 71dc5ead67382b75789dd72c8058d553 +timeCreated: 1507250767 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksGem/BlocksGem.mat b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksGem/BlocksGem.mat new file mode 100644 index 00000000..fa054e97 --- /dev/null +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksGem/BlocksGem.mat @@ -0,0 +1,160 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: BlocksGem + m_Shader: {fileID: 4800000, guid: cd72ccec010118e44bcae69ab6186eb4, type: 3} + m_ShaderKeywords: _EMISSION + m_LightmapFlags: 1 + m_CustomRenderQueue: -1 + stringTagMap: {} + m_SavedProperties: + serializedVersion: 2 + m_TexEnvs: + - first: + name: _BumpMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _DetailAlbedoMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _DetailMask + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _DetailNormalMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _EmissionMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _MainTex + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _MetallicGlossMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _OcclusionMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _ParallaxMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - first: + name: _Amp + second: 2.5 + - first: + name: _BumpScale + second: 1 + - first: + name: _Cutoff + second: 0.5 + - first: + name: _DetailNormalMapScale + second: 1 + - first: + name: _DstBlend + second: 0 + - first: + name: _FacetSize + second: 0.05 + - first: + name: _Frequency + second: 2 + - first: + name: _Gain + second: 0 + - first: + name: _GlossMapScale + second: 1 + - first: + name: _Glossiness + second: 0.8 + - first: + name: _GlossyReflections + second: 1 + - first: + name: _Jitter + second: 1 + - first: + name: _Lacunarity + second: 0 + - first: + name: _Metallic + second: 0.853 + - first: + name: _Mode + second: 0 + - first: + name: _OcclusionStrength + second: 1 + - first: + name: _Parallax + second: 0.02 + - first: + name: _RimIntensity + second: 0.5 + - first: + name: _RimPower + second: 2 + - first: + name: _Shininess + second: 0.9 + - first: + name: _SmoothnessTextureChannel + second: 0 + - first: + name: _SpecularHighlights + second: 1 + - first: + name: _SrcBlend + second: 1 + - first: + name: _Transmission + second: 0.357 + - first: + name: _UVSec + second: 0 + - first: + name: _ZWrite + second: 1 + m_Colors: + - first: + name: _Color + second: {r: 1, g: 1, b: 1, a: 1} + - first: + name: _EmissionColor + second: {r: 0, g: 0, b: 0, a: 1} + - first: + name: _SpecColor + second: {r: 0.5, g: 0.5, b: 0.5, a: 0} diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksGem/BlocksGem.mat.meta b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksGem/BlocksGem.mat.meta new file mode 100644 index 00000000..c70c1362 --- /dev/null +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksGem/BlocksGem.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 232998f8d35747a2993a53415df9be10 +timeCreated: 1502926363 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksGem/BlocksGem.shader b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksGem/BlocksGem.shader new file mode 100644 index 00000000..de5c17da --- /dev/null +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksGem/BlocksGem.shader @@ -0,0 +1,171 @@ +// Copyright 2017 Google Inc. +// +// 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. + +// +// Tilt Brush variant of the Blocks gem shader +// +Shader "Blocks/BlocksGem" { + Properties { + _Color ("Color", Color) = (1,1,1,1) + _BumpMap ("Normal Map", 2D) = "bump" {} + _Shininess ("Shininess", Range(0,1)) = 0.8 + _RimIntensity ("Rim Intensity", Range(0,1)) = .2 + _RimPower ("Rim Power", Range(0,16)) = 5 + _Frequency ("Frequency", Float) = 1 + _Jitter ("Jitter", Float) = 1 + } + + SubShader { + + // + // Voronoi implementation taken from + // https://github.com/Scrawk/GPU-Voronoi-Noise + // (MIT License) + // + + Tags { "RenderType"="Transparent" "Queue"="Transparent"} + LOD 200 + + Blend One SrcAlpha + Zwrite Off + Cull Back + + CGPROGRAM + #pragma surface surf StandardSpecular vertex:vert fullforwardshadows nofog + #pragma target 3.0 + #include "../../../Shaders/Include/Brush.cginc" + + uniform float _Frequency; + uniform float _Jitter; + + //1/7 + #define K 0.142857142857 + //3/7 + #define Ko 0.428571428571 + + #define OCTAVES 1 + + float3 mod(float3 x, float y) { return x - y * floor(x/y); } + float2 mod(float2 x, float y) { return x - y * floor(x/y); } + + // Permutation polynomial: (34x^2 + x) mod 289 + float3 Permutation(float3 x) + { + return mod((34.0 * x + 1.0) * x, 289.0); + } + + float2 inoise(float3 P, float jitter) + { + float3 Pi = mod(floor(P), 289.0); + float3 Pf = frac(P); + float3 oi = float3(-1.0, 0.0, 1.0); + float3 of = float3(-0.5, 0.5, 1.5); + float3 px = Permutation(Pi.x + oi); + float3 py = Permutation(Pi.y + oi); + + float3 p, ox, oy, oz, dx, dy, dz; + float2 F = 1e6; + + for(int i = 0; i < 3; i++) { + for(int j = 0; j < 3; j++) { + p = Permutation(px[i] + py[j] + Pi.z + oi); // pij1, pij2, pij3 + + ox = frac(p*K) - Ko; + oy = mod(floor(p*K),7.0)*K - Ko; + + p = Permutation(p); + + oz = frac(p*K) - Ko; + + dx = Pf.x - of[i] + jitter*ox; + dy = Pf.y - of[j] + jitter*oy; + dz = Pf.z - of + jitter*oz; + + float3 d = dx * dx + dy * dy + dz * dz; // dij1, dij2 and dij3, squared + + //Find lowest and second lowest distances + for(int n = 0; n < 3; n++) { + if(d[n] < F[0]) { + F[1] = F[0]; + F[0] = d[n]; + } else if(d[n] < F[1]) { + F[1] = d[n]; + } + } + } + } + return F; + } + + // fractal sum, range -1.0 - 1.0 + float2 fBm_F0(float3 p, int octaves) + { + float freq = _Frequency, amp = 0.5; + float2 F = inoise(p * freq, _Jitter) * amp; + return F; + } + + struct Input { + float2 uv_MainTex; + float2 uv_BumpMap; + float3 localPos; + float3 worldRefl; + float3 viewDir; + + INTERNAL_DATA + }; + + half _Shininess; + half _RimIntensity; + half _RimPower; + fixed4 _Color; + sampler2D _BumpMap; + + void vert (inout appdata_full v, out Input o) { + UNITY_INITIALIZE_OUTPUT(Input,o); + o.localPos = v.vertex.xyz; + } + + void surf(Input IN, inout SurfaceOutputStandardSpecular o) { + + float2 F = fBm_F0(IN.localPos, OCTAVES); + float gem = (F.y - F.x); + + // Perturb normal with voronoi cells + // Hack to convert normal to tangent space. _Bump map is actually null. + o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); + half perturbIntensity = 10; + o.Normal.x += ddy(gem) * perturbIntensity; + o.Normal.y += ddx(gem) * perturbIntensity; + o.Normal = normalize(o.Normal); + + o.Albedo = 0; + + // Artifical diffraction highlights to simulate what I see in blocks. Tuned to taste. + half3 refl = clamp(WorldReflectionVector (IN, o.Normal) + gem, -1.0,1.0); + float3 colorRamp = float3(1,.3,0)*sin(refl.x * 30) + float3(0,1,.5)*cos(refl.y * 37.77) + float3(0,0,1)*sin(refl.z*43.33); + + // Use the voronoi for a specular mask + half mask = saturate((1 - gem) + .25); + o.Specular = _Color.rgb + colorRamp*.1; + o.Smoothness = _Shininess; + + // Artificial rim lighting + o.Emission = (pow(1 - saturate(dot(IN.viewDir, o.Normal)), _RimPower)) * _RimIntensity; + } + ENDCG +} // end subshader + + FallBack "Diffuse" +} // end shader diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksGem/BlocksGem.shader.meta b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksGem/BlocksGem.shader.meta new file mode 100644 index 00000000..25e2cc13 --- /dev/null +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksGem/BlocksGem.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: cd72ccec010118e44bcae69ab6186eb4 +timeCreated: 1503342700 +licenseType: Pro +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksGlass.meta b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksGlass.meta new file mode 100644 index 00000000..d073b5b6 --- /dev/null +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksGlass.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 61428f4e95dd6a74cbb57d9b3a31228e +folderAsset: yes +timeCreated: 1507248510 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksGlass/BlocksGlass.asset b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksGlass/BlocksGlass.asset new file mode 100644 index 00000000..3d71b3f6 --- /dev/null +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksGlass/BlocksGlass.asset @@ -0,0 +1,25 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 103cd3480fe93f646be28a7da5812871, type: 3} + m_Name: BlocksGlass + m_EditorClassIdentifier: + m_Guid: + m_storage: 3d813d82-5839-4450-8ddc-8e889ecd96c7 + m_DurableName: BlocksGlass + m_Material: {fileID: 2100000, guid: 3d813d82583944508ddc8e889ecd96c7, type: 2} + m_IsParticle: 0 + m_uv0Size: 0 + m_uv0Semantic: 0 + m_uv1Size: 0 + m_uv1Semantic: 0 + m_bUseNormals: 1 + m_normalSemantic: 0 + m_bFbxExportNormalAsTexcoord1: 0 diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksGlass/BlocksGlass.asset.meta b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksGlass/BlocksGlass.asset.meta new file mode 100644 index 00000000..70391061 --- /dev/null +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksGlass/BlocksGlass.asset.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 185ca6407d6d6095e95d6695d994a12b +timeCreated: 1507250768 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksGlass/BlocksGlass.mat b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksGlass/BlocksGlass.mat new file mode 100644 index 00000000..3287f3ff --- /dev/null +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksGlass/BlocksGlass.mat @@ -0,0 +1,148 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: BlocksGlass + m_Shader: {fileID: 4800000, guid: 7fbe2fe7dc7c2a64a9b2abac67b85b54, type: 3} + m_ShaderKeywords: _EMISSION + m_LightmapFlags: 1 + m_CustomRenderQueue: -1 + stringTagMap: {} + m_SavedProperties: + serializedVersion: 2 + m_TexEnvs: + - first: + name: _BumpMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _DetailAlbedoMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _DetailMask + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _DetailNormalMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _EmissionMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _MainTex + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _MetallicGlossMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _Noise + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _OcclusionMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _ParallaxMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - first: + name: _BumpScale + second: 1 + - first: + name: _Cutoff + second: 0.5 + - first: + name: _DetailNormalMapScale + second: 1 + - first: + name: _DstBlend + second: 0 + - first: + name: _GlossMapScale + second: 1 + - first: + name: _Glossiness + second: 0.8 + - first: + name: _GlossyReflections + second: 1 + - first: + name: _Metallic + second: 0 + - first: + name: _Mode + second: 0 + - first: + name: _OcclusionStrength + second: 1 + - first: + name: _Parallax + second: 0.02 + - first: + name: _RimIntensity + second: 0.7 + - first: + name: _RimPower + second: 4 + - first: + name: _Shininess + second: 0.8 + - first: + name: _SmoothnessTextureChannel + second: 0 + - first: + name: _SpecularHighlights + second: 1 + - first: + name: _SrcBlend + second: 1 + - first: + name: _Transmission + second: 0.5 + - first: + name: _UVSec + second: 0 + - first: + name: _ZWrite + second: 1 + m_Colors: + - first: + name: _Color + second: {r: 1, g: 1, b: 1, a: 1} + - first: + name: _EmissionColor + second: {r: 0, g: 0, b: 0, a: 1} + - first: + name: _SpecColor + second: {r: 0.5, g: 0.5, b: 0.5, a: 0} diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksGlass/BlocksGlass.mat.meta b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksGlass/BlocksGlass.mat.meta new file mode 100644 index 00000000..34e36a5c --- /dev/null +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksGlass/BlocksGlass.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3d813d82583944508ddc8e889ecd96c7 +timeCreated: 1502926363 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksGlass/BlocksGlass.shader b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksGlass/BlocksGlass.shader new file mode 100644 index 00000000..bdfbda10 --- /dev/null +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksGlass/BlocksGlass.shader @@ -0,0 +1,70 @@ +// Copyright 2017 Google Inc. +// +// 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. + +// +// Tilt Brush variant of the Blocks glass shader +// +Shader "Blocks/BlocksGlass" { + Properties { + _Color ("Color", Color) = (1,1,1,1) + _Noise ("Noise (RGB)", 2D) = "white" {} + _Shininess ("Shininess", Range(0,1)) = 0.8 + _RimIntensity ("Rim Intensity", Range(0,1)) = .2 + _RimPower ("Rim Power", Range(0,16)) = 5 + } + + SubShader { + + Tags { "RenderType"="Transparent" "Queue"="Transparent"} + LOD 200 + + Blend One SrcAlpha + Zwrite Off + Cull Off + + CGPROGRAM + #pragma surface surf StandardSpecular fullforwardshadows nofog + #pragma target 3.0 + + struct Input { + float null; //not used, but the Input struct can't be empty + float3 viewDir; + fixed vface : VFACE; + }; + + half _Shininess; + half _RimIntensity; + half _RimPower; + fixed4 _Color; + + void surf(Input IN, inout SurfaceOutputStandardSpecular o) { + o.Normal = float3(0,0,IN.vface); + + // Dim Backfaces + float backfaceDimming = IN.vface == -1 ? .25 : 1; + + o.Albedo = 0; + o.Specular = _Color.rgb * backfaceDimming; + + // Rim Lighting + o.Emission = (pow(1 - saturate(dot(IN.viewDir, o.Normal)), _RimPower)) * _RimIntensity * backfaceDimming; + + o.Smoothness = _Shininess; + } + ENDCG + + } + + FallBack "Diffuse" +} diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksGlass/BlocksGlass.shader.meta b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksGlass/BlocksGlass.shader.meta new file mode 100644 index 00000000..ed156348 --- /dev/null +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksGlass/BlocksGlass.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 7fbe2fe7dc7c2a64a9b2abac67b85b54 +timeCreated: 1503342687 +licenseType: Pro +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksPaper.meta b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksPaper.meta new file mode 100644 index 00000000..0d54fad3 --- /dev/null +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksPaper.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 1d86c549a4d4b1e4b909a462189ecdd1 +folderAsset: yes +timeCreated: 1507248510 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksPaper/BlocksPaper.asset b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksPaper/BlocksPaper.asset new file mode 100644 index 00000000..97088397 --- /dev/null +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksPaper/BlocksPaper.asset @@ -0,0 +1,25 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 103cd3480fe93f646be28a7da5812871, type: 3} + m_Name: BlocksPaper + m_EditorClassIdentifier: + m_Guid: + m_storage: 0e87b49c-6546-3a34-3a44-8a556d7d6c3e + m_DurableName: BlocksBasic + m_Material: {fileID: 2100000, guid: 0e87b49c65463a343a448a556d7d6c3e, type: 2} + m_IsParticle: 0 + m_uv0Size: 0 + m_uv0Semantic: 0 + m_uv1Size: 0 + m_uv1Semantic: 0 + m_bUseNormals: 1 + m_normalSemantic: 0 + m_bFbxExportNormalAsTexcoord1: 0 diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksPaper/BlocksPaper.asset.meta b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksPaper/BlocksPaper.asset.meta new file mode 100644 index 00000000..2e5f6920 --- /dev/null +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksPaper/BlocksPaper.asset.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: d6f6de76308b4b05386f187491479d94 +timeCreated: 1507250768 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksPaper/BlocksPaper.mat b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksPaper/BlocksPaper.mat new file mode 100644 index 00000000..647a1bb8 --- /dev/null +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksPaper/BlocksPaper.mat @@ -0,0 +1,133 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: BlocksPaper + m_Shader: {fileID: 4800000, guid: 50d409e7765e3e8489865238cdf646e7, type: 3} + m_ShaderKeywords: _EMISSION + m_LightmapFlags: 1 + m_CustomRenderQueue: -1 + stringTagMap: {} + m_SavedProperties: + serializedVersion: 2 + m_TexEnvs: + - first: + name: _BumpMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _DetailAlbedoMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _DetailMask + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _DetailNormalMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _EmissionMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _MainTex + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _MetallicGlossMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _OcclusionMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _ParallaxMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - first: + name: _BumpScale + second: 1 + - first: + name: _Cutoff + second: 0.5 + - first: + name: _DetailNormalMapScale + second: 1 + - first: + name: _DstBlend + second: 0 + - first: + name: _GlossMapScale + second: 1 + - first: + name: _Glossiness + second: 0.5 + - first: + name: _GlossyReflections + second: 1 + - first: + name: _Metallic + second: 0 + - first: + name: _Mode + second: 0 + - first: + name: _OcclusionStrength + second: 1 + - first: + name: _Parallax + second: 0.02 + - first: + name: _Shininess + second: 0.2 + - first: + name: _SmoothnessTextureChannel + second: 0 + - first: + name: _SpecularHighlights + second: 1 + - first: + name: _SrcBlend + second: 1 + - first: + name: _UVSec + second: 0 + - first: + name: _ZWrite + second: 1 + m_Colors: + - first: + name: _Color + second: {r: 1, g: 1, b: 1, a: 1} + - first: + name: _EmissionColor + second: {r: 0, g: 0, b: 0, a: 1} + - first: + name: _SpecColor + second: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksPaper/BlocksPaper.mat.meta b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksPaper/BlocksPaper.mat.meta new file mode 100644 index 00000000..d4dd7dcf --- /dev/null +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksPaper/BlocksPaper.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0e87b49c65463a343a448a556d7d6c3e +timeCreated: 1502926363 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksPaper/BlocksPaper.shader b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksPaper/BlocksPaper.shader new file mode 100644 index 00000000..f0806f0b --- /dev/null +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksPaper/BlocksPaper.shader @@ -0,0 +1,52 @@ +// Copyright 2017 Google Inc. +// +// 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. + +Shader "Blocks/Basic" { +Properties { + _Color ("Main Color", Color) = (1,1,1,1) + _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 + _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 0) + +} + SubShader { + Cull Back + + CGPROGRAM + #pragma target 3.0 + #pragma surface surf StandardSpecular vertex:vert + #pragma multi_compile __ TBT_LINEAR_TARGET + + #include "../../../Shaders/Include/Brush.cginc" + + struct Input { + float4 color : Color; + }; + + fixed4 _Color; + half _Shininess; + + void vert (inout appdata_full i /*, out Input o*/) { + i.color = TbVertToNative(i.color); + } + + void surf (Input IN, inout SurfaceOutputStandardSpecular o) { + o.Albedo = _Color.rgb * IN.color.rgb; + o.Smoothness = _Shininess; + o.Specular = _SpecColor; + } + ENDCG + } + + FallBack "Diffuse" +} diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksPaper/BlocksPaper.shader.meta b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksPaper/BlocksPaper.shader.meta new file mode 100644 index 00000000..25fc58d9 --- /dev/null +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Blocks/BlocksPaper/BlocksPaper.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 50d409e7765e3e8489865238cdf646e7 +timeCreated: 1426624476 +licenseType: Pro +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Shared/Shaders/Bloom.shader b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Shared/Shaders/Bloom.shader index e7bcd837..6628041a 100644 --- a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Shared/Shaders/Bloom.shader +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Shared/Shaders/Bloom.shader @@ -65,7 +65,7 @@ Category { o.color = musicReactiveColor(o.color, _BeatOutput.y); v.vertex = musicReactiveAnimation(v.vertex, v.color, _BeatOutput.y, o.texcoord.x); #endif - o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); + o.vertex = UnityObjectToClipPos(v.vertex); return o; } diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Shared/Shaders/Unlit.shader b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Shared/Shaders/Unlit.shader index cdaa4df1..fe21daaa 100644 --- a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Shared/Shaders/Unlit.shader +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Shared/Shaders/Unlit.shader @@ -56,7 +56,7 @@ SubShader { v2f o; - o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); + o.vertex = UnityObjectToClipPos(v.vertex); o.texcoord = v.texcoord; o.color = TbVertToNative(v.color); UNITY_TRANSFER_FOG(o, o.vertex); diff --git a/UnitySDK/Assets/TiltBrush/Assets/Shaders/Include/Brush.cginc b/UnitySDK/Assets/TiltBrush/Assets/Shaders/Include/Brush.cginc index 667131b9..485a7e45 100644 --- a/UnitySDK/Assets/TiltBrush/Assets/Shaders/Include/Brush.cginc +++ b/UnitySDK/Assets/TiltBrush/Assets/Shaders/Include/Brush.cginc @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld' -// Upgrade NOTE: replaced '_World2Object' with 'unity_WorldToObject' // -*- c -*- @@ -43,6 +41,7 @@ float4 GetAnimatedSelectionColor( float4 color) { return color + sin(_Time.w*2)*.1 + .2f; } + // // Common for Music Reactive Brushes // diff --git a/UnitySDK/Assets/TiltBrush/Assets/Shaders/Unlit-Diffuse.shader b/UnitySDK/Assets/TiltBrush/Assets/Shaders/Unlit-Diffuse.shader index 2290d6ea..e27aa5bb 100644 --- a/UnitySDK/Assets/TiltBrush/Assets/Shaders/Unlit-Diffuse.shader +++ b/UnitySDK/Assets/TiltBrush/Assets/Shaders/Unlit-Diffuse.shader @@ -48,7 +48,7 @@ SubShader { v2f vert (appdata_t v) { v2f o; - o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); + o.vertex = UnityObjectToClipPos(v.vertex); return o; }