diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Bubbles/Bubbles.shader b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Bubbles/Bubbles.shader index 83d28303..2646b520 100644 --- a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Bubbles/Bubbles.shader +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Bubbles/Bubbles.shader @@ -87,8 +87,8 @@ Category { float4 center = SpreadParticle(v, spreadProgress); float3 displacement_SS = spreadProgress * computeDisplacement(center, 1); - float3 displacement_WS = mul(xf_CS, displacement_SS); - float3 displacement_OS = mul(unity_WorldToObject, displacement_WS); + float3 displacement_WS = mul(xf_CS, float4(displacement_SS, 0)); + float3 displacement_OS = mul(unity_WorldToObject, float4(displacement_WS, 0)); center.xyz += displacement_OS; float4 corner = OrientParticle(center.xyz, halfSize, v.vid, rotation); o.vertex = UnityObjectToClipPos(corner); diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Embers/Embers.shader b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Embers/Embers.shader index e5d1edb1..56ec29bf 100644 --- a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Embers/Embers.shader +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Embers/Embers.shader @@ -121,7 +121,7 @@ Category { // The problem with this is that if you scale up a layer, the particles // get big but the overall motion stays the same. float4 center_WS = mul(unity_ObjectToWorld, center); - center_WS.xyz += mul(xf_CS, disp); + center_WS.xyz += mul(xf_CS, float4(disp, 0)); float4 corner_WS = OrientParticle_WS(center_WS.xyz, halfSize, v.vid, rotation); o.vertex = mul(UNITY_MATRIX_VP, corner_WS); #else diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Fire/Fire.shader b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Fire/Fire.shader index 16b076c3..1432ed1c 100644 --- a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Fire/Fire.shader +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Fire/Fire.shader @@ -48,14 +48,22 @@ Category { float4 vertex : POSITION; fixed4 color : COLOR; float3 normal : NORMAL; +#if SHADER_TARGET >= 40 centroid float2 texcoord : TEXCOORD0; +#else + float2 texcoord : TEXCOORD0; +#endif float3 worldPos : TEXCOORD1; }; struct v2f { float4 vertex : POSITION; float4 color : COLOR; +#if SHADER_TARGET >= 40 centroid float2 texcoord : TEXCOORD0; +#else + float2 texcoord : TEXCOORD0; +#endif float3 worldPos : TEXCOORD1; }; diff --git a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Smoke/Smoke.shader b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Smoke/Smoke.shader index d65935e9..07abbdc2 100644 --- a/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Smoke/Smoke.shader +++ b/UnitySDK/Assets/TiltBrush/Assets/Brushes/Basic/Smoke/Smoke.shader @@ -95,7 +95,7 @@ Category { disp += float3(0,0,1) * curlZ(center_WS.xyz * freq + time, d); disp = disp * 5 * kDecimetersToWorldUnits; - center_WS.xyz += mul(xf_CS, disp); + center_WS.xyz += mul(xf_CS, float4(disp, 0)); float4 corner = OrientParticle_WS(center_WS.xyz, halfSize, v.vid, rotation); o.vertex = mul(UNITY_MATRIX_VP, corner);