127 lines
4.0 KiB
Plaintext
127 lines
4.0 KiB
Plaintext
/*
|
|
* The MIT License
|
|
*
|
|
* Copyright 2018-2021 whiteflare.
|
|
*
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
|
|
* to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
*
|
|
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
*
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
*/
|
|
Shader "Hidden/UnlitWF/WF_UnToon_Hidden" {
|
|
|
|
Properties {
|
|
// 基本
|
|
[WFHeader(Base)]
|
|
_MainTex ("Main Texture", 2D) = "white" {}
|
|
[HDR]
|
|
_Color ("Color", Color) = (1, 1, 1, 1)
|
|
[Enum(OFF,0,FRONT,1,BACK,2)]
|
|
_CullMode ("Cull Mode", int) = 2
|
|
[Toggle(_)]
|
|
_UseVertexColor ("Use Vertex Color", Range(0, 1)) = 0
|
|
|
|
// Lit
|
|
[WFHeader(Lit)]
|
|
[Gamma]
|
|
_GL_LevelMin ("Darken (min value)", Range(0, 1)) = 0.125
|
|
[Gamma]
|
|
_GL_LevelMax ("Lighten (max value)", Range(0, 1)) = 0.8
|
|
_GL_BlendPower ("Blend Light Color", Range(0, 1)) = 0.8
|
|
[Toggle(_)]
|
|
_GL_CastShadow ("Cast Shadows", Range(0, 1)) = 1
|
|
|
|
[WFHeader(Lit Advance)]
|
|
[Enum(AUTO,0,ONLY_DIRECTIONAL_LIT,1,ONLY_POINT_LIT,2,CUSTOM_WORLDSPACE,3,CUSTOM_LOCALSPACE,4)]
|
|
_GL_LightMode ("Sun Source", Float) = 0
|
|
_GL_CustomAzimuth ("Custom Sun Azimuth", Range(0, 360)) = 0
|
|
_GL_CustomAltitude ("Custom Sun Altitude", Range(-90, 90)) = 45
|
|
[Toggle(_)]
|
|
_GL_DisableBackLit ("Disable BackLit", Range(0, 1)) = 0
|
|
[Toggle(_)]
|
|
_GL_DisableBasePos ("Disable ObjectBasePos", Range(0, 1)) = 0
|
|
|
|
[HideInInspector]
|
|
[WF_FixFloat(0.0)]
|
|
_CurrentVersion ("2021/07/31", Float) = 0
|
|
}
|
|
|
|
SubShader {
|
|
Tags {
|
|
"RenderType" = "Opaque"
|
|
"Queue" = "Geometry"
|
|
}
|
|
|
|
Pass {
|
|
Name "MAIN"
|
|
Tags { "LightMode" = "ForwardBase" }
|
|
|
|
ColorMask 0
|
|
ZWrite OFF
|
|
|
|
CGPROGRAM
|
|
|
|
#pragma vertex vert_depth
|
|
#pragma fragment frag_depth
|
|
|
|
#pragma multi_compile_fwdbase
|
|
#pragma multi_compile_fog
|
|
#pragma multi_compile_instancing
|
|
|
|
#include "WF_UnToon_DepthOnly.cginc"
|
|
|
|
ENDCG
|
|
}
|
|
|
|
Pass {
|
|
Name "SHADOWCASTER"
|
|
Tags{ "LightMode" = "ShadowCaster" }
|
|
|
|
ColorMask 0
|
|
ZWrite OFF
|
|
|
|
CGPROGRAM
|
|
|
|
#pragma vertex vert_shadow
|
|
#pragma fragment frag_shadow_hidden
|
|
|
|
#pragma multi_compile_shadowcaster
|
|
#pragma multi_compile_instancing
|
|
|
|
#include "WF_UnToon_ShadowCaster.cginc"
|
|
|
|
ENDCG
|
|
}
|
|
|
|
Pass {
|
|
Name "META"
|
|
Tags { "LightMode" = "Meta" }
|
|
|
|
Cull OFF
|
|
|
|
CGPROGRAM
|
|
|
|
#pragma vertex vert_meta
|
|
#pragma fragment frag_meta_black
|
|
|
|
#pragma shader_feature_local _VC_ENABLE
|
|
|
|
#pragma shader_feature EDITOR_VISUALIZATION
|
|
|
|
#include "WF_UnToon_Meta.cginc"
|
|
|
|
ENDCG
|
|
}
|
|
}
|
|
|
|
FallBack OFF
|
|
|
|
CustomEditor "UnlitWF.ShaderCustomEditor"
|
|
}
|