Skip to content

Commit

Permalink
Merge branch 'lilxyzw:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
ishiiyuki authored Dec 31, 2023
2 parents de2aa42 + d6f6cb0 commit 78121ce
Show file tree
Hide file tree
Showing 105 changed files with 2,225 additions and 657 deletions.
18 changes: 18 additions & 0 deletions Assets/lilToon/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,24 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.6.0] - 2023-12-31
### Added
- RimShade feature

### Fixed
- AssetPostprocessor not working properly
- Avoid problems caused by incompatibility of shader keywords

## [1.5.2] - 2023-12-30
### Fixed
- Fixed an issue where necessary vertex data might be deleted when building AssetBundle

## [1.5.1] - 2023-12-27
### Fixed
- Avoid crashes in certain Unity versions
- Support for material variants
- Reduced the frequency of material migration

## [1.5.0] - 2023-12-10
### Added
- Enabled to see property name with alt key
Expand Down
18 changes: 18 additions & 0 deletions Assets/lilToon/CHANGELOG_JP.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,24 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.6.0] - 2023-12-31
### 追加
- RimShadeを追加

### 修正
- AssetPostprocessorが正しく動作していなかったのを修正
- シェーダーキーワードの非互換による不具合を回避

## [1.5.2] - 2023-12-30
### 修正
- AssetBundleビルド時に必要な頂点データが消されてしまう場合があるのを修正

## [1.5.1] - 2023-12-27
### 修正
- 特定Unityバージョンにおけるクラッシュ問題を回避
- マテリアルバリアントへの対応
- マテリアルのマイグレーションを発生しにくくした

