- Added a UI render texture material that has standard depth sorting.

- On-set newspaper display in round 3 no longer renders over everything.
This commit is contained in:
2026-04-12 15:07:05 -04:00
parent 92ff0bd7a1
commit ff3449c39a
15 changed files with 204 additions and 131 deletions
+47 -34
View File
@@ -1,51 +1,64 @@
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
// Simplified Diffuse shader. Differences from regular Diffuse one:
// - no Main Color
// - fully supports only 1 directional light. Other lights can affect it, but it will be per-vertex/SH.
Shader "Carmen/Decal"
Shader "Carmen/Decal"
{
Properties
{
Properties
{
_MainTex ("Decal", 2D) = "white" {}
_Colour ("Colour", Color) = (1.0, 1.0, 1.0, 1.0)
}
SubShader
{
Tags { "Queue"="Transparent" "RenderType"="Transparent" "CanUseSpriteAtlas"="True" }
LOD 200
_Colour ("Colour", Color) = (1.0, 1.0, 1.0, 1.0)
_Metallic ("Metallic", Range(0.0, 1.0)) = 0.0
_Smoothness ("Smoothness", Range(0.0, 1.0)) = 0.0
Cull Back
Blend SrcAlpha OneMinusSrcAlpha
[NoScaleOffset] _DetailTex ("Detail Albedo", 2D) = "grey" {}
_DetailNormal ("Detail Normal", 2D) = "bump" {}
}
SubShader
{
Tags { "Queue"="Overlay" "RenderType"="Fade" "CanUseSpriteAtlas"="True" }
LOD 200
Cull Back
Blend SrcAlpha OneMinusSrcAlpha
Offset -1, -1
CGPROGRAM
#include "UnityCG.cginc"
CGPROGRAM
#include "UnityCG.cginc"
#pragma target 4.5
#pragma surface surf Standard
UNITY_DECLARE_TEX2D(_MainTex);
#pragma surface surf Standard alpha:fade
struct Input
{
float2 uv_MainTex;
float2 uv_DetailTex;
float2 uv_DetailNormal;
};
half4 _Colour;
UNITY_DECLARE_TEX2D(_MainTex);
half4 _Colour;
half _Metallic;
half _Smoothness;
UNITY_DECLARE_TEX2D(_DetailTex);
UNITY_DECLARE_TEX2D(_DetailNormal);
void surf (Input IN, inout SurfaceOutputStandard o)
{
half4 TexSample = UNITY_SAMPLE_TEX2D(_MainTex, IN.uv_MainTex);
o.Albedo = TexSample.rgb * _Colour;
o.Alpha = TexSample.a;
half4 TexSample = UNITY_SAMPLE_TEX2D(_MainTex, IN.uv_MainTex);
o.Albedo = TexSample.rgb;
//o.Albedo *= UNITY_SAMPLE_TEX2D(_DetailTex, IN.uv_DetailNormal).rgb * 2.0;
o.Albedo *= _Colour;
o.Alpha = TexSample.a * _Colour.a;
o.Metallic = _Metallic;
o.Smoothness = _Smoothness;
o.Normal = UnpackNormal(UNITY_SAMPLE_TEX2D(_DetailNormal, IN.uv_DetailNormal));
}
ENDCG
}
FallBack "Diffuse"
ENDCG
}
FallBack "Diffuse"
}
@@ -0,0 +1,61 @@
Shader "Carmen/Render Texture UI/Always On Top"
{
Properties
{
_MainTex ("Logo Image", 2D) = "white" {}
_Color ("Colour", Color) = (1.0, 1.0, 1.0, 1.0)
}
SubShader
{
Tags { "Queue"="Overlay" "RenderType"="Transparent" "CanUseSpriteAtlas"="True" }
LOD 200
Pass {
Cull Back
Lighting Off
Blend SrcAlpha OneMinusSrcAlpha
ZWrite Off
ZTest Always
CGPROGRAM
#include "UnityCG.cginc"
#pragma target 4.5
#pragma vertex vert
#pragma fragment frag
UNITY_DECLARE_TEX2D(_MainTex);
float4 _MainTex_ST;
half4 _Color;
struct Data
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct V2F
{
float4 position : SV_POSITION;
float2 uv : TEXCOORD0;
};
V2F vert(Data v)
{
V2F o;
o.position = UnityObjectToClipPos(v.vertex);
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
return o;
}
fixed4 frag(V2F i) : SV_TARGET
{
return UNITY_SAMPLE_TEX2D(_MainTex, i.uv) * _Color;
}
ENDCG
}
}
FallBack "Diffuse"
}
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 213afe80d5f1c374ea290e02120114e4
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
+3 -14
View File
@@ -1,15 +1,4 @@
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
// Simplified Diffuse shader. Differences from regular Diffuse one:
// - no Main Color
// - fully supports only 1 directional light. Other lights can affect it, but it will be per-vertex/SH.
Shader "Carmen/Render Texture UI"
Shader "Carmen/Render Texture UI/Standard"
{
Properties
{
@@ -25,8 +14,6 @@ Shader "Carmen/Render Texture UI"
Cull Back
Lighting Off
Blend SrcAlpha OneMinusSrcAlpha
ZWrite Off
ZTest Always
CGPROGRAM
#include "UnityCG.cginc"
@@ -38,6 +25,7 @@ Shader "Carmen/Render Texture UI"
float4 _MainTex_ST;
half4 _Color;
struct Data
{
float4 vertex : POSITION;
@@ -50,6 +38,7 @@ Shader "Carmen/Render Texture UI"
float2 uv : TEXCOORD0;
};
V2F vert(Data v)
{
V2F o;