迁移敌人模型到新素材上并加入动画
This commit is contained in:
@@ -26,7 +26,9 @@ Material:
|
||||
m_Ints: []
|
||||
m_Floats:
|
||||
- _EmissionIntensity: 0.25
|
||||
- _OutlineWidth: 0.006
|
||||
m_Colors:
|
||||
- _BaseColor: {r: 0.04, g: 0.85, b: 0.22, a: 1}
|
||||
- _EmissionColor: {r: 0.12, g: 1, b: 0.38, a: 1}
|
||||
- _OutlineColor: {r: 0.005, g: 0.045, b: 0.02, a: 1}
|
||||
m_BuildTextureStacks: []
|
||||
|
||||
@@ -5,6 +5,8 @@ Shader "SepCore/Drop/Instanced Emission"
|
||||
_BaseColor ("Base Color", Color) = (0.04, 0.85, 0.22, 1)
|
||||
[HDR] _EmissionColor ("Emission Color", Color) = (0.12, 1, 0.38, 1)
|
||||
_EmissionIntensity ("Emission Intensity", Range(0, 10)) = 1.8
|
||||
_OutlineColor ("Outline Color", Color) = (0.005, 0.045, 0.02, 1)
|
||||
_OutlineWidth ("Outline Width (Object Space)", Range(0, 0.05)) = 0.006
|
||||
}
|
||||
|
||||
SubShader
|
||||
@@ -18,6 +20,60 @@ Shader "SepCore/Drop/Instanced Emission"
|
||||
|
||||
LOD 100
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "Outline"
|
||||
Tags { "LightMode" = "SRPDefaultUnlit" }
|
||||
Cull Front
|
||||
ZWrite On
|
||||
ZTest LEqual
|
||||
|
||||
HLSLPROGRAM
|
||||
#pragma target 3.0
|
||||
#pragma vertex OutlineVert
|
||||
#pragma fragment OutlineFrag
|
||||
#pragma multi_compile_instancing
|
||||
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
|
||||
UNITY_INSTANCING_BUFFER_START(DropOutlineProperties)
|
||||
UNITY_DEFINE_INSTANCED_PROP(float4, _OutlineColor)
|
||||
UNITY_DEFINE_INSTANCED_PROP(float, _OutlineWidth)
|
||||
UNITY_INSTANCING_BUFFER_END(DropOutlineProperties)
|
||||
|
||||
struct OutlineAttributes
|
||||
{
|
||||
float4 positionOS : POSITION;
|
||||
float3 normalOS : NORMAL;
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
};
|
||||
|
||||
struct OutlineVaryings
|
||||
{
|
||||
float4 positionCS : SV_POSITION;
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
};
|
||||
|
||||
OutlineVaryings OutlineVert(OutlineAttributes input)
|
||||
{
|
||||
OutlineVaryings output;
|
||||
UNITY_SETUP_INSTANCE_ID(input);
|
||||
UNITY_TRANSFER_INSTANCE_ID(input, output);
|
||||
|
||||
float outlineWidth = UNITY_ACCESS_INSTANCED_PROP(DropOutlineProperties, _OutlineWidth);
|
||||
float3 expandedPositionOS = input.positionOS.xyz + normalize(input.normalOS) * outlineWidth;
|
||||
output.positionCS = TransformObjectToHClip(expandedPositionOS);
|
||||
return output;
|
||||
}
|
||||
|
||||
half4 OutlineFrag(OutlineVaryings input) : SV_Target
|
||||
{
|
||||
UNITY_SETUP_INSTANCE_ID(input);
|
||||
return UNITY_ACCESS_INSTANCED_PROP(DropOutlineProperties, _OutlineColor);
|
||||
}
|
||||
ENDHLSL
|
||||
}
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "ForwardLit"
|
||||
|
||||
Reference in New Issue
Block a user