Skip to content

Commit

Permalink
1.2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
lilxyzw committed Dec 13, 2021
1 parent cfbdba4 commit 0042bb7
Show file tree
Hide file tree
Showing 84 changed files with 3,107 additions and 710 deletions.
16 changes: 16 additions & 0 deletions Assets/lilToon/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@ 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.2.7] - 2021-12-13
### Added
- Normal map for adjusting the direction of pushing out the outline
- Outline / Fur only shader
- Property to adjust the strength of parallax during VR to rim light

### Changed
- Show render queue in base settings as well
- Disable stencil in HDRP
- Changed so that fur shadows appear stronger in HDRP

### Fixed
- Fixed refraction shader behavior in Single Pass Instanced
- Fixed render queue for transparent shaders in HDRP
- Fixed motion vector in HDRP

## [1.2.6] - 2021-12-01
### Added
- Custom UV for some textures
Expand Down
16 changes: 16 additions & 0 deletions Assets/lilToon/CHANGELOG_JP.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@ 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.2.7] - 2021-12-13
### 追加
- 輪郭線を押し出す方向を調整できるノーマルマップを追加
- 輪郭線のみ、ファーのみのシェーダーを追加
- リムライトにVR時の視差の強さを調整する機能を追加

### 変更
- Render Queueを基本設定にも表示
- HDRPでステンシルを無効化
- HDRPでファーの影が濃く出るように変更

### 修正
- Single Pass Instanced環境での屈折シェーダーの動作を修正
- HDRPでの透過シェーダーのRender Queueを修正
- HDRPでのモーションベクターの出力を修正

