Skip to content

Commit ae6e90f

Browse files
committed
fixed formatting, removed upgrade comments, added standard license lines and move Example shaders to the proper namespace.
1 parent 5f78dc9 commit ae6e90f

File tree

3 files changed

+64
-58
lines changed

3 files changed

+64
-58
lines changed

Assets/HoloToolkit-Examples/Prototyping/Shaders/UnlitTransparentTriplanar.shader

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld'
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See LICENSE in the project root for license information.
23

3-
Shader "HoloToolkit/UnlitTransparentTriplanar"
4+
///
5+
/// Simple vertex shader that blends static lighting and camera lighting.
6+
///
7+
Shader "HoloToolkit/Examples/UnlitTransparentTriplanar"
48
{
59
Properties
610
{

Assets/HoloToolkit-Examples/Prototyping/Shaders/UnlitTriplanar.shader

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
// Upgrade NOTE: replaced 'UNITY_INSTANCE_ID' with 'UNITY_VERTEX_INPUT_INSTANCE_ID'
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See LICENSE in the project root for license information.
23

3-
// Upgrade NOTE: replaced 'UNITY_INSTANCE_ID' with 'UNITY_VERTEX_INPUT_INSTANCE_ID'
4-
5-
// Upgrade NOTE: replaced 'UNITY_INSTANCE_ID' with 'UNITY_VERTEX_INPUT_INSTANCE_ID'
6-
7-
// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld'
8-
9-
Shader "HoloToolkit/UnlitTriplanar"
4+
///
5+
/// Simple vertex shader that blends static lighting and camera lighting.
6+
///
7+
Shader "HoloToolkit/Examples/UnlitTriplanar"
108
{
119
Properties
1210
{

Assets/HoloToolkit/UI/Shaders/3DTextShader.shader

Lines changed: 52 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
// Upgrade NOTE: replaced 'UNITY_INSTANCE_ID' with 'UNITY_VERTEX_INPUT_INSTANCE_ID'
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See LICENSE in the project root for license information.
23

4+
///
5+
/// Basic 3D Text shader with proper z-shorting
6+
///
37
Shader "HoloToolkit/3DTextShader"
48
{
59
Properties
@@ -48,59 +52,59 @@ Shader "HoloToolkit/3DTextShader"
4852
Pass
4953
{
5054
CGPROGRAM
51-
#pragma vertex vert
52-
#pragma fragment frag
53-
#pragma multi_compile_instancing
54-
#include "UnityCG.cginc"
55+
#pragma vertex vert
56+
#pragma fragment frag
57+
#pragma multi_compile_instancing
58+
#include "UnityCG.cginc"
5559

56-
struct appdata_t
57-
{
58-
float4 vertex : POSITION;
59-
half4 color : COLOR;
60-
float2 texcoord : TEXCOORD0;
61-
UNITY_VERTEX_INPUT_INSTANCE_ID
62-
};
60+
struct appdata_t
61+
{
62+
float4 vertex : POSITION;
63+
half4 color : COLOR;
64+
float2 texcoord : TEXCOORD0;
65+
UNITY_VERTEX_INPUT_INSTANCE_ID
66+
};
6367

64-
struct v2f
65-
{
66-
float4 vertex : POSITION;
67-
half4 color : COLOR;
68-
float2 texcoord : TEXCOORD0;
69-
UNITY_VERTEX_INPUT_INSTANCE_ID
70-
UNITY_VERTEX_OUTPUT_STEREO
68+
struct v2f
69+
{
70+
float4 vertex : POSITION;
71+
half4 color : COLOR;
72+
float2 texcoord : TEXCOORD0;
73+
UNITY_VERTEX_INPUT_INSTANCE_ID
74+
UNITY_VERTEX_OUTPUT_STEREO
7175

72-
};
76+
};
7377

74-
sampler2D _MainTex;
75-
float4 _MainTex_ST;
76-
UNITY_INSTANCING_CBUFFER_START(Props)
77-
UNITY_DEFINE_INSTANCED_PROP(fixed4, _Color)
78-
UNITY_INSTANCING_CBUFFER_END
78+
sampler2D _MainTex;
79+
float4 _MainTex_ST;
80+
UNITY_INSTANCING_CBUFFER_START(Props)
81+
UNITY_DEFINE_INSTANCED_PROP(fixed4, _Color)
82+
UNITY_INSTANCING_CBUFFER_END
7983

80-
v2f vert (appdata_t v)
81-
{
82-
v2f o;
83-
UNITY_SETUP_INSTANCE_ID(v);
84-
UNITY_TRANSFER_INSTANCE_ID(v, o);
85-
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
86-
o.vertex = UnityObjectToClipPos(v.vertex);
87-
o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
88-
o.color = v.color;
89-
#ifdef UNITY_HALF_TEXEL_OFFSET
90-
o.vertex.xy += (_ScreenParams.zw-1.0)*float2(-1,1);
91-
#endif
92-
return o;
93-
}
84+
v2f vert (appdata_t v)
85+
{
86+
v2f o;
87+
UNITY_SETUP_INSTANCE_ID(v);
88+
UNITY_TRANSFER_INSTANCE_ID(v, o);
89+
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
90+
o.vertex = UnityObjectToClipPos(v.vertex);
91+
o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
92+
o.color = v.color;
93+
#ifdef UNITY_HALF_TEXEL_OFFSET
94+
o.vertex.xy += (_ScreenParams.zw-1.0)*float2(-1,1);
95+
#endif
96+
return o;
97+
}
9498

95-
half4 frag (v2f i) : COLOR
96-
{
97-
UNITY_SETUP_INSTANCE_ID(i);
98-
half4 col = i.color;
99-
col.a *= tex2D(_MainTex, i.texcoord).a;
100-
col = col * UNITY_ACCESS_INSTANCED_PROP(_Color);
101-
clip (col.a - 0.01);
102-
return col;
103-
}
99+
half4 frag (v2f i) : COLOR
100+
{
101+
UNITY_SETUP_INSTANCE_ID(i);
102+
half4 col = i.color;
103+
col.a *= tex2D(_MainTex, i.texcoord).a;
104+
col = col * UNITY_ACCESS_INSTANCED_PROP(_Color);
105+
clip (col.a - 0.01);
106+
return col;
107+
}
104108
ENDCG
105109
}
106110
}

0 commit comments

Comments
 (0)