generated from raccoon/vrchat-project-template
All new shaders
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
Shader "Custom/StandardSurf"
|
Shader "Custom/Minecraft/Standard Animated"
|
||||||
{
|
{
|
||||||
Properties
|
Properties
|
||||||
{
|
{
|
||||||
@@ -60,7 +60,7 @@ Shader "Custom/StandardSurf"
|
|||||||
// Albedo with alpha
|
// Albedo with alpha
|
||||||
float4 diff = UNITY_SAMPLE_TEX2DARRAY(_DiffuseArray, uvw) * _Color;
|
float4 diff = UNITY_SAMPLE_TEX2DARRAY(_DiffuseArray, uvw) * _Color;
|
||||||
o.Albedo = diff.rgb;
|
o.Albedo = diff.rgb;
|
||||||
o.Alpha = _Color.a;
|
o.Alpha = diff.a;
|
||||||
|
|
||||||
// Sample Metallic and smoothness (R = Metallic, A = Smoothness) plus slider variable
|
// Sample Metallic and smoothness (R = Metallic, A = Smoothness) plus slider variable
|
||||||
float4 metalGloss = UNITY_SAMPLE_TEX2DARRAY(_MetallicArray, uvw);
|
float4 metalGloss = UNITY_SAMPLE_TEX2DARRAY(_MetallicArray, uvw);
|
||||||
83
Assets/dbl-world/shaders/minecraft/unlitAnim.shader
Normal file
83
Assets/dbl-world/shaders/minecraft/unlitAnim.shader
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
Shader "Custom/Minecraft/Unlit Animated"
|
||||||
|
{
|
||||||
|
Properties
|
||||||
|
{
|
||||||
|
[NoScaleOffset]_TextureArray("Texture Array (RGBA)", 2DArray) = "" {}
|
||||||
|
_Cutoff ("Alpha Cutoff", Range(0,1)) = 0.5
|
||||||
|
_Color("Tint Color", Color) = (1, 1, 1, 1)
|
||||||
|
_FlipbookFPS("Flipbook FPS", Integer) = 30
|
||||||
|
_FlipbookFrames("Flipbook Frames", Integer) = 30
|
||||||
|
}
|
||||||
|
SubShader
|
||||||
|
{
|
||||||
|
Tags { "RenderType"="TransparentCutout" }
|
||||||
|
LOD 100
|
||||||
|
|
||||||
|
Pass
|
||||||
|
{
|
||||||
|
Tags { "LightMode"="Always" }
|
||||||
|
|
||||||
|
Cull Off
|
||||||
|
ZWrite On
|
||||||
|
AlphaToMask On
|
||||||
|
ColorMask RGB
|
||||||
|
Blend Off
|
||||||
|
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert
|
||||||
|
#pragma fragment frag
|
||||||
|
#pragma multi_compile_fog
|
||||||
|
|
||||||
|
#include "UnityCG.cginc"
|
||||||
|
|
||||||
|
struct appdata
|
||||||
|
{
|
||||||
|
float2 uv : TEXCOORD0;
|
||||||
|
float4 vertex : POSITION;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct v2f
|
||||||
|
{
|
||||||
|
float2 uv : TEXCOORD0;
|
||||||
|
float4 vertex : SV_POSITION;
|
||||||
|
UNITY_FOG_COORDS(1)
|
||||||
|
};
|
||||||
|
|
||||||
|
UNITY_DECLARE_TEX2DARRAY(_TextureArray);
|
||||||
|
float4 _TextureArray_ST;
|
||||||
|
float _Cutoff;
|
||||||
|
fixed4 _Color;
|
||||||
|
|
||||||
|
int _FlipbookFPS;
|
||||||
|
int _FlipbookFrames;
|
||||||
|
|
||||||
|
v2f vert (appdata v)
|
||||||
|
{
|
||||||
|
v2f o;
|
||||||
|
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||||
|
o.uv = TRANSFORM_TEX(v.uv, _TextureArray);
|
||||||
|
UNITY_TRANSFER_FOG(o,o.vertex);
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
|
||||||
|
fixed4 frag (v2f i) : SV_Target
|
||||||
|
{
|
||||||
|
// Calculate flipbook's UV
|
||||||
|
float frame = fmod(floor(_Time.y * _FlipbookFPS), _FlipbookFrames); // Cyclic frame value
|
||||||
|
float3 uvw = float3(i.uv, frame);
|
||||||
|
|
||||||
|
// Sample current flipbook's texture
|
||||||
|
fixed4 col = UNITY_SAMPLE_TEX2DARRAY(_TextureArray, uvw) * _Color;
|
||||||
|
|
||||||
|
// Clip alpha
|
||||||
|
clip(col.a - _Cutoff);
|
||||||
|
|
||||||
|
// And then apply Unity's fog
|
||||||
|
UNITY_APPLY_FOG(i.fogCoord, col);
|
||||||
|
|
||||||
|
return col;
|
||||||
|
}
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
9
Assets/dbl-world/shaders/minecraft/unlitAnim.shader.meta
Normal file
9
Assets/dbl-world/shaders/minecraft/unlitAnim.shader.meta
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0f630459caae45c46992a3487da283d3
|
||||||
|
ShaderImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
defaultTextures: []
|
||||||
|
nonModifiableTextures: []
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Reference in New Issue
Block a user