- 
      
- 
        Save yCatDev/21cb4b483d6de4ebaa72323d9989b224 to your computer and use it in GitHub Desktop. 
Revisions
- 
        yCatDev revised this gist Sep 29, 2021 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,10 +9,11 @@ Shader "Custom/UnlitTexture" // Universal Render Pipeline subshader. If URP is installed this will be used. SubShader { Tags { "RenderType"="Fade" "RenderPipeline"="UniversalRenderPipeline"} Pass { ZWrite On Tags { "LightMode"="UniversalForward" } HLSLPROGRAM 
- 
        yCatDev revised this gist Sep 29, 2021 . No changes.There are no files selected for viewing
- 
        phi-lira revised this gist Jul 28, 2020 . 1 changed file with 55 additions and 1 deletion.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,12 @@ Shader "Custom/UnlitTexture" { Properties { [MainColor] _BaseColor("BaseColor", Color) = (1,1,1,1) [MainTexture] _BaseMap("BaseMap", 2D) = "white" {} } // Universal Render Pipeline subshader. If URP is installed this will be used. SubShader { Tags { "RenderType"="Opaque" "RenderPipeline"="UniversalRenderPipeline"} @@ -55,4 +56,57 @@ Shader "Universal Render Pipeline/Custom/UnlitTexture" ENDHLSL } } // Built-in pipeline subshader. This is fallback subshader in case URP is not being used. SubShader { Tags { "RenderType"="Opaque"} LOD 100 Pass { CGPROGRAM #pragma vertex vert #pragma fragment frag // make fog work #pragma multi_compile_fog #include "UnityCG.cginc" struct appdata { float4 vertex : POSITION; float2 uv : TEXCOORD0; }; struct v2f { float2 uv : TEXCOORD0; UNITY_FOG_COORDS(1) float4 vertex : SV_POSITION; }; sampler2D _MainTex; float4 _MainTex_ST; v2f vert (appdata v) { v2f o; o.vertex = UnityObjectToClipPos(v.vertex); o.uv = TRANSFORM_TEX(v.uv, _MainTex); UNITY_TRANSFER_FOG(o,o.vertex); return o; } fixed4 frag (v2f i) : SV_Target { // sample the texture fixed4 col = tex2D(_MainTex, i.uv); // apply fog UNITY_APPLY_FOG(i.fogCoord, col); return col; } ENDCG } } } 
- 
        phi-lira created this gist Apr 22, 2020 .There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,58 @@ Shader "Universal Render Pipeline/Custom/UnlitTexture" { Properties { [MainColor] _BaseColor("BaseColor", Color) = (1,1,1,1) [MainTexture] _BaseMap("BaseMap", 2D) = "white" {} } SubShader { Tags { "RenderType"="Opaque" "RenderPipeline"="UniversalRenderPipeline"} Pass { Tags { "LightMode"="UniversalForward" } 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 } } }