Skip to content

Commit

Permalink
fix editor & light bake
Browse files Browse the repository at this point in the history
  • Loading branch information
lilxyzw committed Jul 16, 2021
1 parent 8580753 commit a76250a
Show file tree
Hide file tree
Showing 10 changed files with 140 additions and 53 deletions.
1 change: 1 addition & 0 deletions Assets/lilToon/Editor/lang.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ sScaleY Scale Y Y軸サイズ Y 축 크기 Y尺度 Y尺度
sVector Vector 向き 방향 向量 向量
sLength Length 長さ 길이 长度 長度
sVertex Vertex 頂点 정점 顶点 頂點
sColorAlphaZeroWarn To enable the property, increase the alpha value. プロパティを有効にするには透明度の値を上げて下さい。 속성을 활성화하려면 Alpha 값을 올려주세요. 增加 Alpha 值以启用该属性。 增加 Alpha 值以啟用該屬性。
sApplyTransparency Apply Transparency 透明度を適用 투명도 적용 应用透明度 應用透明度
sReset Reset 初期化 초기화 重置 重置
sLimShadowStrength Shadow Strength 影の強さ 그림자의 힘 阴影强度 陰影強度
Expand Down
154 changes: 108 additions & 46 deletions Assets/lilToon/Editor/lilInspector.cs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Assets/lilToon/Editor/lilStartup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace lilToon
public class lilStartup {
//------------------------------------------------------------------------------------------------------------------------------
// Enum
enum lilRenderPipeline
public enum lilRenderPipeline
{
BRP,
LWRP,
Expand Down Expand Up @@ -145,7 +145,7 @@ static IEnumerator GetLatestVersionInfo()
}
}

static void RewriteShaderRP(string shaderPath, lilRenderPipeline lilRP)
public static void RewriteShaderRP(string shaderPath, lilRenderPipeline lilRP)
{
string path = shaderPath;
StreamReader sr = new StreamReader(path);
Expand Down
12 changes: 12 additions & 0 deletions Assets/lilToon/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ lilToon is available under the MIT License. Please refer to the `LICENSE` includ

Please refer to the [manual](https://github.com/lilxyzw/lilToon/blob/master/Assets/lilToon/MANUAL.md) for more detailed settings.

# Usage - Update
1. Import lilToon into Unity using one of the following methods.
i. Drag and drop unitypackage to the Unity window to import it.
ii. Import ```https://github.com/lilxyzw/lilToon.git?path=Assets/lilToon#master``` from UPM.
2. Click `Assets/lilToon/Refresh Shaders` in the top menu bar.

# How to distribute your works that use lilToon
Shader settings are stored in the `lilToonSetting` folder, so it is recommended to include this folder in the unitypackage.
If you have not changed shader settings, you do not need to include them.
Expand All @@ -69,6 +75,8 @@ The following is the detailed procedure.
6. Press `Export...` to save the unitypackage.

# Common Problems
- Material error has occurred.
→ Clicking `Assets/lilToon/Refresh Shaders` in the top menu bar may help.
- The shadows on face are dirty.
→ You can specify a mask texture in `Mask & Strength` to partially remove shadows.
- Outline becomes dirty.
Expand Down Expand Up @@ -97,6 +105,10 @@ Comparing parameters when implementing `Convert to MToon (VRM)`
- [視差オクルージョンマッピング(parallax occlution mapping) (コポコポ)](https://coposuke.hateblo.jp/entry/2019/01/20/043042)

# Change log
## v1.1.1
- Show warning when property alpha is 0
- Support for changing editor theme
- Added shader refresh
## v1.1
- Added Alpha Mask
- Added MatCap 2nd
Expand Down
12 changes: 12 additions & 0 deletions Assets/lilToon/README_JP.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ MIT Licenseで公開しています。同梱の`LICENSE`をご確認ください

より詳しい設定については[マニュアル](https://github.com/lilxyzw/lilToon/blob/master/Assets/lilToon/MANUAL_JP.md)を参照してください。

# 使い方 - アップデート
1. 下記いずれかの方法でUnityにlilToonをインポート
i. unitypackageをUnityウィンドウにドラッグ&ドロップでインポート
ii. UPMから```https://github.com/lilxyzw/lilToon.git?path=Assets/lilToon#master```をインポート
2. 上部メニューバーの`Assets/lilToon/Refresh Shaders`をクリック

# lilToonを用いた制作物の配布手順について
`lilToonSetting`フォルダにシェーダー設定が保存されているためこちらも含めてunitypackage化することをオススメします。
シェーダー設定を変更していない場合は同梱する必要はありません。
Expand All @@ -69,6 +75,8 @@ MIT Licenseで公開しています。同梱の`LICENSE`をご確認ください
6. `Export...`を押してunitypackageを保存

# よくあるトラブル
- マテリアルエラーが発生した
→ 上部メニューバーの`Assets/lilToon/Refresh Shaders`をクリックすると改善される場合があります
- 顔にかかる影が気になる
`マスクと強度`にマスクテクスチャを指定することで部分的に影を消すことができます。
- 輪郭線が汚くなる
Expand Down Expand Up @@ -97,6 +105,10 @@ MIT Licenseで公開しています。同梱の`LICENSE`をご確認ください
- [視差オクルージョンマッピング(parallax occlution mapping) (コポコポ)](https://coposuke.hateblo.jp/entry/2019/01/20/043042)

# 変更履歴
## v1.1.1
- プロパティのアルファが0のときに警告を表示
- エディターのテーマ変更に対応
- シェーダーリフレッシュの追加
## v1.1
- アルファマスクの追加
- マットキャップ2ndの追加
Expand Down
2 changes: 1 addition & 1 deletion Assets/lilToon/Shader/Includes/lil_macro.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@
float3 lightColor = _MainLightColor.rgb; \
float3 lightDirection = lilGetLightDirection(); \
float3 lightmapColor = lilGetLightMapColor(input.uvLM); \
lightColor = saturate(lightColor + max(lightmapColor,lilGetSHLength()))
lightColor = saturate(lightColor + max(lightmapColor,lilGetSHToon()))
#elif defined(LIL_USE_LIGHTMAP) && defined(LIL_USE_DYNAMICLIGHTMAP)
// Mixed Lightmap (Baked Indirect) or Lightmap (Non-Directional)
#undef LIL_USE_DYNAMICLIGHTMAP
Expand Down
2 changes: 1 addition & 1 deletion Assets/lilToon/Shader/lts_overlay.shader
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Shader "_lil/lilToonOverlay"
Shader "_lil/[Optional] lilToonOverlay"
{
Properties
{
Expand Down
2 changes: 1 addition & 1 deletion Assets/lilToon/Shader/ltsl_overlay.shader
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Shader "_lil/lilToonLiteOverlay"
Shader "_lil/[Optional] lilToonLiteOverlay"
{
Properties
{
Expand Down
2 changes: 1 addition & 1 deletion Assets/lilToon/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "jp.lilxyzw.liltoon",
"displayName": "lilToon",
"version": "1.1a",
"version": "1.1.1",
"unity": "2017.1",
"description": "Feature-rich toon shader.",
"keywords": ["Toon", "Shader", "Material"],
Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"latest_vertion_name": "1.1a", "latest_vertion_value": 3}
{"latest_vertion_name": "1.1.1", "latest_vertion_value": 4}

0 comments on commit a76250a

Please sign in to comment.