## [1.5.0] - 2023-12-10
### 追加
- altキーでプロパティ名を見られるようにした
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#define LIL_MULTI_INPUTS_MAIN3RD
#define LIL_MULTI_INPUTS_ALPHAMASK
#define LIL_MULTI_INPUTS_SHADOW
#define LIL_MULTI_INPUTS_RIMSHADE
#define LIL_MULTI_INPUTS_BACKLIGHT
#define LIL_MULTI_INPUTS_EMISSION
#define LIL_MULTI_INPUTS_EMISSION_2ND
Expand Down Expand Up @@ -86,6 +87,7 @@
#pragma shader_feature_local _SUNDISK_NONE
#pragma shader_feature_local GEOM_TYPE_FROND
#pragma shader_feature_local _REQUIRE_UV2
#pragma shader_feature_local AUTO_KEY_VALUE
#pragma shader_feature_local ANTI_FLICKER
#pragma shader_feature_local _EMISSION
#pragma shader_feature_local GEOM_TYPE_BRANCH
Expand Down Expand Up @@ -176,6 +178,7 @@
#pragma shader_feature_local _SUNDISK_NONE
#pragma shader_feature_local GEOM_TYPE_FROND
#pragma shader_feature_local _REQUIRE_UV2
#pragma shader_feature_local AUTO_KEY_VALUE
#pragma shader_feature_local _NORMALMAP
#pragma shader_feature_local EFFECT_BUMP
#pragma shader_feature_local SOURCE_GBUFFER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#define LIL_MULTI_INPUTS_MAIN3RD
#define LIL_MULTI_INPUTS_ALPHAMASK
#define LIL_MULTI_INPUTS_SHADOW
#define LIL_MULTI_INPUTS_RIMSHADE
#define LIL_MULTI_INPUTS_BACKLIGHT
#define LIL_MULTI_INPUTS_EMISSION
#define LIL_MULTI_INPUTS_EMISSION_2ND
Expand Down Expand Up @@ -87,6 +88,7 @@
#pragma shader_feature_local _SUNDISK_NONE
#pragma shader_feature_local GEOM_TYPE_FROND
#pragma shader_feature_local _REQUIRE_UV2
#pragma shader_feature_local AUTO_KEY_VALUE
#pragma shader_feature_local ANTI_FLICKER
#pragma shader_feature_local _EMISSION
#pragma shader_feature_local GEOM_TYPE_BRANCH
Expand Down Expand Up @@ -235,6 +237,7 @@
#pragma shader_feature_local _SUNDISK_NONE
#pragma shader_feature_local GEOM_TYPE_FROND
#pragma shader_feature_local _REQUIRE_UV2
#pragma shader_feature_local AUTO_KEY_VALUE
#pragma shader_feature_local _NORMALMAP
#pragma shader_feature_local EFFECT_BUMP
#pragma shader_feature_local SOURCE_GBUFFER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#define LIL_MULTI_INPUTS_MAIN3RD
#define LIL_MULTI_INPUTS_ALPHAMASK
#define LIL_MULTI_INPUTS_SHADOW
#define LIL_MULTI_INPUTS_RIMSHADE
#define LIL_MULTI_INPUTS_BACKLIGHT
#define LIL_MULTI_INPUTS_EMISSION
#define LIL_MULTI_INPUTS_EMISSION_2ND
Expand Down Expand Up @@ -87,6 +88,7 @@
#pragma shader_feature_local _SUNDISK_NONE
#pragma shader_feature_local GEOM_TYPE_FROND
#pragma shader_feature_local _REQUIRE_UV2
#pragma shader_feature_local AUTO_KEY_VALUE
#pragma shader_feature_local ANTI_FLICKER
#pragma shader_feature_local _EMISSION
#pragma shader_feature_local GEOM_TYPE_BRANCH
Expand Down Expand Up @@ -243,6 +245,7 @@
#pragma shader_feature_local _SUNDISK_NONE
#pragma shader_feature_local GEOM_TYPE_FROND
#pragma shader_feature_local _REQUIRE_UV2
#pragma shader_feature_local AUTO_KEY_VALUE
#pragma shader_feature_local _NORMALMAP
#pragma shader_feature_local EFFECT_BUMP
#pragma shader_feature_local SOURCE_GBUFFER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#define LIL_MULTI_INPUTS_MAIN3RD
#define LIL_MULTI_INPUTS_ALPHAMASK
#define LIL_MULTI_INPUTS_SHADOW
#define LIL_MULTI_INPUTS_RIMSHADE
#define LIL_MULTI_INPUTS_BACKLIGHT
#define LIL_MULTI_INPUTS_EMISSION
#define LIL_MULTI_INPUTS_EMISSION_2ND
Expand Down Expand Up @@ -84,6 +85,7 @@
#pragma shader_feature_local _SUNDISK_NONE
#pragma shader_feature_local GEOM_TYPE_FROND
#pragma shader_feature_local _REQUIRE_UV2
#pragma shader_feature_local AUTO_KEY_VALUE
#pragma shader_feature_local ANTI_FLICKER
#pragma shader_feature_local _EMISSION
#pragma shader_feature_local GEOM_TYPE_BRANCH
Expand Down Expand Up @@ -169,6 +171,7 @@
#pragma shader_feature_local _SUNDISK_NONE
#pragma shader_feature_local GEOM_TYPE_FROND
#pragma shader_feature_local _REQUIRE_UV2
#pragma shader_feature_local AUTO_KEY_VALUE
#pragma shader_feature_local _NORMALMAP
#pragma shader_feature_local EFFECT_BUMP
#pragma shader_feature_local SOURCE_GBUFFER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#define LIL_MULTI_INPUTS_MAIN3RD
#define LIL_MULTI_INPUTS_ALPHAMASK
#define LIL_MULTI_INPUTS_SHADOW
#define LIL_MULTI_INPUTS_RIMSHADE
#define LIL_MULTI_INPUTS_BACKLIGHT
#define LIL_MULTI_INPUTS_EMISSION
#define LIL_MULTI_INPUTS_EMISSION_2ND
Expand Down Expand Up @@ -86,6 +87,7 @@
#pragma shader_feature_local _SUNDISK_NONE
#pragma shader_feature_local GEOM_TYPE_FROND
#pragma shader_feature_local _REQUIRE_UV2
#pragma shader_feature_local AUTO_KEY_VALUE
#pragma shader_feature_local ANTI_FLICKER
#pragma shader_feature_local _EMISSION
#pragma shader_feature_local GEOM_TYPE_BRANCH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#define LIL_MULTI_INPUTS_MAIN3RD
#define LIL_MULTI_INPUTS_ALPHAMASK
#define LIL_MULTI_INPUTS_SHADOW
#define LIL_MULTI_INPUTS_RIMSHADE
#define LIL_MULTI_INPUTS_BACKLIGHT
#define LIL_MULTI_INPUTS_EMISSION
#define LIL_MULTI_INPUTS_EMISSION_2ND
Expand Down Expand Up @@ -87,6 +88,7 @@
#pragma shader_feature_local _SUNDISK_NONE
#pragma shader_feature_local GEOM_TYPE_FROND
#pragma shader_feature_local _REQUIRE_UV2
#pragma shader_feature_local AUTO_KEY_VALUE
#pragma shader_feature_local ANTI_FLICKER
#pragma shader_feature_local _EMISSION
#pragma shader_feature_local GEOM_TYPE_BRANCH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#define LIL_MULTI_INPUTS_MAIN3RD
#define LIL_MULTI_INPUTS_ALPHAMASK
#define LIL_MULTI_INPUTS_SHADOW
#define LIL_MULTI_INPUTS_RIMSHADE
#define LIL_MULTI_INPUTS_BACKLIGHT
#define LIL_MULTI_INPUTS_EMISSION
#define LIL_MULTI_INPUTS_EMISSION_2ND
Expand Down Expand Up @@ -86,6 +87,7 @@
#pragma shader_feature_local _SUNDISK_NONE
#pragma shader_feature_local GEOM_TYPE_FROND
#pragma shader_feature_local _REQUIRE_UV2
#pragma shader_feature_local AUTO_KEY_VALUE
#pragma shader_feature_local ANTI_FLICKER
#pragma shader_feature_local _EMISSION
#pragma shader_feature_local GEOM_TYPE_BRANCH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#define LIL_MULTI_INPUTS_MAIN3RD
#define LIL_MULTI_INPUTS_ALPHAMASK
#define LIL_MULTI_INPUTS_SHADOW
#define LIL_MULTI_INPUTS_RIMSHADE
#define LIL_MULTI_INPUTS_BACKLIGHT
#define LIL_MULTI_INPUTS_EMISSION
#define LIL_MULTI_INPUTS_EMISSION_2ND
Expand Down Expand Up @@ -80,6 +81,7 @@
#pragma shader_feature_local _SUNDISK_NONE
#pragma shader_feature_local GEOM_TYPE_FROND
#pragma shader_feature_local _REQUIRE_UV2
#pragma shader_feature_local AUTO_KEY_VALUE
#pragma shader_feature_local ANTI_FLICKER
#pragma shader_feature_local _EMISSION
#pragma shader_feature_local GEOM_TYPE_BRANCH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#define LIL_MULTI_INPUTS_MAIN3RD
#define LIL_MULTI_INPUTS_ALPHAMASK
#define LIL_MULTI_INPUTS_SHADOW
#define LIL_MULTI_INPUTS_RIMSHADE
#define LIL_MULTI_INPUTS_BACKLIGHT
#define LIL_MULTI_INPUTS_EMISSION
#define LIL_MULTI_INPUTS_EMISSION_2ND
Expand Down Expand Up @@ -88,6 +89,7 @@
#pragma shader_feature_local _SUNDISK_NONE
#pragma shader_feature_local GEOM_TYPE_FROND
#pragma shader_feature_local _REQUIRE_UV2
#pragma shader_feature_local AUTO_KEY_VALUE
#pragma shader_feature_local ANTI_FLICKER
#pragma shader_feature_local _EMISSION
#pragma shader_feature_local GEOM_TYPE_BRANCH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#define LIL_MULTI_INPUTS_MAIN3RD
#define LIL_MULTI_INPUTS_ALPHAMASK
#define LIL_MULTI_INPUTS_SHADOW
#define LIL_MULTI_INPUTS_RIMSHADE
#define LIL_MULTI_INPUTS_BACKLIGHT
#define LIL_MULTI_INPUTS_EMISSION
#define LIL_MULTI_INPUTS_EMISSION_2ND
Expand Down Expand Up @@ -89,6 +90,7 @@
#pragma shader_feature_local _SUNDISK_NONE
#pragma shader_feature_local GEOM_TYPE_FROND
#pragma shader_feature_local _REQUIRE_UV2
#pragma shader_feature_local AUTO_KEY_VALUE
#pragma shader_feature_local ANTI_FLICKER
#pragma shader_feature_local _EMISSION
#pragma shader_feature_local GEOM_TYPE_BRANCH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#define LIL_MULTI_INPUTS_MAIN3RD
#define LIL_MULTI_INPUTS_ALPHAMASK
#define LIL_MULTI_INPUTS_SHADOW
#define LIL_MULTI_INPUTS_RIMSHADE
#define LIL_MULTI_INPUTS_BACKLIGHT
#define LIL_MULTI_INPUTS_EMISSION
#define LIL_MULTI_INPUTS_EMISSION_2ND
Expand Down Expand Up @@ -88,6 +89,7 @@
#pragma shader_feature_local _SUNDISK_NONE
#pragma shader_feature_local GEOM_TYPE_FROND
#pragma shader_feature_local _REQUIRE_UV2
#pragma shader_feature_local AUTO_KEY_VALUE
#pragma shader_feature_local ANTI_FLICKER
#pragma shader_feature_local _EMISSION
#pragma shader_feature_local GEOM_TYPE_BRANCH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#define LIL_MULTI_INPUTS_MAIN3RD
#define LIL_MULTI_INPUTS_ALPHAMASK
#define LIL_MULTI_INPUTS_SHADOW
#define LIL_MULTI_INPUTS_RIMSHADE
#define LIL_MULTI_INPUTS_BACKLIGHT
#define LIL_MULTI_INPUTS_EMISSION
#define LIL_MULTI_INPUTS_EMISSION_2ND
Expand Down Expand Up @@ -82,6 +83,7 @@
#pragma shader_feature_local _SUNDISK_NONE
#pragma shader_feature_local GEOM_TYPE_FROND
#pragma shader_feature_local _REQUIRE_UV2
#pragma shader_feature_local AUTO_KEY_VALUE
#pragma shader_feature_local ANTI_FLICKER
#pragma shader_feature_local _EMISSION
#pragma shader_feature_local GEOM_TYPE_BRANCH
Expand Down
42 changes: 27 additions & 15 deletions Assets/lilToon/CustomShaderResources/Misc/ReferenceUVs.lilblock
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
Pass
{
Tags { "LightMode" = "Never" }

HLSLPROGRAM
// Unity strips unused UV channels from meshes; unfortunately, in 2022.3.13f1, Unity fails to detect that UV channels
// are used when they are referenced from a pass included via `UsePass`. This fake pass is #included directly into
// each shader to work around this; because this has an invalid lightmode set, it will never actually be executed.
//
// Unity bug report ID: IN-60271
#pragma vertex vert
#pragma fragment frag
// Unity strips unused UV channels from meshes; unfortunately, in 2022.3.13f1, Unity fails to detect that UV channels
// are used when they are referenced from a pass included via `UsePass`. This fake pass is #included directly into
// each shader to work around this; because this has an invalid lightmode set, it will never actually be executed.
//
// Unity bug report ID: IN-60271
#pragma vertex vert
#pragma fragment frag

// For some reason, using struct appdata from lil_common_appdata doesn't work as a workaround...
//#include "Includes/lil_pipeline_brp.hlsl"
//#include "Includes/lil_common.hlsl"
//#include "Includes/lil_common_appdata.hlsl"
// For some reason, using struct appdata from lil_common_appdata doesn't work as a workaround...
//#include "Includes/lil_pipeline_brp.hlsl"
//#include "Includes/lil_common.hlsl"
//#include "Includes/lil_common_appdata.hlsl"


struct appdata
Expand All @@ -23,12 +23,18 @@
float2 uv1 : TEXCOORD1;
float2 uv2 : TEXCOORD2;
float2 uv3 : TEXCOORD3;

float2 uv4 : TEXCOORD4;
float2 uv5 : TEXCOORD5;
float2 uv6 : TEXCOORD6;
float2 uv7 : TEXCOORD7;


float4 color : COLOR;
float3 normalOS : NORMAL;
float4 tangentOS : TANGENT;
#if !defined(SHADER_API_MOBILE) && !defined(SHADER_API_GLES)
uint vertexID : SV_VertexID;
#endif

float4 pos : POSITION;
};
Expand All @@ -46,7 +52,13 @@
// shader so it shows up as an input in the compiled shader program.
output.pos = float4(0,0,0,1);
output.col = float4(input.uv, input.uv1) + float4(input.uv2, input.uv3)
+ float4(input.uv4, input.uv5) + float4(input.uv6, input.uv7);
+ float4(input.uv4, input.uv5) + float4(input.uv6, input.uv7)
+ input.color + float4(input.normalOS, 1) + input.tangentOS;

