OBOROZUKI
2D moon shader for VRChat worlds

Copyright (c) 2026 NiAka

============================================================
日本語
============================================================

概要
----

Oborozuki (朧月)は、VRChatワールド向けの2D月シェーダーです。
Unity Built-in Render Pipelineで動作し、PCとQuest (Android)で
別々のサブシェーダーを使い分けます。

皆既日食の写真を参考にした2層構造のHDR光輪 (細いリングと外へ
広がるコロナ)を持ちます。カメラ側のBloomと組み合わせると、
月の裏側から光がにじむような見え方になります。

朧月は、霞や光のにじみで輪郭がやわらかく見える月を指す言葉です。

配布・導入
----------

VCC / ALCOMをお使いの場合は、VPMリポジトリからの導入をおすすめします。
https://vpm.2aka.io/

パッケージページ
https://vpm.2aka.io/packages/com.niaka.oborozuki

BOOTH商品ページ
https://niaka.booth.pm/items/8320267

BOOTHダウンロード版には.unitypackageと、VPMリポジトリ追加用の
ショートカットを同梱しています。VCC / ALCOMにリポジトリを追加してから、
Oborozukiをプロジェクトへ追加してください。

更新方法
--------

VCC / ALCOMに https://vpm.2aka.io/ を登録していれば、新しいバージョンは
一覧に表示されます。更新はその画面から行えます。

.unitypackageを直接インポートした場合は自動で更新されません。新しい
バージョンが出るたびに手作業で入れ替えることになります。そのため、VPMリポジトリ
経由での導入に切り替えることをおすすめします。

.unitypackage版とVPM版を同じプロジェクトへ重複して追加しないでください。
どちらか一方だけを導入してください。

1.0.0の.unitypackageからVPM版へ移る場合は、先に
Assets/NiAka/Contents/Oborozukiフォルダを削除してから導入してください。
マテリアルとPrefabは同じGUIDのまま移設しているため、シーンに置いた
月の参照はそのまま残ります。

必要環境
--------

・Unity 2022.3 LTS
・VRChat Worlds SDK 3.10.4以降の互換環境
・Unity Built-in Render Pipeline
・PC (Windows / macOS)で動作確認済み
・Quest (Android) 向けの軽量サブシェーダーを同梱していますが、
  実機での見え方は未確認です

同梱のサンプルシーンをそのまま開く場合は、VRChat Worlds SDK、
Unity UI (UGUI)、Input System、Post Processingが入ったVCCの
Worldプロジェクトを使ってください。

VRC Light Volumes (red.sim.lightvolumes)とBakeryは任意の連携先です。
未導入の場合は、マテリアル側の該当項目をOFFのままにしてください。

セットアップ
------------

1. Runtime/PrefabsのMoon_Gold_1、Moon_Blue_1、Moon_SolarEclipseなどを
   シーンにドラッグします。
2. ワールドに合わせて位置・回転・大きさを調整します。
3. マテリアルのInspectorでHalo / Phase / Glow / Lightingを調整します。
4. カメラのPost ProcessingでBloomを有効にします。
   Intensity 0.5〜1.0、Threshold 0.9あたりが目安です。
5. 見え方はGameビューで確認します。SceneビューではPost Processingが
   無効なことがあり、HDRの光り方を正しく確認できません。

同梱のRuntime/Scenes/OborozukiSampleScene.unityに、カメラと
Post Processingの設定例を用意しています。

使い方
------

自分のテクスチャを使う
  透過済みのRGBA月テクスチャを貼ったOborozukiのマテリアルを、付属の
  Runtime/Meshes/OborozukiQuadに割り当てます。OborozukiQuadは、Unity標準の
  Quadと同じ形で、boundsだけを広げたメッシュです。BillboardやHalo Mesh
  Extrudeを使っても、画面の端で月が欠けません。フチに黒い線や白い線が
  出る場合は、テクスチャのアルファパディングを見直してください。

