Skip to content

Commit a48de31

Browse files
authored
Update lots of shaders to singlepass (#677)
* up to E on brush resources/brushes/basic * rest of brush shaders * FXAA * Still use multipass, let's just commit shaders
1 parent ee2c821 commit a48de31

File tree

123 files changed

+1203
-92
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+1203
-92
lines changed

Assets/Resources/Brushes/Basic/Bubbles/Bubbles.shader

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ Category {
5252
float4 vertex : SV_POSITION;
5353
fixed4 color : COLOR;
5454
float2 texcoord : TEXCOORD0;
55+
56+
UNITY_VERTEX_OUTPUT_STEREO
5557
};
5658

5759
float4 _MainTex_ST;
@@ -81,6 +83,11 @@ Category {
8183

8284
v2f vert (ParticleVertexWithSpread_t v) {
8385
v2f o;
86+
87+
UNITY_SETUP_INSTANCE_ID(v);
88+
UNITY_INITIALIZE_OUTPUT(v2f, o);
89+
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
90+
8491
v.color = TbVertToSrgb(v.color);
8592
float birthTime = v.texcoord.w;
8693
float rotation = v.texcoord.z;

Assets/Resources/Brushes/Basic/CelVinyl/CelVinyl.shader

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,17 @@ Shader "Brush/Special/CelVinyl" {
4646
float4 vertex : POSITION;
4747
float2 texcoord : TEXCOORD0;
4848
float4 color : COLOR;
49+
50+
UNITY_VERTEX_INPUT_INSTANCE_ID
4951
};
5052

5153
struct v2f {
5254
float4 pos : POSITION;
5355
float2 texcoord : TEXCOORD0;
5456
float4 color : COLOR;
5557
UNITY_FOG_COORDS(1)
58+
59+
UNITY_VERTEX_OUTPUT_STEREO
5660
};
5761

5862
v2f vert (appdata_t v)
@@ -61,6 +65,10 @@ Shader "Brush/Special/CelVinyl" {
6165

6266
v2f o;
6367

68+
UNITY_SETUP_INSTANCE_ID(v);
69+
UNITY_INITIALIZE_OUTPUT(v2f, o);
70+
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
71+
6472
o.pos = UnityObjectToClipPos(v.vertex);
6573
o.texcoord = v.texcoord;
6674
o.color = TbVertToNative(v.color);

Assets/Resources/Brushes/Basic/ChromaticWave/ChromaticWave.shader

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,29 @@ Category {
5050
float4 vertex : POSITION;
5151
fixed4 color : COLOR;
5252
float2 texcoord : TEXCOORD0;
53+
54+
UNITY_VERTEX_INPUT_INSTANCE_ID
5355
};
5456

5557
struct v2f {
5658
float4 pos : POSITION;
5759
float4 color : COLOR;
5860
float2 texcoord : TEXCOORD0;
5961
float4 unbloomedColor : TEXCOORD1;
62+
63+
UNITY_VERTEX_OUTPUT_STEREO
6064
};
6165

6266
v2f vert (appdata_t v)
6367
{
6468
PrepForOds(v.vertex);
6569
v.color = TbVertToSrgb(v.color);
6670
v2f o;
71+
72+
UNITY_SETUP_INSTANCE_ID(v);
73+
UNITY_INITIALIZE_OUTPUT(v2f, o);
74+
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
75+
6776
o.pos = UnityObjectToClipPos(v.vertex);
6877
o.texcoord = v.texcoord;
6978
o.color = bloomColor(v.color, _EmissionGain);

Assets/Resources/Brushes/Basic/Comet/Comet.shader

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,16 @@ Category {
5454
fixed4 color : COLOR;
5555
float3 normal : NORMAL;
5656
float3 texcoord : TEXCOORD0;
57+
58+
UNITY_VERTEX_INPUT_INSTANCE_ID
5759
};
5860

5961
struct v2f {
6062
float4 pos : POSITION;
6163
fixed4 color : COLOR;
6264
float2 texcoord : TEXCOORD0;
65+
66+
UNITY_VERTEX_OUTPUT_STEREO
6367
};
6468

6569

@@ -68,6 +72,10 @@ Category {
6872
PrepForOds(v.vertex);
6973
v2f o;
7074

75+
UNITY_SETUP_INSTANCE_ID(v);
76+
UNITY_INITIALIZE_OUTPUT(v2f, o);
77+
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
78+
7179
o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex);
7280
o.color = TbVertToNative(v.color);
7381

Assets/Resources/Brushes/Basic/DanceFloor/DanceFloor.shader

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,17 @@ Category {
5151
float2 texcoord : TEXCOORD0;
5252
float4 texcoord1 : TEXCOORD1;
5353
float3 normal : NORMAL;
54+
55+
UNITY_VERTEX_INPUT_INSTANCE_ID
5456
};
5557

5658
struct v2f {
5759
float4 vertex : SV_POSITION;
5860
fixed4 color : COLOR;
5961
float2 texcoord : TEXCOORD0;
6062
float3 worldPos : TEXCOORD1;
63+
64+
UNITY_VERTEX_OUTPUT_STEREO
6165
};
6266

6367
float4 _MainTex_ST;
@@ -66,6 +70,11 @@ Category {
6670
{
6771
PrepForOds(v.vertex);
6872
v2f o;
73+
74+
UNITY_SETUP_INSTANCE_ID(v);
75+
UNITY_INITIALIZE_OUTPUT(v2f, o);
76+
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
77+
6978
float4 worldPos = mul(unity_ObjectToWorld, v.vertex);
7079
float waveform = 0;
7180

Assets/Resources/Brushes/Basic/Dots/Dots.shader

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ Category {
5757
fixed4 color : COLOR;
5858
float2 texcoord : TEXCOORD0;
5959
float waveform : TEXCOORD1;
60+
61+
UNITY_VERTEX_OUTPUT_STEREO
6062
};
6163

6264
float4 _MainTex_ST;
@@ -69,6 +71,11 @@ Category {
6971
{
7072
v.color = TbVertToSrgb(v.color);
7173
v2f o;
74+
75+
UNITY_SETUP_INSTANCE_ID(v);
76+
UNITY_INITIALIZE_OUTPUT(v2f, o);
77+
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
78+
7279
float birthTime = v.texcoord.w;
7380
float rotation = v.texcoord.z;
7481
float halfSize = GetParticleHalfSize(v.corner.xyz, v.center, birthTime);

Assets/Resources/Brushes/Basic/DoubleTaperedMarker/DoubleTaperedMarker.shader

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,17 @@ Category {
4545
fixed4 color : COLOR;
4646
float2 texcoord0 : TEXCOORD0;
4747
float3 texcoord1 : TEXCOORD1; //per vert offset vector
48+
49+
UNITY_VERTEX_INPUT_INSTANCE_ID
4850
};
4951

5052
struct v2f {
5153
float4 pos : POSITION;
5254
fixed4 color : COLOR;
5355
float2 texcoord : TEXCOORD0;
5456
UNITY_FOG_COORDS(1)
57+
58+
UNITY_VERTEX_OUTPUT_STEREO
5559
};
5660

5761
v2f vert (appdata_t v)
@@ -63,6 +67,11 @@ Category {
6367
//
6468

6569
v2f o;
70+
71+
UNITY_SETUP_INSTANCE_ID(v);
72+
UNITY_INITIALIZE_OUTPUT(v2f, o);
73+
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
74+
6675
float envelope = sin(v.texcoord0.x * 3.14159);
6776
float widthMultiplier = 1 - envelope;
6877
v.vertex.xyz += -v.texcoord1 * widthMultiplier;

Assets/Resources/Brushes/Basic/Electricity/Electricity.shader

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ CGINCLUDE
4040
float3 tangent : TANGENT;
4141
float2 texcoord0 : TEXCOORD0;
4242
float3 texcoord1 : TEXCOORD1;
43+
44+
UNITY_VERTEX_INPUT_INSTANCE_ID
4345
};
4446

4547
sampler2D _MainTex;
@@ -50,6 +52,8 @@ CGINCLUDE
5052
float4 vertex : POSITION;
5153
fixed4 color : COLOR;
5254
float2 texcoord : TEXCOORD0;
55+
56+
UNITY_VERTEX_OUTPUT_STEREO
5357
};
5458

5559
float3 displacement(float3 pos, float mod) {
@@ -77,6 +81,11 @@ CGINCLUDE
7781
PrepForOds(v.vertex);
7882
v.color = TbVertToSrgb(v.color);
7983
v2f o;
84+
85+
UNITY_SETUP_INSTANCE_ID(v);
86+
UNITY_INITIALIZE_OUTPUT(v2f, o);
87+
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
88+
8089
float envelope = sin(v.texcoord0.x * (3.14159));
8190
float envelopePow = (1-pow(1 - envelope, 10));
8291

Assets/Resources/Brushes/Basic/Embers/Embers.shader

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ Category {
5757
float4 vertex : SV_POSITION;
5858
fixed4 color : COLOR;
5959
float2 texcoord : TEXCOORD0;
60+
61+
UNITY_VERTEX_OUTPUT_STEREO
6062
};
6163

6264
float4 _MainTex_ST;
@@ -103,6 +105,11 @@ Category {
103105
v2f vert (ParticleVertexWithSpread_t v) {
104106
v.color = TbVertToSrgb(v.color);
105107
v2f o;
108+
109+
UNITY_SETUP_INSTANCE_ID(v);
110+
UNITY_INITIALIZE_OUTPUT(v2f, o);
111+
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
112+
106113
// Used as a random-ish seed for various calculations
107114
float seed = v.color.a;
108115
float t01 = fmod(_Time.y*_ScrollRate + seed * 10, 1);

Assets/Resources/Brushes/Basic/Fire/Fire.shader

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ Category {
5858
float2 texcoord : TEXCOORD0;
5959
#endif
6060
float3 worldPos : TEXCOORD1;
61+
62+
UNITY_VERTEX_INPUT_INSTANCE_ID
6163
};
6264

6365
struct v2f {
@@ -69,6 +71,8 @@ Category {
6971
float2 texcoord : TEXCOORD0;
7072
#endif
7173
float3 worldPos : TEXCOORD1;
74+
75+
UNITY_VERTEX_OUTPUT_STEREO
7276
};
7377

7478
float4 _MainTex_ST;
@@ -82,6 +86,11 @@ Category {
8286
PrepForOds(v.vertex);
8387
v.color = TbVertToSrgb(v.color);
8488
v2f o;
89+
90+
UNITY_SETUP_INSTANCE_ID(v);
91+
UNITY_INITIALIZE_OUTPUT(v2f, o);
92+
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
93+
8594
o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex);
8695
o.color = bloomColor(v.color, _EmissionGain);
8796
o.pos = UnityObjectToClipPos(v.vertex);

0 commit comments

Comments
 (0)