I have this shader that was working in 2022.2 webGL and still works in the editor at the 2022.3 but is pink in the webGL build for 2022.3? not so good with shaders so any help would be really appreciated, just need a shader that works in in urp webGL 2022.3 that is unlit with texture colour and transparency and is not pink.
Shader "Universal Render Pipeline/Unlit Transparent Colour Texture" {
Properties
{
[MainColor] _BaseColor("BaseColor", Color) = (1,1,1,1)
[MainTexture] _BaseMap("BaseMap", 2D) = "white" {}
[Enum(UnityEngine.Rendering.CompareFunction)] _ZTest("ZTest", Float) = 4
}
SubShader
{
Tags {"Queue" = "Transparent" "RenderType" = "Opaque" "RenderPipeline" = "UniversalRenderPipeline"}
Pass
{
Tags { "LightMode" = "UniversalForward" }
ZTest[_ZTest]
ZWrite On
Blend SrcAlpha OneMinusSrcAlpha
HLSLPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
struct Attributes
{
float4 positionOS : POSITION;
float2 uv : TEXCOORD0;
};
struct Varyings
{
float2 uv : TEXCOORD0;
float4 positionHCS : SV_POSITION;
};
TEXTURE2D(_BaseMap);
SAMPLER(sampler_BaseMap);
CBUFFER_START(UnityPerMaterial)
float4 _BaseMap_ST;
half4 _BaseColor;
CBUFFER_END
Varyings vert(Attributes IN)
{
Varyings OUT;
OUT.positionHCS = TransformObjectToHClip(IN.positionOS.xyz);
OUT.uv = TRANSFORM_TEX(IN.uv, _BaseMap);
return OUT;
}
half4 frag(Varyings IN) : SV_Target
{
return SAMPLE_TEXTURE2D(_BaseMap, sampler_BaseMap, IN.uv) * _BaseColor;
}
ENDHLSL
}
}
}