├── 753's True Shaders.unitypackage ├── README.md └── just shaders ├── _HalfColor.shader ├── _HalfLit.shader ├── _TrueColor.shader ├── _TrueImage.shader ├── _TrueLit.shader ├── _TrueScroll.shader └── _TrueSight.shader /753's True Shaders.unitypackage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/x753/True-Shaders-for-Unity/d300bd6177b080f460ea0b910165c48213af92e8/753's True Shaders.unitypackage -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # True-Shaders-for-Unity 2 | A pack including several experimental Unity shaders that allow you to see objects through walls and more 3 | 4 | Here are a couple experimental shaders I made, along with an effect prefab and example scenes. 5 | This is my first time playing around with shaders, but I tried to leave some comments in the .shader files. 6 | 7 | trueColor: 8 | - Able to be seen through walls 9 | - Tint Color can be changed 10 | - Alpha can be changed 11 | 12 | halfColor: 13 | - CANNOT be seen through walls 14 | - same as trueColor 15 | 16 | trueLit: 17 | - Able to be seen through walls 18 | - Full brightness 19 | - Able to apply textures 20 | - Blocks trueColor shader 21 | 22 | halfLit: 23 | - CANNOT be seen through walls 24 | - same as trueLit 25 | 26 | trueSight: 27 | - Ignores trueColor shader 28 | 29 | trueImage: 30 | - Able to be seen through walls 31 | - Displays any image in an absolute position on the screen 32 | 33 | trueScroll: 34 | - Simple scrolling texture, adjustable X/Y speeds 35 | - Supports transparency 36 | 37 | These effects can be combined with other shaders, feel free to open up the files and experiment with the code. 38 | -------------------------------------------------------------------------------- /just shaders/_HalfColor.shader: -------------------------------------------------------------------------------- 1 | Shader "753/HalfColor" 2 | { 3 | Properties 4 | { 5 | _Color ("Tint Color", Color) = (1,0,0,0) 6 | // adjust the tint color to change what color is displayed 7 | } 8 | 9 | SubShader 10 | { 11 | Tags { "Queue"="Overlay+7530" "IgnoreProjector"="True" "RenderType"="Overlay" "PreviewType"="Plane" } 12 | // queue is Overlay+7530 to ensure it is rendered no matter what is in the way of it 13 | 14 | Stencil // this is what allows true sight to work 15 | { 16 | Ref 753 17 | Comp NotEqual 18 | } 19 | 20 | Pass 21 | { 22 | ZWrite On 23 | ColorMask 0 24 | } 25 | 26 | Pass 27 | { 28 | Blend SrcAlpha SrcColor 29 | 30 | SetTexture [_MainTex] 31 | { 32 | constantColor [_Color] 33 | combine texture * constant 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /just shaders/_HalfLit.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "753/HalfLit" 4 | { 5 | Properties 6 | { 7 | _Color ("Main Color", Color) = (1,1,1,1) 8 | _MainTex ("Base (RGB)", 2D) = "white" {} 9 | _Illum ("Illumin (A)", 2D) = "white" {} 10 | _Emission ("Emission (Lightmapper)", Float) = 1.0 11 | } 12 | SubShader 13 | { 14 | Tags { "Queue"="Overlay+7531" "RenderType"="Opaque" } // the Queue value is greater than the TrueColor shader's Queue value 15 | LOD 200 16 | 17 | CGPROGRAM 18 | #pragma surface surf Lambert 19 | 20 | sampler2D _MainTex; 21 | sampler2D _Illum; 22 | fixed4 _Color; 23 | fixed _Emission; 24 | 25 | struct Input { 26 | float2 uv_MainTex; 27 | float2 uv_Illum; 28 | }; 29 | 30 | void surf (Input IN, inout SurfaceOutput o) { 31 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 32 | fixed4 c = tex * _Color; 33 | o.Albedo = c.rgb; 34 | o.Emission = c.rgb * tex2D(_Illum, IN.uv_Illum).a; 35 | #if defined (UNITY_PASS_META) 36 | o.Emission *= _Emission.rrr; 37 | #endif 38 | o.Alpha = c.a; 39 | } 40 | ENDCG 41 | } 42 | FallBack "Legacy Shaders/Self-Illumin/VertexLit" 43 | CustomEditor "LegacyIlluminShaderGUI" 44 | } 45 | -------------------------------------------------------------------------------- /just shaders/_TrueColor.shader: -------------------------------------------------------------------------------- 1 | Shader "753/TrueColor" 2 | { 3 | Properties 4 | { 5 | _Color ("Tint Color", Color) = (1,0,0,0) 6 | // adjust the tint color to change what color is displayed 7 | } 8 | 9 | SubShader 10 | { 11 | Tags { "Queue"="Overlay+7530" "IgnoreProjector"="True" "RenderType"="Overlay" "PreviewType"="Plane" } 12 | // queue is Overlay+7530 to ensure it is rendered no matter what is in the way of it 13 | 14 | Stencil // this is what allows true sight to work 15 | { 16 | Ref 753 17 | Comp NotEqual 18 | } 19 | 20 | ZTest Always // this is what makes the shader visible through anything 21 | 22 | Pass 23 | { 24 | ZWrite On 25 | ColorMask 0 26 | } 27 | 28 | Pass 29 | { 30 | Blend SrcAlpha SrcColor 31 | 32 | SetTexture [_MainTex] 33 | { 34 | constantColor [_Color] 35 | combine texture * constant 36 | } 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /just shaders/_TrueImage.shader: -------------------------------------------------------------------------------- 1 | Shader "753/TrueImage" 2 | { 3 | Properties 4 | { 5 | _MainTex ("Texture", 2D) = "white" {} 6 | } 7 | 8 | SubShader 9 | { 10 | Tags { "Queue"="Overlay+7530" "IgnoreProjector"="True" "RenderType"="Overlay" "PreviewType"="Plane" } 11 | // queue is Overlay+7530 to ensure it is rendered no matter what is in the way of it 12 | 13 | ZTest Always // this is what makes the shader visible through anything 14 | 15 | Blend SrcAlpha OneMinusSrcAlpha // this allows for transparency 16 | 17 | Stencil // this is what allows true sight to work 18 | { 19 | Ref 753 20 | Comp NotEqual 21 | } 22 | 23 | Pass 24 | { 25 | CGPROGRAM 26 | #pragma vertex vert 27 | #pragma fragment frag 28 | #include "UnityCG.cginc" 29 | 30 | sampler2D _MainTex; 31 | 32 | float4 vert (appdata_base v) : SV_POSITION 33 | { 34 | return UnityObjectToClipPos(v.vertex); 35 | } 36 | 37 | fixed4 frag (float4 i : VPOS) : SV_Target 38 | { 39 | return tex2D(_MainTex, float2(i.xy / _ScreenParams.xy)); 40 | } 41 | ENDCG 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /just shaders/_TrueLit.shader: -------------------------------------------------------------------------------- 1 | // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) 2 | 3 | Shader "753/TrueLit" 4 | { 5 | Properties 6 | { 7 | _Color ("Main Color", Color) = (1,1,1,1) 8 | _MainTex ("Base (RGB)", 2D) = "white" {} 9 | _Illum ("Illumin (A)", 2D) = "white" {} 10 | _Emission ("Emission (Lightmapper)", Float) = 1.0 11 | } 12 | SubShader 13 | { 14 | Tags { "Queue"="Overlay+7531" "RenderType"="Opaque" } // the Queue value is greater than the TrueColor shader's Queue value 15 | LOD 200 16 | 17 | ZTest Always // this is what makes the shader visible through anything 18 | 19 | CGPROGRAM 20 | #pragma surface surf Lambert 21 | 22 | sampler2D _MainTex; 23 | sampler2D _Illum; 24 | fixed4 _Color; 25 | fixed _Emission; 26 | 27 | struct Input { 28 | float2 uv_MainTex; 29 | float2 uv_Illum; 30 | }; 31 | 32 | void surf (Input IN, inout SurfaceOutput o) { 33 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 34 | fixed4 c = tex * _Color; 35 | o.Albedo = c.rgb; 36 | o.Emission = c.rgb * tex2D(_Illum, IN.uv_Illum).a; 37 | #if defined (UNITY_PASS_META) 38 | o.Emission *= _Emission.rrr; 39 | #endif 40 | o.Alpha = c.a; 41 | } 42 | ENDCG 43 | } 44 | FallBack "Legacy Shaders/Self-Illumin/VertexLit" 45 | CustomEditor "LegacyIlluminShaderGUI" 46 | } 47 | -------------------------------------------------------------------------------- /just shaders/_TrueScroll.shader: -------------------------------------------------------------------------------- 1 | Shader "753/trueScroll" 2 | { 3 | Properties 4 | { 5 | _MainTex("Texture", 2D) = "white" {} 6 | _ScrollSpeedX("Scroll Speed X", Range(0,10)) = 5 7 | _ScrollSpeedY("Scroll Speed Y", Range(0,10)) = 5 8 | _Brightness("Brightness", Range(0,1)) = 0 9 | } 10 | 11 | SubShader 12 | { 13 | Tags { "Queue"="Transparent" "RenderType"="Transparent" } 14 | Blend SrcAlpha One 15 | 16 | CGPROGRAM 17 | #pragma surface surf Lambert alpha:fade 18 | 19 | struct Input 20 | { 21 | float2 uv_MainTex; 22 | }; 23 | 24 | sampler2D _MainTex; 25 | fixed _ScrollSpeedX; 26 | fixed _ScrollSpeedY; 27 | fixed _Brightness; 28 | 29 | void surf(Input IN, inout SurfaceOutput o) 30 | { 31 | fixed scrollX = _Time * _ScrollSpeedX; 32 | fixed scrollY = _Time * _ScrollSpeedY; 33 | 34 | fixed2 scrolledUV = IN.uv_MainTex; 35 | scrolledUV = scrolledUV + fixed2(scrollX, scrollY); 36 | half4 tex = tex2D(_MainTex, scrolledUV); 37 | o.Albedo = o.Albedo + tex.rgb; 38 | o.Emission = tex.rgb - (1 - _Brightness); 39 | o.Alpha = tex.a; 40 | } 41 | ENDCG 42 | } 43 | 44 | Fallback "Diffuse" 45 | } 46 | -------------------------------------------------------------------------------- /just shaders/_TrueSight.shader: -------------------------------------------------------------------------------- 1 | Shader "753/TrueSight" 2 | { 3 | // https://github.com/noisecrime/Unity-StencilPortalRoomCube/blob/master/LICENSE 4 | // The TrueSight shader is modified from NoiseCrime's Stencil Mask shader. 5 | 6 | SubShader 7 | { 8 | Tags { "RenderType"="Opaque" "Queue"="Geometry-100" } 9 | ColorMask 0 10 | ZWrite off 11 | Stencil 12 | { 13 | Ref 753 14 | Comp always 15 | Pass replace 16 | } 17 | 18 | Pass 19 | { 20 | CGPROGRAM 21 | #pragma vertex vert 22 | #pragma fragment frag 23 | 24 | struct appdata 25 | { 26 | float4 vertex : POSITION; 27 | }; 28 | 29 | struct v2f 30 | { 31 | float4 pos : SV_POSITION; 32 | }; 33 | 34 | v2f vert(appdata v) 35 | { 36 | v2f o; 37 | o.pos = UnityObjectToClipPos(v.vertex); 38 | return o; 39 | } 40 | 41 | half4 frag(v2f i) : COLOR 42 | { 43 | return half4(1,1,0,1); 44 | } 45 | ENDCG 46 | } 47 | } 48 | } --------------------------------------------------------------------------------