Inspector:
  13個の折りたたみセクションに分かれています。セクションごとに
  「規定値にリセット」ボタンがあり、そのセクションだけ元に戻せます。
  表示言語は上部のトグルで、日本語 / English / 한국어 / 简体中文から
  選べます。

設定の考え方
------------

Billboard:
  GeometryセクションのBillboardをONにすると、月が常に見ている人の方を
  向きます。斜めから見ても月は丸いままです。オブジェクトの回転は使われず、
  位置と大きさだけが反映されます。ScaleはX・Y・Zをそろえてください。
  VRでは両目の中央、ミラーやカメラではそれぞれの視点を基準に向きます。

Halo:
  Geometryセクションの_HaloExtrudeでQuadを外側へ広げ、_HaloAlphaで
  透明部分のアルファを持ち上げます。さらに_HaloEmissiveのHDRリングと
  _HaloCoronaの広がりを足します。_HaloGapFillはテクスチャ外周と
  リングの隙間を埋めます。

Phase:
  _PhaseOnで月相を有効にし、_PhaseAngleDegで満ち欠けの向き、
  _PhaseCurvatureで明暗の境界線のカーブを決めます。リングとコロナは
  月相の暗化より後に加算するため、新月でも縁の光は残ります。

Oboro:
  _OboroOnをONにすると、薄い霞の向こうに見える月になります。_OboroBlurで
  輪郭と模様をぼかし、_OboroVeilで模様を薄めます。まわりの暈は
  _OboroGlowColorと_OboroGlowRadiusで調整します。_OboroCloudを上げると、
  月の前を薄雲が流れます。ぼかしにはテクスチャのミップマップを使います。

Lighting:
  VRC Light VolumesとBakeryはPC専用の任意連携です。Quest用の
  軽量サブシェーダーでは、命令数に収めるため無効化されます。

ビルド時の最適化
  影や頂点ライトなど、シェーダーが使わないライティング用のキーワードは
  組み合わせに含めていません。VRChatのワールドをビルドするときは、シーンで
  使っているOborozukiのマテリアルから効果のないキーワードを除外します。
  どちらも見た目は変わらず、ビルドの時間と容量が減ります。

推奨マテリアル設定
------------------

皆既日食風の光輪

  _RimOn            = ON
  _RimRadiusInner   = 0.92
  _RimRadiusOuter   = 1.00
  _RimSoftness      = 0.005
  _HaloEmissive     = HDR(1, 0.95, 0.85) intensity 3〜6
  _HaloCorona       = ON
  _HaloCoronaRadius = 2.0
  _HaloCoronaPower  = 3.0
  _HaloCoronaTint   = HDR(1, 0.92, 0.78) intensity 2〜4
  _HaloExtrude      = 0.5
  _HaloAlpha        = 0.4
  _HaloGapFill      = 1.0
  _HaloGapFillWidth = 0.15
  _HaloSoftCutoff   = 0.05

朧月 (霞の向こうの月)

  _OboroOn          = ON
  _OboroBlur        = 0.35
  _OboroVeil        = 0.35
  _OboroGlowColor   = HDR(0.35, 0.42, 0.55)
  _OboroGlowRadius  = 1.0
  _OboroCloud       = 0.3 (薄雲を流す場合)

よく使う月相

  満月        _PhaseOn=OFF、_RimIntensity高め、_EdgeBurstStrength 2
  三日月      _PhaseOn=ON、_PhaseAngleDeg=130、_PhaseShadowMin=0.1
  半月        _PhaseOn=ON、_PhaseAngleDeg=90または -90
  地球照      _PhaseShadowMin=0.15、_PhaseShadowTint=(0.3, 0.4, 0.6)
  鋭い三日月  _PhaseOn=ON、_PhaseCurvature=1.4

対応プラットフォーム
--------------------

  PC (DirectX / Metal)   通常のサブシェーダー。動作確認済みです。
  Quest 2 / 3 / Pro      軽量サブシェーダーを同梱しています。Bakeryの
                         RNM / MonoSH / LMSpecとVRC Light Volumesは
                         無効化され、光輪・月相・リムは残ります。
                         Quest実機での見え方は未確認です。導入する場合は
                         ご自身のワールドで確認してください。

