Hi everyone, I need a Shader for Transparent Video where half of the frame is for the video and the other half for Alpha Something like this: I achieve it using Shader Graph, it is quite simple, but I need it for SRP and Unity 2019: I am pretty bad writing shader code, I will appreciate it a lot for any help The reason is due to the in-viability of streaming video with alpha channel, but extracting the alpha and creating a new video including the video and alpha in the same frame 50/50, made possible to stream using more compatible formats like H264.
Shader Graph only works with the SRP in 2019, so your work is done, unless you're thinking SRP means something else. SRP stands for Scriptable Render Pipeline, which is a new(ish) way to write custom rendering pipelines for Unity with c#. Both Unity's URP and HDRP are SRPs. Shader Graph is a tool Unity created to make shaders for those two SRPs. If you're looking to support the built in renderer, this isn't supported by Unity 2019. They added built in renderer support to Unity 2021.2's version of Shader Graph. You would need to write this shader using ShaderLab and HLSL, or buy Amplify Shader Editor.
Thanks a lot for your reply, Sorry My Mistake, What I wanted to say with SRP was Standard Render Pipeline, but of course this doesn't exist, I mean Built-in Render PipeLine., Sorry for the confusion I think that Shader Graph for built in is only possible in the latest 2021 release I wrote this shader that works fine, but I am still not sure if this is the right way to do it: Code (CSharp): Shader "Transparent/HalfAlpha" { Properties{ _Color("Main Color", Color) = (1,1,1,1) _MainTex("Base (RGB) Trans (A)", 2D) = "white" {} } SubShader { Tags {"Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent"} LOD 200 Cull off CGPROGRAM #pragma surface surf Lambert alpha sampler2D _MainTex; float4 _Color; struct Input { float2 uv_MainTex; }; void surf(Input IN, inout SurfaceOutput o) { float2 cv1 = IN.uv_MainTex; float2 cv2 = IN.uv_MainTex; cv1.x *= 0.5; cv2.x *= 0.5; cv2.x += 0.5; half4 c = tex2D(_MainTex, cv1) * _Color; o.Albedo = c.rgb; o.Alpha = c.a * tex2D(_MainTex, cv2).r; } ENDCG } Fallback "Transparent/VertexLit" }