Hello Everyone,
I currently use 5 shaders from the above asset. The shaders are absolutely essential with most of the game revolving around them. I’ve unfortunately noticed that while they (the shaders) have been working for years. On newer devices, Samsung Galaxy S24 Ultra - Tab S9 Ultra. The shaders now show up as black, is there any way I could get helping in fixing them as the asset has been abandoned?
Below is the Neon Shader, its the most essential out of all of them:
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
////////////////////////////////////////////
// CameraFilterPack - by VETASOFT 2018 /////
////////////////////////////////////////////
Shader "CameraFilterPack/Edge_Neon_Legacy"
{
Properties
{
_MainTex ("Base (RGB)", 2D) = "white" {}
_TimeX ("Time", Range(0.0, 1.0)) = 1.0
_Distortion ("_Distortion", Range(0.0, 1.0)) = 0.3
_ScreenResolution ("_ScreenResolution", Vector) = (0.,0.,0.,0.)
_EdgeWeight ("_EdgeWeight", Range(1.0, 10.0)) = 1.0
}
SubShader
{
Pass
{
Cull Off ZWrite Off ZTest Always
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma fragmentoption ARB_precision_hint_fastest
#pragma target 3.0
#include "UnityCG.cginc"
uniform sampler2D _MainTex;
uniform float _TimeX;
uniform float _Distortion;
uniform float4 _ScreenResolution;
uniform float _EdgeWeight;
struct appdata_t
{
float4 vertex : POSITION;
float4 color : COLOR;
float2 texcoord : TEXCOORD0;
};
struct v2f
{
float2 texcoord : TEXCOORD0;
float4 vertex : SV_POSITION;
float4 color : COLOR;
};
v2f vert(appdata_t IN)
{
v2f OUT;
OUT.vertex = UnityObjectToClipPos(IN.vertex);
OUT.texcoord = IN.texcoord;
OUT.color = IN.color;
return OUT;
}
half4 _MainTex_ST;
float4 frag(v2f i) : COLOR
{
float2 uvst = UnityStereoScreenSpaceUVAdjust(i.texcoord, _MainTex_ST);
float2 uv = uvst.xy;
float offset = 1.0 / (_EdgeWeight * 100);
float3 o = float3(-offset, 0.0, offset);
float4 gx = 0.0;
float4 gy = 0.0;
float4 t;
gx += tex2D(_MainTex, uv + o.xz);
gy += gx;
gx += 2.0*tex2D(_MainTex, uv + o.xy);
t = tex2D(_MainTex, uv + o.xx);
gx += t;
gy -= t;
gy += 2.0*tex2D(_MainTex, uv + o.yz);
gy -= 2.0*tex2D(_MainTex, uv + o.yx);
t = tex2D(_MainTex, uv + o.zz);
gx -= t;
gy += t;
gx -= 2.0*tex2D(_MainTex, uv + o.zy);
t = tex2D(_MainTex, uv + o.zx);
gx -= t;
gy -= t;
float4 grad = sqrt(gx*gx + gy*gy);
return float4(grad);
}
ENDCG
}
}
}
Script:
////////////////////////////////////////////
// CameraFilterPack - by VETASOFT 2018 /////
////////////////////////////////////////////
using UnityEngine;
using System.Collections;
[ExecuteInEditMode]
[AddComponentMenu("Camera Filter Pack/Edge/Neon")]
public class CameraFilterPack_Edge_Neon_Legacy : MonoBehaviour
{
#region Variables
public Shader SCShader;
private float TimeX = 1.0f;
private Material SCMaterial;
[Range(1, 30)] public float EdgeWeight = 1f;
[Range(0, 1)] public float Test = 1f;
#endregion
#region Properties
private Material Material
{
get
{
if (SCMaterial != null)
return SCMaterial;
SCMaterial = new Material(SCShader);
SCMaterial.hideFlags = HideFlags.HideAndDontSave;
return SCMaterial;
}
}
#endregion
#region MonoBehaviour
private void Start()
{
SCShader = Shader.Find("CameraFilterPack/Edge_Neon_Legacy");
}
private void OnRenderImage(RenderTexture sourceTexture, RenderTexture destTexture)
{
if (SCShader != null)
{
TimeX += Time.deltaTime;
if (TimeX > 100) TimeX = 0;
Material.SetFloat("_TimeX", TimeX);
Material.SetFloat("_EdgeWeight", EdgeWeight);
Material.SetVector("_ScreenResolution", new Vector2(Screen.width, Screen.height));
Graphics.Blit(sourceTexture, destTexture, Material);
}
else
{
Graphics.Blit(sourceTexture, destTexture);
}
}
#if UNITY_EDITOR
// Update is called once per frame
private void Update()
{
if (!Application.isPlaying)
{
SCShader = Shader.Find("CameraFilterPack/Edge_Neon_Legacy");
}
}
#endif
private void OnDisable()
{
if (SCMaterial)
{
DestroyImmediate(SCMaterial);
}
}
#endregion
}
Any help would be extremely appreciated, could it possibly be something in the player settings?
Thanks in advance,