トラブルシューティング
----------------------

光輪が光って見えない
  HDRの効果はカメラのBloomが前提です。Post ProcessingのBloomを
  有効にし、Gameビューで確認してください。

月が他の透明オブジェクトの前後に回り込む
  Transparentキュー / ZWrite OFFで描画するため、描画順の影響を受けます。
  マテリアルのRender Queueを前後に調整してください。

VRC Light Volumesの項目が押せない
  red.sim.lightvolumesが未導入です。導入するか、OFFのまま使ってください。

月のフチに黒い線や白い線が出る
  テクスチャのアルファパディングが足りていません。透明部分にも色を伸ばした
  RGBAテクスチャを使ってください。

月が画面の端で欠ける
  BillboardやHalo Mesh Extrudeで広がった部分が、メッシュのboundsの外に
  出ています。付属のOborozukiQuadを使い、ScaleのX・Y・Zをそろえてください。
  マテリアルのInspectorに警告が出ている場合は、その案内に従ってください。

Oboroのぼかしが効かない
  月テクスチャのミップマップがOFFになっています。テクスチャのImport Settingsで
  Generate Mip MapsをONにしてください。

更新履歴
--------

1.2.0
  Billboardを追加しました。月が常に見ている人の方を向き、斜めから見ても
  丸く見えます。
  霞の向こうに見える月を表すOboroモードを追加しました。輪郭と模様の
  ぼかし、霞と暈、流れる薄雲を設定できます。
  ビルド時の最適化を追加しました。使わないライティング用のキーワードを
  外しました。VRChatのワールドビルドでは、効果のないキーワードを
  マテリアルから除きます。
  Halo Mesh Extrudeが効かなかった不具合を修正しました。
  InspectorにGeometryとOboroのセクションを追加し、Halo Mesh Extrudeを
  Geometryへ移動しました。
  付属のPrefabを、boundsを広げたOborozukiQuadと、X・Y・Zのそろった
  Scaleに変更しました。見た目は変わりません。
  マテリアルのプレビューを平面に変更しました。
  VRChat Worlds SDKの依存を、3.10.4以上という指定に変更しました。

1.1.0
  配布形態をVPMパッケージへ変更し、本体をPackages/com.niaka.oborozuki
  へ移しました。
  1.0.0の.unitypackageから入れ替える場合は、
  Assets/NiAka/Contents/Oborozukiを削除してから導入してください。
  説明書をREADME.txt、利用条件をLICENSE.txtに統合しました。
  Inspectorの4言語表示はこれまでどおりです。

1.0.0
  初回リリース。

同梱テキスト
------------

README.txt   この説明書です。
LICENSE.txt  利用条件です。

============================================================
English
============================================================

Overview
--------

Oborozuki is a 2D moon shader for VRChat worlds. It runs on the Unity
Built-in Render Pipeline and ships separate subshaders for PC and
Quest (Android).

Its halo is built from two HDR layers, a thin knife-edge ring and a wide
corona, modeled after total solar eclipse photography. Combined with
camera Bloom, the moon looks lit from behind.

"Oborozuki" is a Japanese word for a moon whose outline is softened by
haze or bloom.

Distribution and Install
------------------------

If you use VCC or ALCOM, install from the VPM repository.
https://vpm.2aka.io/

Package page:
https://vpm.2aka.io/packages/com.niaka.oborozuki

BOOTH product page:
https://niaka.booth.pm/items/8320267

The BOOTH download includes the .unitypackage and a shortcut that adds the
VPM repository. Add the repository in VCC or ALCOM first, then add
Oborozuki to your project.

Updating
--------

Once https://vpm.2aka.io/ is registered in VCC or ALCOM, new versions appear
in the list. Update from that window.

A .unitypackage you imported directly does not update itself. You have to
swap the files by hand for every release, so switching to the VPM repository
is the easier route.

