add some extra assets FX and SFX

This commit is contained in:
Robii Aragon
2026-03-29 23:03:14 -07:00
parent 6ef3eb1535
commit 24dc66a81e
10142 changed files with 2535978 additions and 36608 deletions

View File

@@ -1,70 +1,135 @@
Shader "Custom/Transparent Diffuse (Improved)" {
Properties {
_Color("Main Color", Color) = (1, 1, 1, 1)
_MainTex("Base (RGB) Trans (A)", 2D) = "white" { }
_Glossiness ("Smoothness", Range(0,1)) = 0.5
_Metallic ("Metallic", Range(0,1)) = 0.0
Shader "Custom/URP/TransparentDiffuseImproved"
{
Properties
{
_BaseMap("Base Map", 2D) = "white" {}
_BaseColor("Color", Color) = (1,1,1,1)
_BumpMap ("Normalmap", 2D) = "bump" {}
}
_Metallic("Metallic", Range(0,1)) = 0
_Smoothness("Smoothness", Range(0,1)) = 0.5
SubShader {
Tags { "Queue"="Transparent" "IgnoreProjector"="False" "RenderType"="Transparent" }
_BumpMap("Normal Map", 2D) = "bump" {}
}
// First Pass: Only render alpha (A) channel
Pass {
ColorMask A
Blend SrcAlpha OneMinusSrcAlpha
SubShader
{
Tags
{
"RenderPipeline"="UniversalRenderPipeline"
"Queue"="Transparent"
"RenderType"="Transparent"
}
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
Pass
{
Name "ForwardLit"
Tags { "LightMode"="UniversalForward" }
fixed4 _Color;
Blend SrcAlpha OneMinusSrcAlpha
ZWrite Off
Cull Back
float4 vert(float4 vertex:POSITION) : SV_POSITION {
return UnityObjectToClipPos(vertex);
}
HLSLPROGRAM
fixed4 frag() : SV_Target {
return _Color;
}
#pragma vertex vert
#pragma fragment frag
ENDCG
}
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS
#pragma multi_compile _ _ADDITIONAL_LIGHTS
// Second Pass: Now render color (RGB) channel
ColorMask RGB
Blend SrcAlpha OneMinusSrcAlpha
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
CGPROGRAM
#pragma surface surf Standard alpha
struct Attributes
{
float4 positionOS : POSITION;
float3 normalOS : NORMAL;
float4 tangentOS : TANGENT;
float2 uv : TEXCOORD0;
};
sampler2D _MainTex;
fixed4 _Color;
struct Varyings
{
float4 positionHCS : SV_POSITION;
float2 uv : TEXCOORD0;
float3 normalWS : TEXCOORD1;
float3 tangentWS : TEXCOORD2;
float3 bitangentWS : TEXCOORD3;
float3 positionWS : TEXCOORD4;
};
sampler2D _BumpMap;
TEXTURE2D(_BaseMap);
SAMPLER(sampler_BaseMap);
half _Glossiness;
half _Metallic;
TEXTURE2D(_BumpMap);
SAMPLER(sampler_BumpMap);
struct Input {
float4 color:COLOR;
float2 uv_MainTex;
float2 uv_BumpMap;
};
CBUFFER_START(UnityPerMaterial)
float4 _BaseColor;
float _Metallic;
float _Smoothness;
CBUFFER_END
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;
Varyings vert (Attributes IN)
{
Varyings OUT;
o.Normal = UnpackNormal (tex2D (_BumpMap, IN.uv_BumpMap));
}
ENDCG
}
OUT.positionWS = TransformObjectToWorld(IN.positionOS.xyz);
OUT.positionHCS = TransformWorldToHClip(OUT.positionWS);
OUT.uv = IN.uv;
Fallback "Legacy Shaders/Transparent/Diffuse"
}
OUT.normalWS = TransformObjectToWorldNormal(IN.normalOS);
OUT.tangentWS = TransformObjectToWorldDir(IN.tangentOS.xyz);
OUT.bitangentWS = cross(OUT.normalWS, OUT.tangentWS) * IN.tangentOS.w;
return OUT;
}
half4 frag (Varyings IN) : SV_Target
{
float4 baseMap = SAMPLE_TEXTURE2D(_BaseMap, sampler_BaseMap, IN.uv);
float3 albedo = baseMap.rgb * _BaseColor.rgb;
float alpha = baseMap.a * _BaseColor.a;
float3 normalTS = UnpackNormal(SAMPLE_TEXTURE2D(_BumpMap, sampler_BumpMap, IN.uv));
float3x3 TBN = float3x3(
normalize(IN.tangentWS),
normalize(IN.bitangentWS),
normalize(IN.normalWS)
);
float3 normalWS = normalize(mul(normalTS, TBN));
InputData lightingInput;
lightingInput.positionWS = IN.positionWS;
lightingInput.normalWS = normalWS;
lightingInput.viewDirectionWS = normalize(GetWorldSpaceViewDir(IN.positionWS));
lightingInput.shadowCoord = TransformWorldToShadowCoord(IN.positionWS);
lightingInput.fogCoord = 0;
lightingInput.vertexLighting = float3(0,0,0);
lightingInput.bakedGI = SampleSH(normalWS);
SurfaceData surfaceData = (SurfaceData)0;
surfaceData.albedo = albedo;
surfaceData.alpha = alpha;
surfaceData.metallic = _Metallic;
surfaceData.specular = 0;
surfaceData.smoothness = _Smoothness;
surfaceData.normalTS = normalTS;
surfaceData.occlusion = 1;
surfaceData.emission = 0;
surfaceData.clearCoatMask = 0;
surfaceData.clearCoatSmoothness = 0;
half4 color = UniversalFragmentPBR(lightingInput, surfaceData);
color.a = alpha;
return color;
}
ENDHLSL
}
}
}