Reworks multiple shaders and materials for URP compatibility and adds a Loading screen/scene and a few model imports. Key changes: - Converted ProBuilder standard vertex-color shader and several particle/surface shaders to URP HLSL passes (UniversalForward, ShadowCaster, Depth, DepthNormals) preserving base texture * tint * vertex color, normal map and PBR parameters. - Updated particle SurfaceShader_VC to a URP forward pass and simplified lighting to use URP shader library helpers. - Updated materials (landMark, tile) to point to project textures, adjust keywords/flags (e.g. XRMotionVectorsPass, disable ShadowCaster for one), tweak tiling and base color values. - Added a Loading screen UI (UXML, USS) and LoadingScreenController.cs plus a new Loading scene and scene metadata. - Imported new FBX assets (T-Pose, Untitled) and updated Editor build settings / project settings to include the new Loading scene. These changes migrate rendering code to the Universal Render Pipeline and add a basic loading UI/scene, while updating materials and project settings accordingly.
84 lines
2.4 KiB
Plaintext
84 lines
2.4 KiB
Plaintext
Shader "Custom/URP Transparent Diffuse" {
|
|
Properties {
|
|
_MainTex("Base (RGB)", 2D) = "white" {}
|
|
_Color("Main Color", Color) = (1,1,1,1)
|
|
_Glossiness("Smoothness", Range(0,1)) = 0.5
|
|
_Metallic("Metallic", Range(0,1)) = 0.0
|
|
_BumpMap("Normalmap", 2D) = "bump" {}
|
|
_TransparentAmount("Transparent Amount", Float) = 1
|
|
_StippleSize("Stipple Size", Float) = 1
|
|
}
|
|
SubShader {
|
|
Tags { "RenderType"="Transparent" "Queue"="Transparent" }
|
|
LOD 200
|
|
Cull Off
|
|
Blend SrcAlpha OneMinusSrcAlpha
|
|
Pass {
|
|
Name "FORWARD"
|
|
HLSLPROGRAM
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
#pragma multi_compile_fog
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
|
|
|
struct Attributes {
|
|
float4 positionOS : POSITION;
|
|
float2 uv : TEXCOORD0;
|
|
float2 uv2 : TEXCOORD1;
|
|
float3 normalOS : NORMAL;
|
|
float4 tangentOS : TANGENT;
|
|
};
|
|
|
|
struct Varyings {
|
|
float4 positionCS : SV_POSITION;
|
|
float2 uv : TEXCOORD0;
|
|
float2 uv2 : TEXCOORD1;
|
|
float3 normalWS : TEXCOORD2;
|
|
float4 screenPos : TEXCOORD3;
|
|
float3 tangentWS : TEXCOORD4;
|
|
float3 bitangentWS : TEXCOORD5;
|
|
};
|
|
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float4 _MainTex_ST;
|
|
float4 _Color;
|
|
float _Glossiness;
|
|
float _Metallic;
|
|
float _TransparentAmount;
|
|
float _StippleSize;
|
|
CBUFFER_END
|
|
|
|
TEXTURE2D(_MainTex); SAMPLER(sampler_MainTex);
|
|
TEXTURE2D(_BumpMap); SAMPLER(sampler_BumpMap);
|
|
|
|
Varyings vert(Attributes IN) {
|
|
Varyings OUT;
|
|
OUT.positionCS = TransformObjectToHClip(IN.positionOS.xyz);
|
|
OUT.uv = TRANSFORM_TEX(IN.uv, _MainTex);
|
|
OUT.uv2 = IN.uv2;
|
|
OUT.normalWS = TransformObjectToWorldNormal(IN.normalOS);
|
|
OUT.tangentWS = TransformObjectToWorldDir(IN.tangentOS.xyz);
|
|
OUT.bitangentWS = cross(OUT.normalWS, OUT.tangentWS) * IN.tangentOS.w;
|
|
OUT.screenPos = ComputeScreenPos(OUT.positionCS);
|
|
return OUT;
|
|
}
|
|
|
|
float4 frag(Varyings IN) : SV_Target {
|
|
float4 albedo = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, IN.uv) * _Color;
|
|
float3 normalTS = UnpackNormal(SAMPLE_TEXTURE2D(_BumpMap, sampler_BumpMap, IN.uv));
|
|
float3x3 TBN = float3x3(normalize(IN.tangentWS), normalize(IN.bitangentWS), normalize(IN.normalWS));
|
|
float3 normalWS = mul(normalTS, TBN);
|
|
|
|
float alpha = albedo.a * _TransparentAmount;
|
|
if (alpha <= 0.01)
|
|
discard;
|
|
|
|
float3 color = albedo.rgb;
|
|
return float4(color, alpha);
|
|
}
|
|
ENDHLSL
|
|
}
|
|
}
|
|
FallBack "Universal Forward"
|
|
}
|