Do not add both the .unitypackage edition and the VPM edition to the same
project. Install one of the two.

When moving from the 1.0.0 .unitypackage to the VPM edition, delete the
Assets/NiAka/Contents/Oborozuki folder before installing. The materials and
prefabs keep their original GUIDs, so moons already placed in a scene keep
their references.

Requirements
------------

- Unity 2022.3 LTS
- A VRChat Worlds SDK 3.10.4 compatible setup
- Unity Built-in Render Pipeline
- PC (Windows / macOS), verified
- A lightweight subshader for Quest (Android) is included, but it is
  not verified on Quest hardware

To open the bundled sample scene as-is, use a VCC World project that has the
VRChat Worlds SDK, Unity UI (UGUI), Input System, and Post Processing.

VRC Light Volumes (red.sim.lightvolumes) and Bakery are optional
integrations. Leave those material options off when the packages are not
installed.

Setup
-----

1. Drag one of the prefabs in Runtime/Prefabs, such as Moon_Gold_1,
   Moon_Blue_1, or Moon_SolarEclipse, into your scene.
2. Adjust the position, rotation, and scale to fit your world.
3. Adjust Halo / Phase / Glow / Lighting in the material Inspector.
4. Enable Bloom in the camera Post Processing settings.
   Intensity 0.5 to 1.0 and threshold 0.9 are good starting points.
5. Check the result in Game View. Scene View often disables Post
   Processing, so HDR glow does not show correctly there.

Runtime/Scenes/OborozukiSampleScene.unity contains an example camera and
Post Processing setup.

Usage
-----

Using your own texture:
  Put a transparent RGBA moon texture on an Oborozuki material and assign it
  to the included Runtime/Meshes/OborozukiQuad. OborozukiQuad has the same
  shape as Unity's built-in Quad with wider bounds, so the moon is not cut
  off at the screen edge when you use Billboard or Halo Mesh Extrude. If dark
  or bright fringes appear along the edge, check the alpha padding of the
  texture.

Inspector:
  The Inspector is split into 13 collapsible sections. Each section has a
  Reset to Recommended button that only resets that section. The language
  toggle at the top switches between Japanese, English, Korean, and
  Simplified Chinese.

Settings
--------

Billboard:
  Turn on Billboard in the Geometry section and the moon always faces the
  viewer, so it stays round even from an angle. Object rotation is ignored;
  only position and scale are used. Keep Scale X, Y and Z equal. In VR it
  faces the center between the eyes, and mirrors and cameras use their own
  viewpoint.

Halo:
  _HaloExtrude in the Geometry section expands the Quad outward and
  _HaloAlpha lifts alpha in the transparent region, then _HaloEmissive adds
  the HDR ring and _HaloCorona adds the wide falloff. _HaloGapFill bridges
  the gap between the texture edge and the ring.

Phase:
  _PhaseOn enables moon phases, _PhaseAngleDeg sets the direction, and
  _PhaseCurvature shapes the terminator. The ring and corona are added
  after phase shading, so the rim stays lit even on a new moon.

Oboro:
  Turn on _OboroOn to show the moon as if seen through thin haze. _OboroBlur
  softens the outline and markings, and _OboroVeil fades the markings.
  _OboroGlowColor and _OboroGlowRadius set the aureole around the moon.
  Raise _OboroCloud to let thin clouds drift across it. The blur uses the
  texture's mipmaps.

Lighting:
  VRC Light Volumes and Bakery are optional PC-only integrations. The
  lightweight Quest subshader strips them to stay inside the instruction
  budget.

Build optimization:
  Lighting keywords the shader never reads, such as shadows and vertex
  lights, are left out of the variant set. When you build a VRChat world,
  keywords that have no effect are removed from the Oborozuki materials in
  the scene. The look does not change, while build time and size go down.

Recommended Material Setups
---------------------------