#if !defined(SHADER_API_MOBILE) && !defined(SHADER_API_GLES)
output.col.a += input.vertexID;
#endif

return output;
}

Expand Down
16 changes: 16 additions & 0 deletions Assets/lilToon/CustomShaderResources/Properties/Default.lilblock
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,16 @@
_ShadowFlatBorder ("sBorder", Range(-2, 2)) = 1
_ShadowFlatBlur ("sBlur", Range(0.001, 2)) = 1

//----------------------------------------------------------------------------------------------------------------------
// Rim Shade
[lilToggleLeft] _UseRimShade ("RimShade", Int) = 0
_RimShadeColor ("sColor", Color) = (0.5,0.5,0.5,1.0)
[NoScaleOffset] _RimShadeMask ("Mask", 2D) = "white" {}
_RimShadeNormalStrength ("sNormalStrength", Range(0, 1)) = 1.0
_RimShadeBorder ("sBorder", Range(0, 1)) = 0.5
_RimShadeBlur ("sBlur", Range(0, 1)) = 1.0
[PowerSlider(3.0)]_RimShadeFresnelPower ("sFresnelPower", Range(0.01, 50)) = 1.0

//----------------------------------------------------------------------------------------------------------------------
// Reflection
[lilToggleLeft] _UseReflection ("sReflection", Int) = 0
Expand Down Expand Up @@ -445,6 +455,12 @@

