Update Game Kit Controller assets
Bulk modifications across the Game Kit Controller package: updated materials and shader, adjusted particle prefabs, and numerous prefab updates for Character Customization, Inventory, Map System, Locked Camera System, Probuilder export objects, Gravity, Health, Mission System and other scene elements. These changes appear to be a large asset rework/reimport or parameter/reference updates to keep prefabs and materials in sync.
This commit is contained in:
@@ -1,83 +1,80 @@
|
||||
Shader "Custom/URP Transparent Diffuse" {
|
||||
Shader "Custom/Transparent Diffuse Stipple" {
|
||||
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" {}
|
||||
_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" }
|
||||
Tags { "RenderType"="Opaque" }
|
||||
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;
|
||||
};
|
||||
CGPROGRAM
|
||||
#pragma surface surf Standard fullforwardshadows
|
||||
|
||||
struct Varyings {
|
||||
float4 positionCS : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
float2 uv2 : TEXCOORD1;
|
||||
float3 normalWS : TEXCOORD2;
|
||||
float4 screenPos : TEXCOORD3;
|
||||
float3 tangentWS : TEXCOORD4;
|
||||
float3 bitangentWS : TEXCOORD5;
|
||||
};
|
||||
#pragma target 3.0
|
||||
|
||||
CBUFFER_START(UnityPerMaterial)
|
||||
float4 _MainTex_ST;
|
||||
float4 _Color;
|
||||
float _Glossiness;
|
||||
float _Metallic;
|
||||
float _TransparentAmount;
|
||||
float _StippleSize;
|
||||
CBUFFER_END
|
||||
float _TransparentAmount;
|
||||
|
||||
TEXTURE2D(_MainTex); SAMPLER(sampler_MainTex);
|
||||
TEXTURE2D(_BumpMap); SAMPLER(sampler_BumpMap);
|
||||
sampler2D _MainTex;
|
||||
|
||||
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;
|
||||
}
|
||||
fixed4 _Color;
|
||||
|
||||
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);
|
||||
sampler2D _BumpMap;
|
||||
|
||||
float alpha = albedo.a * _TransparentAmount;
|
||||
if (alpha <= 0.01)
|
||||
discard;
|
||||
float _StippleSize;
|
||||
|
||||
float3 color = albedo.rgb;
|
||||
return float4(color, alpha);
|
||||
}
|
||||
ENDHLSL
|
||||
half _Glossiness;
|
||||
half _Metallic;
|
||||
|
||||
static const float4x4 kThresholdMatrix = {
|
||||
1.0 / 17.0, 9.0 / 17.0, 3.0 / 17.0, 11.0 / 17.0,
|
||||
13.0 / 17.0, 5.0 / 17.0, 15.0 / 17.0, 7.0 / 17.0,
|
||||
4.0 / 17.0, 12.0 / 17.0, 2.0 / 17.0, 10.0 / 17.0,
|
||||
16.0 / 17.0, 8.0 / 17.0, 14.0 / 17.0, 6.0 / 17.0
|
||||
};
|
||||
|
||||
static const float4x4 kKernelMatrix = {
|
||||
1, 0, 0, 0,
|
||||
0, 1, 0, 0,
|
||||
0, 0, 1, 0,
|
||||
0, 0, 0, 1
|
||||
};
|
||||
|
||||
struct Input {
|
||||
float2 uv_MainTex;
|
||||
float4 screenPos;
|
||||
float3 worldPos;
|
||||
float2 uv_BumpMap;
|
||||
};
|
||||
|
||||
void surf (Input IN, inout SurfaceOutputStandard o) {
|
||||
fixed4 c = tex2D(_MainTex, IN.uv_MainTex)* _Color;
|
||||
o.Albedo = c.rgb;
|
||||
o.Alpha = c.a;
|
||||
o.Metallic = _Metallic;
|
||||
o.Smoothness = _Glossiness;
|
||||
|
||||
o.Normal = UnpackNormal (tex2D (_BumpMap, IN.uv_BumpMap));
|
||||
|
||||
// Unproject the screen pixel coordiante
|
||||
float2 pos = IN.screenPos.xy / IN.screenPos.w;
|
||||
pos *= _ScreenParams.xy * _StippleSize;
|
||||
|
||||
// Clip pixel within [start, end] distance from camera
|
||||
float interpDist = _TransparentAmount;
|
||||
|
||||
clip(interpDist - kThresholdMatrix[fmod(pos.x, 4)] * kKernelMatrix[fmod(pos.y, 4)]);
|
||||
}
|
||||
|
||||
ENDCG
|
||||
}
|
||||
FallBack "Universal Forward"
|
||||
FallBack "Diffuse"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user