Eclipse-style halo:

  _RimOn            = ON
  _RimRadiusInner   = 0.92
  _RimRadiusOuter   = 1.00
  _RimSoftness      = 0.005
  _HaloEmissive     = HDR(1, 0.95, 0.85) intensity 3 to 6
  _HaloCorona       = ON
  _HaloCoronaRadius = 2.0
  _HaloCoronaPower  = 3.0
  _HaloCoronaTint   = HDR(1, 0.92, 0.78) intensity 2 to 4
  _HaloExtrude      = 0.5
  _HaloAlpha        = 0.4
  _HaloGapFill      = 1.0
  _HaloGapFillWidth = 0.15
  _HaloSoftCutoff   = 0.05

Hazy moon (Oboro):

  _OboroOn          = ON
  _OboroBlur        = 0.35
  _OboroVeil        = 0.35
  _OboroGlowColor   = HDR(0.35, 0.42, 0.55)
  _OboroGlowRadius  = 1.0
  _OboroCloud       = 0.3 (to add drifting clouds)

Common phases:

  Full moon        _PhaseOn=OFF, higher _RimIntensity, _EdgeBurstStrength 2
  Crescent         _PhaseOn=ON, _PhaseAngleDeg=130, _PhaseShadowMin=0.1
  Half moon        _PhaseOn=ON, _PhaseAngleDeg=90 or -90
  Earthshine       _PhaseShadowMin=0.15, _PhaseShadowTint=(0.3, 0.4, 0.6)
  Sharp crescent   _PhaseOn=ON, _PhaseCurvature=1.4

Platform Support
----------------

  PC (DirectX / Metal)   Standard subshader, verified.
  Quest 2 / 3 / Pro      A lightweight subshader is included. Bakery RNM /
                         MonoSH / LMSpec and VRC Light Volumes are stripped,
                         while halo, phase, and rim remain. This path is
                         not verified on Quest hardware, so check it in
                         your own world before shipping.

Troubleshooting
---------------

The halo does not glow:
  HDR effects need camera Bloom. Enable Bloom in Post Processing and check
  in Game View.

The moon sorts in front of or behind other transparent objects:
  The shader draws in the Transparent queue with ZWrite off, so draw order
  matters. Adjust the material Render Queue.

The VRC Light Volumes option is greyed out:
  red.sim.lightvolumes is not installed. Install it, or leave the option
  off.

Dark or bright fringes appear along the moon edge:
  The texture lacks alpha padding. Use an RGBA texture with color bled into
  the transparent area.

The moon disappears near the screen edge:
  The area added by Billboard or Halo Mesh Extrude reaches outside the mesh
  bounds. Use the included OborozukiQuad and keep Scale X, Y and Z equal. If
  the material Inspector shows a warning, follow it.

The Oboro blur has no effect:
  Mipmaps are off on the moon texture. Turn on Generate Mip Maps in the
  texture's Import Settings.

Update History
--------------

1.2.0
  Added Billboard. The moon always faces the viewer and stays round from
  any angle.
  Added Oboro mode for a moon seen through haze: outline and marking blur,
  veil, aureole, and drifting clouds.
  Added build optimization. Unused lighting keywords are left out, and a
  VRChat world build removes keywords that have no effect from the
  materials.
  Fixed Halo Mesh Extrude having no effect.
  Added the Geometry and Oboro sections to the Inspector and moved Halo
  Mesh Extrude to Geometry.
  The included prefabs now use OborozukiQuad, which has wider bounds, and
  a Scale with equal X, Y and Z. They look the same as before.
  The material preview is now a plane.
  The VRChat Worlds SDK dependency is now "3.10.4 or later".

1.1.0
  Moved distribution to a VPM package. The source of truth is now
  Packages/com.niaka.oborozuki.
  When replacing the 1.0.0 .unitypackage, delete
  Assets/NiAka/Contents/Oborozuki before installing.
  The guide is now README.txt and the terms are now LICENSE.txt.
  Inspector language switching is unchanged.

1.0.0
  Initial release.

Included Text Files
-------------------

README.txt   This guide.
LICENSE.txt  License and terms.