//----------------------------------------------------------------------------------------------------------------------
// ID Mask

// _IDMaskCompile will enable compilation of IDMask-related systems. For compatibility, setting certain
// parameters to non-zero values will also enable the IDMask feature, but this enable switch ensures that
// animator-controlled IDMasked meshes will be compiled correctly. Note that this _only_ controls compilation,
// and is ignored at runtime.
[ToggleUI] _IDMaskCompile ("_IDMaskCompile", Int) = 0
[lilEnum] _IDMaskFrom ("_IDMaskFrom|0: UV0|1: UV1|2: UV2|3: UV3|4: UV4|5: UV5|6: UV6|7: UV7|8: VertexID", Int) = 8
[ToggleUI] _IDMask1 ("_IDMask1", Int) = 0
[ToggleUI] _IDMask2 ("_IDMask2", Int) = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,16 @@
_ShadowFlatBorder ("sBorder", Range(-2, 2)) = 1
_ShadowFlatBlur ("sBlur", Range(0.001, 2)) = 1

//----------------------------------------------------------------------------------------------------------------------
// Rim Shade
[lilToggleLeft] _UseRimShade ("RimShade", Int) = 0
_RimShadeColor ("sColor", Color) = (0.5,0.5,0.5,1.0)
[NoScaleOffset] _RimShadeMask ("Mask", 2D) = "white" {}
_RimShadeNormalStrength ("sNormalStrength", Range(0, 1)) = 1.0
_RimShadeBorder ("sBorder", Range(0, 1)) = 0.5
_RimShadeBlur ("sBlur", Range(0, 1)) = 1.0
[PowerSlider(3.0)]_RimShadeFresnelPower ("sFresnelPower", Range(0.01, 50)) = 1.0

//----------------------------------------------------------------------------------------------------------------------
// Reflection
[lilToggleLeft] _UseReflection ("sReflection", Int) = 0
Expand Down Expand Up @@ -445,6 +455,7 @@

//----------------------------------------------------------------------------------------------------------------------
// ID Mask
[ToggleUI] _IDMaskCompile ("_IDMaskCompile", Int) = 0
[lilEnum] _IDMaskFrom ("_IDMaskFrom|0: UV0|1: UV1|2: UV2|3: UV3|4: UV4|5: UV5|6: UV6|7: UV7|8: VertexID", Int) = 8
[ToggleUI] _IDMask1 ("_IDMask1", Int) = 0
[ToggleUI] _IDMask2 ("_IDMask2", Int) = 0
Expand Down
Loading

0 comments on commit 78121ce

Please sign in to comment.