## [1.2.6] - 2021-12-01
### 追加
- いくつかのテクスチャにカスタムUVを追加
Expand Down
1 change: 1 addition & 0 deletions Assets/lilToon/Editor/lang.txt
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ sSettingAnimateOutlineUV Animate Outline UV 輪郭線UVアニメーション 윤
sSettingTexOutlineColor Outline Color Texture 輪郭線色テクスチャ 윤곽선 색상 질감 轮廓颜色纹理 輪廓顏色紋理
sSettingOutlineToneCorrection Outline Tone Correction 色調補正 색상 보정 轮廓色调校正 輪廓色調校正
sSettingTexOutlineWidth Outline Width Mask 輪郭線太さマスク 윤곽선 두께 마스크 轮廓宽度掩码 輪廓寬度掩碼
sSettingTexOutlineNormal Outline Normal Map 輪郭線ノーマルマップ 윤곽선 노멀 맵 轮廓法线贴图 輪廓法線貼圖
sSettingTexFurNormal Fur Normal Map ファーノーマルマップ 퍼 노멀 맵 毛皮法线贴图 毛皮法線貼圖
sSettingTexFurMask Fur Mask ファーマスク 퍼 마스크 毛皮蒙版 毛皮蒙版
sSettingTexFurLength Fur Length Mask ファー長さマスク 퍼 길이 마스크 毛皮长度蒙版 毛皮長度蒙版
Expand Down
287 changes: 171 additions & 116 deletions Assets/lilToon/Editor/lilInspector.cs

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Assets/lilToon/Editor/lilToonSetting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public class lilToonSetting : ScriptableObject
public bool LIL_FEATURE_TEX_DISSOLVE_NOISE;
public bool LIL_FEATURE_TEX_OUTLINE_COLOR;
public bool LIL_FEATURE_TEX_OUTLINE_WIDTH;
public bool LIL_FEATURE_TEX_OUTLINE_NORMAL;
public bool LIL_FEATURE_TEX_FUR_NORMAL;
public bool LIL_FEATURE_TEX_FUR_MASK;
public bool LIL_FEATURE_TEX_FUR_LENGTH;
Expand Down
15 changes: 14 additions & 1 deletion Assets/lilToon/MANUAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# Table of Contents
- [Terms](#terms)
- [Shader variation](#shader-variation)
- [Upper part of Inspector](#upper-part-of-inspector)
- [Base Setting](#base-setting)
- [UV Setting](#uv-setting)
Expand Down Expand Up @@ -55,6 +56,16 @@

<br/>

# Shader variation
|名前|説明|
|-|-|
|lilToon|This is the main shader. Use this one for general purposes.|
|_lil/[Optional] lilToonOverlay|This is a transparent shader to be displayed on top of a material. Unnecessary passes are removed, and the performance is better than layering a normal transparent shader.|
|_lil/[Optional] lilToonOutlineOnly|This is an outline-only shader. For example, if you want to draw outlines on a model with hard edges, you can prepare a mesh with smooth normals separately and assign this shader to it to draw smooth outlines.|
|_lil/[Optional] lilToonFurOnly|This shader draws only the fins of fur. Recommended for layering on top of normal shaders or combining cutout fur and transparent fur.|

<br/>

# Upper part of Inspector
|Name|Description|
|-|-|
Expand Down Expand Up @@ -321,6 +332,7 @@ You can blend colors into the main color. This is the layer function in painting
|Light direction strength|Influence of light direction.|
|Direct light width|Range of direct light.|
|Indirect light width|Range of indirect light (shadow).|
|VR Parallax Strength|Strength of parallax in VR.|

### Glitter
|Name|Description|
Expand Down Expand Up @@ -377,10 +389,11 @@ You can blend colors into the main color. This is the layer function in painting
|Value|Lightness or darkness of a color.|
|Gamma|Emphasizes contrast.|
|Bake|Export the color-corrected texture.|
|Enable Lighting|Apply changes in brightness due to lighting.|
|Mask & Width|Width of outline. The outline does not appear in the area painted black by the mask.|
|Fix Width|Correct width changes with distance.|
|Vertex R -> Width|Apply the R value of vertex color to the width.|
|Enable Lighting|Apply changes in brightness due to lighting.|
|Normal Map|Control outline vectors with Normal Map.|

<br/>

Expand Down
15 changes: 14 additions & 1 deletion Assets/lilToon/MANUAL_JP.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# 目次
- [登場する用語](#登場する用語)
- [シェーダーバリエーション](#シェーダーバリエーション)
- [Inspector上部](#inspector上部)
- [基本設定](#基本設定)
- [UV設定](#uv設定)
Expand Down Expand Up @@ -55,6 +56,16 @@

<br/>

# シェーダーバリエーション
|名前|説明|
|-|-|
|lilToon|メインのシェーダーです。一般的な用途ではこれを使用します。|
|_lil/[Optional] lilToonOverlay|マテリアルの上に重ねて表示するための透過シェーダーです。不要なパスが除去されており、通常の透過シェーダーを重ねるより低負荷です。|
|_lil/[Optional] lilToonOutlineOnly|輪郭線のみのシェーダーです。例えば、ハードエッジのモデルで輪郭線を描画する場合に別途法線がスムーズなメッシュを用意してこのシェーダーを割り当てることにより、通常より綺麗な輪郭線を描画できます。|
|_lil/[Optional] lilToonFurOnly|ファーの毛の部分のみを描画するシェーダーです。通常のシェーダーに重ねる表現や、カットアウトのファーと透過のファーを組み合わせた表現をする場合にオススメです。|

<br/>

# Inspector上部
|名前|説明|
|-|-|
Expand Down Expand Up @@ -322,6 +333,7 @@ FakeShadowを使用する場合は以下のようにステンシル設定を変
|ライト方向の影響度|ライト方向によってリムライトをカスタマイズできます。|
|直接光の幅|直接光の範囲です。|
|関節光の幅|環境光(影)の範囲です。|
|VR時の視差の強さ|VR時の視差の強さを変更し「ギラギラ感」を調整します。|

### ラメ
|名前|説明|
Expand Down Expand Up @@ -378,10 +390,11 @@ FakeShadowを使用する場合は以下のようにステンシル設定を変
|明度|色の明るさです。|
|ガンマ|コントラストを強調します。|
|焼き込み|色調補正したテクスチャを書き出します。|
|ライティングを適用|ライティングによる明るさの変化を適用します。|
|マスクと太さ|輪郭線の太さです。マスクを指定すると黒く塗った部分に輪郭線が出なくなります。|
|太さを補正|距離による太さの変化を補正します。|
|Vertex R -> Width|頂点カラーのR値を太さに適用します。|
|ライティングを適用|ライティングによる明るさの変化を適用します|
|ノーマルマップ|ノーマルマップを指定することで輪郭線を押し出す方向を調整できます|

<br/>

Expand Down
4 changes: 2 additions & 2 deletions Assets/lilToon/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# lilToon
Version 1.2.6
Version 1.2.7

# Overview
This shader is developed for services using avatars (VRChat, etc.) and has the following features.
Expand All @@ -21,7 +21,7 @@ Tested version
- Unity 2019.4.31f1 (Built-in RP / URP 7.7.1 / HDRP 7.7.1)
- Unity 2020.3.20f1 (Built-in RP / URP 10.6.0 / HDRP 10.6.0)
- Unity 2021.1.24f1 (Built-in RP / URP 11.0.0 / HDRP 11.0.0)
- Unity 2021.2.2f1 (Built-in RP / URP 12.1.1 / HDRP 12.1.1)
- Unity 2021.2.6f1 (Built-in RP / URP 12.1.2 / HDRP 12.1.2)

Supported Shader Models
- Normal: SM4.0 / ES3.0 or later
Expand Down
4 changes: 2 additions & 2 deletions Assets/lilToon/README_JP.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# lilToon
Version 1.2.6
Version 1.2.7

# 概要
アバターを用いたサービス(VRChat等)向けに開発したシェーダーで以下のような特徴があります。
Expand All @@ -21,7 +21,7 @@ Unityバージョン
- Unity 2019.4.31f1 (Built-in RP / URP 7.7.1 / HDRP 7.7.1)
- Unity 2020.3.20f1 (Built-in RP / URP 10.6.0 / HDRP 10.6.0)
- Unity 2021.1.24f1 (Built-in RP / URP 11.0.0 / HDRP 11.0.0)
- Unity 2021.2.2f1 (Built-in RP / URP 12.1.1 / HDRP 12.1.1)
- Unity 2021.2.6f1 (Built-in RP / URP 12.1.2 / HDRP 12.1.2)

シェーダーモデル
- 通常版: SM4.0・ES3.0以降
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ Shader "#NAME#"
_RimEnableLighting ("Enable Lighting", Range(0, 1)) = 1
_RimShadowMask ("Shadow Mask", Range(0, 1)) = 0
[lilToggle] _RimBackfaceMask ("Backface Mask", Int) = 0
_RimVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1
[lilToggle] _RimApplyTransparency ("Apply Transparency", Int) = 1
_RimDirStrength ("Light direction strength", Range(0, 1)) = 0
_RimDirRange ("Direction range", Range(-1, 1)) = 0
Expand Down Expand Up @@ -433,6 +434,8 @@ Shader "#NAME#"
[NoScaleOffset] _OutlineWidthMask ("Width", 2D) = "white" {}
[lilToggle] _OutlineFixWidth ("Fix Width", Int) = 1
[lilToggle] _OutlineVertexR2Width ("Vertex R -> Width", Int) = 0
[NoScaleOffset][Normal] _OutlineVectorTex ("Vector", 2D) = "bump" {}
_OutlineVectorScale ("Vector scale", Range(-10,10)) = 1
_OutlineEnableLighting ("Enable Lighting", Range(0, 1)) = 1

//----------------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -2540,13 +2543,10 @@ Shader "#NAME#"

Stencil
{
Ref [_StencilRef]
ReadMask [_StencilReadMask]
WriteMask [_StencilWriteMask]
Comp [_StencilComp]
Pass [_StencilPass]
Fail [_StencilFail]
ZFail [_StencilZFail]
WriteMask 8
Ref 0
Comp Always
Pass Replace
}
Cull Back
ZClip [_ZClip]
Expand Down Expand Up @@ -2604,8 +2604,8 @@ Shader "#NAME#"

Stencil
{
WriteMask [_StencilWriteMaskMV]
Ref [_StencilRefMV]
WriteMask 40
Ref 32
Comp Always
Pass Replace
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1476,13 +1476,10 @@ Shader "Hidden/#NAME#"

Stencil
{
Ref [_StencilRef]
ReadMask [_StencilReadMask]
WriteMask [_StencilWriteMask]
Comp [_StencilComp]
Pass [_StencilPass]
Fail [_StencilFail]
ZFail [_StencilZFail]
WriteMask 8
Ref 0
Comp Always
Pass Replace
}
Cull [_Cull]
ZClip [_ZClip]
Expand Down Expand Up @@ -1523,13 +1520,10 @@ Shader "Hidden/#NAME#"

Stencil
{
Ref [_StencilRef]
ReadMask [_StencilReadMask]
WriteMask [_StencilWriteMask]
Comp [_StencilComp]
Pass [_StencilPass]
Fail [_StencilFail]
ZFail [_StencilZFail]
WriteMask 8
Ref 0
Comp Always
Pass Replace
}
Cull Back
ZClip [_ZClip]
Expand Down Expand Up @@ -1573,8 +1567,8 @@ Shader "Hidden/#NAME#"

Stencil
{
WriteMask [_StencilWriteMaskMV]
Ref [_StencilRefMV]
WriteMask 40
Ref 32
Comp Always
Pass Replace
}
Expand Down Expand Up @@ -1617,8 +1611,8 @@ Shader "Hidden/#NAME#"

Stencil
{
WriteMask [_StencilWriteMaskMV]
Ref [_StencilRefMV]
WriteMask 40
Ref 32
Comp Always
Pass Replace
}
Expand Down
2 changes: 1 addition & 1 deletion Assets/lilToon/Shader/Includes/lil_common_appdata.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
#define LIL_APP_NORMAL
#endif

#if defined(LIL_REQUIRE_APP_TANGENT) || ((defined(LIL_PASS_FORWARD_NORMAL_INCLUDED) || defined(LIL_GEM)) && defined(LIL_SHOULD_TANGENT) && !defined(LIL_OUTLINE) && !defined(LIL_FUR)) || defined(LIL_PASS_FORWARD_FUR_INCLUDED) || (!defined(LIL_PASS_FORWARD_NORMAL_INCLUDED) && defined(LIL_FUR)) || defined(LIL_BAKER)
#if defined(LIL_REQUIRE_APP_TANGENT) || ((defined(LIL_PASS_FORWARD_NORMAL_INCLUDED) || defined(LIL_GEM)) && defined(LIL_SHOULD_TANGENT) && !defined(LIL_OUTLINE) && !defined(LIL_FUR)) || defined(LIL_OUTLINE) && defined(LIL_FEATURE_TEX_OUTLINE_NORMAL) || defined(LIL_PASS_FORWARD_FUR_INCLUDED) || (!defined(LIL_PASS_FORWARD_NORMAL_INCLUDED) && defined(LIL_FUR)) || defined(LIL_BAKER)
#define LIL_APP_TANGENT
#endif

Expand Down
20 changes: 11 additions & 9 deletions Assets/lilToon/Shader/Includes/lil_common_frag.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,7 @@
#endif

// UV
float2 matUV = lilCalcMatCapUV(fd.uv1, N, fd.V, fd.headV, _MatCapTex_ST, _MatCapBlendUV1.xy, _MatCapZRotCancel, _MatCapPerspective, _MatCapVRParallaxStrength);
float2 matUV = lilCalcMatCapUV(fd.uv1, normalize(N), fd.V, fd.headV, _MatCapTex_ST, _MatCapBlendUV1.xy, _MatCapZRotCancel, _MatCapPerspective, _MatCapVRParallaxStrength);

// Color
float4 matCapColor = _MatCapColor;
Expand Down Expand Up @@ -1230,13 +1230,8 @@
#if defined(LIL_FEATURE_RIMLIGHT) && !defined(LIL_LITE) && !defined(LIL_FUR)
void lilGetRim(inout lilFragData fd LIL_SAMP_IN_FUNC(samp))
{
#if !defined(LIL_PASS_FORWARDADD)
LIL_BRANCH
if(_UseRim)
#else
LIL_BRANCH
if(_UseRim)
#endif
LIL_BRANCH
if(_UseRim)
{
#if defined(LIL_FEATURE_RIMLIGHT_DIRECTION)
// Color
Expand All @@ -1249,12 +1244,19 @@
rimIndirColor *= rimColorTex;
}

// View direction
#if defined(USING_STEREO_MATRICES)
float3 V = lerp(fd.headV, fd.V, _RimVRParallaxStrength);
#else
float3 V = fd.V;
#endif

// Normal
float3 N = fd.N;
#if defined(LIL_FEATURE_NORMAL_1ST) || defined(LIL_FEATURE_NORMAL_2ND)
N = lerp(fd.origN, fd.N, _RimNormalStrength);
#endif
float nvabs = abs(dot(N,fd.V));
float nvabs = abs(dot(N,V));

// Factor
float lnRaw = dot(fd.L, N) * 0.5 + 0.5;
Expand Down
21 changes: 17 additions & 4 deletions Assets/lilToon/Shader/Includes/lil_common_frag_alpha.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,23 @@
// This is included in the subpass fragment shader
#define LIL_ALPHA_PS
#if LIL_RENDER > 0
BEFORE_ANIMATE_MAIN_UV
OVERRIDE_ANIMATE_MAIN_UV
#if defined(LIL_OUTLINE)
BEFORE_ANIMATE_OUTLINE_UV
OVERRIDE_ANIMATE_OUTLINE_UV
#else
BEFORE_ANIMATE_MAIN_UV
OVERRIDE_ANIMATE_MAIN_UV
#endif

//------------------------------------------------------------------------------------------------------------------------------
// Main Color
BEFORE_MAIN
OVERRIDE_MAIN
#if defined(LIL_OUTLINE)
BEFORE_OUTLINE_COLOR
OVERRIDE_OUTLINE_COLOR
#else
BEFORE_MAIN
OVERRIDE_MAIN
#endif

//------------------------------------------------------------------------------------------------------------------------------
// Alpha Mask
Expand Down Expand Up @@ -39,6 +49,9 @@
#if LIL_RENDER == 2 && !defined(SHADER_API_GLES)
// Dither
float alphaRef = fd.col.a;
#if defined(LIL_FUR) && defined(LIL_V2F_FURLAYER) && defined(SHADERPASS) && (SHADERPASS == SHADERPASS_SHADOWS)
fd.col.a = saturate(fd.col.a*5.0);
#endif
#if LIL_SUBPASS_TRANSPARENT_MODE == 1 || defined(SHADERPASS) && (SHADERPASS == SHADERPASS_SHADOWS)
alphaRef = LIL_SAMPLE_3D(_DitherMaskLOD, sampler_DitherMaskLOD, float3(input.positionCS.xy*0.25,fd.col.a*0.9375)).a;
#elif LIL_SUBPASS_TRANSPARENT_MODE == 0 && defined(LIL_PASS_SHADOWCASTER_INCLUDED)
Expand Down
Loading

0 comments on commit 0042bb7

Please sign in to comment.