【VRChat向けUnityシェーダー】草木の揺れ & 両面ライティングシェーダー
- Digital300 JPY

草木向けのUnityシェーダーです。VRChatワールドでの利用が可能です。 揺れ & 両面ライティング機能を持ったシェーダと、両面ライティングをオミットした揺れ機能のみのシェーダの2つがパッケージに入っています。 このシェーダでは草木が風で揺れているようなアニメーションを行わせることができます。この動きはシェーダー内で計算されていて、モデルにボーンを仕込んだりアニメーションクリップを作成したりする必要はありません。ポリゴンで詳細に形状を作成したモデルでも、板ポリにアルファつきのテクスチャを貼った軽量なモデルでもどちらでも使用できます。 モデルの頂点ごとの揺れの調整は、簡単なものであればインスペクターで頂点の高さを指定して行うとができます。例えば草の根元は揺れずに先端に行くにしたがって揺れるようになるという設定です。頂点カラーまたはテクスチャを使用してより複雑な調整を行うこともできます。 このシェーダーは両面ライティングにも対応しています。 草や木の葉は頂点数削減のためペラポリで作成することが多いですが、単にカリングをOffにして両面表示にしただけでは裏面から見たときにライティングがおかしなものになってしまいます。このシェーダーは表裏どちらからでも正しくライティングを行うようになっています。さらにマテリアル設定を表裏で個別に行うことができ、表と裏で別のテクスチャを貼る、裏面のみOcclusionを強くするなどより細かな表現が可能になっています。 このシェーダーはHLSLで記述されていますので、追加のプラグインなどは必要なく本UnityPackageをプロジェクトにインポートするだけですぐに利用可能です。
This is a Unity shader for plants. It can be used in VRChat worlds. The package includes two shaders: one with swaying and double-sided lighting functions, and one with only the swaying function without double-sided lighting. This shader allows you to create animations that make plants sway in the wind. This movement is calculated within the shader, so there is no need to add bones to the model or create animation clips. It can be used with models created with detailed polygons or lightweight models with alpha-transparent textures applied to flat polygons. Adjustments to the swaying of each vertex of the model can be made by specifying the height of the vertices in the inspector for simple cases. For example, you can set the base of the grass to remain stationary while the tips sway. More complex adjustments can also be made using vertex colors or textures. This shader also supports two-sided lighting. Grass and tree leaves are often created using thin polygons to reduce the number of vertices, but simply turning off culling and enabling two-sided rendering can result in incorrect lighting when viewed from the back. This shader ensures proper lighting from both sides. Additionally, material settings can be adjusted separately for the front and back, allowing for more detailed expressions such as applying different textures to the front and back, or strengthening occlusion on the back side only. This shader is written in HLSL, so no additional plugins are required—simply import this UnityPackage into your project to use it immediately.
식물을 위한 Unity 셰이더입니다. VRChat 월드에서 사용할 수 있습니다. 흔들림 및 양면 조명 기능을 갖춘 셰이더와 양면 조명을 생략한 흔들림 기능만 있는 셰이더 두 가지가 패키지에 포함되어 있습니다. 이 셰이더를 사용하면 식물이 바람에 흔들리는 듯한 애니메이션을 구현할 수 있습니다. 이 움직임은 셰이더 내에서 계산되므로 모델에 뼈대를 추가하거나 애니메이션 클립을 생성할 필요가 없습니다. 폴리곤으로 상세하게 모양을 만든 모델이나, 알파가 적용된 텍스처를 붙인 가벼운 모델 모두에서 사용할 수 있습니다. 모델의 각 정점별 흔들림 조정은 간단한 경우 인스펙터에서 정점의 높이를 지정하여 수행할 수 있습니다. 예를 들어 풀의 뿌리는 흔들리지 않고 끝부분으로 갈수록 흔들리는 설정입니다. 정점 컬러 또는 텍스처를 사용하여 더 복잡한 조정을 수행할 수도 있습니다. 이 셰이더는 양면 라이팅에도 대응합니다. 풀이나 나무 잎은 정점 수 감소를 위해 얇은 폴리곤으로 생성되는 경우가 많지만, 단순히 커링을 Off로 설정하고 양면 표시를 활성화하는 것만으로는 뒷면에서 볼 때 라이팅이 이상해질 수 있습니다. 이 셰이더는 앞면과 뒷면 모두에서 올바르게 라이팅을 적용하도록 설계되었습니다. 또한 표면과 뒷면을 각각 별도로 재료 설정을 할 수 있으며, 표면과 뒷면에 다른 텍스처를 적용하거나 뒷면에만 오클루전을 강하게 하는 등 더 세밀한 표현이 가능합니다. 이 셰이더는 HLSL로 작성되어 있으므로 추가 플러그인 등은 필요 없이 이 UnityPackage를 프로젝트에 임포트만 하면 즉시 사용할 수 있습니다.
■デモワールド / Demo world / 데모 월드
本シェーダは当研究所にて公開中の背景アセット『Starlit Petals –星々の光に輝く花–』でも使用しています。デモワールドも公開していますので是非ご覧ください! This shader is also used in the background asset “Starlit Petals – Flowers Glowing in the Light of the Stars” currently available from our institute. We have also released a demo world, so please take a look! 이 셰이더는 본 연구소에서 공개 중인 배경 자산 『Starlit Petals – 별들의 빛에 빛나는 꽃 –』에서도 사용되고 있습니다. 데모 월드도 공개되어 있으니 꼭 확인해 보세요! ●デモワールド https://vrchat.com/home/world/wrld_10d7d905-f95d-4c0f-bb65-62afe36bb075/info ●『Starlit Petals –星々の光に輝く花–』商品ページ https://daizerokenkyujyo.booth.pm/items/6947605
■マニュアル / Manual / 매뉴얼
https://sites.google.com/view/man-fkgrass-shader/
■動作環境 / System requirements / 작동 환경
・Unity2022 3.22f1 ・VRCSDK3.7.4 (or later)
■注意事項 / Precautions / 주의 사항
・当データのご利用により何かしら生じたトラブルや損害につきましては、 誠に恐れ入りますが一切の責任を負いかねます。 あらかじめご了承ください。 ・We cannot be held responsible for any trouble or damage caused by the use of this data. Please understand this in advance. Thank you for your understanding. ・본 데이터의 이용으로 인해 발생할 수 있는 어떠한 문제나 손해에 대해, 매우 유감스럽게도 어떠한 책임도 지지 않습니다. 사전에 양해해 주시기 바랍니다.
■利用規約 / Licence / 이용 약관
本データの利用開始時点で本利用規約に同意したものとみなします。 利用開始する前に、必ずご確認いただきますようお願いいたします。 By using this data, you are deemed to have agreed to these Terms of Use. Please be sure to confirm these terms before using this data. 본 데이터의 이용 시작 시점에 본 이용 약관에 동의한 것으로 간주됩니다. 이용 시작 전에 반드시 확인해 주시기 바랍니다. 本規約は、あしやまひろこ(@hiorko_TB)氏が作成した VN3ライセンス( https://www.vn3.org/ )のテンプレートを使用しています。 These terms are based on the VN3 License (https://www.vn3.org/) template created by Hiroko Ashiya (@hiorko_TB). 본 약관은 아시야마 히로코(@hiorko_TB) 씨가 작성한 VN3 라이선스( https://www.vn3.org/ )의 템플릿을 사용했습니다. 規約全文(JP) https://drive.google.com/file/d/1co_T-VXdtOrs-8z4bu1RyLQ-J3hJisXq/ Terms of use(EN) https://drive.google.com/file/d/1iy5JKfDhIKxQANEtviqUNH2cLO09NZv9/ 이용 약관 https://drive.google.com/file/d/1sDtLDnDAYtfy29YpXbxLTFm8CWbaIPaB/view?usp=sharing 他言語との差異が生じた場合は、日本語版の利用規約が適用されます。 In the case of any discrepancies between languages, the Japanese version of the Terms of Use shall apply. 다른 언어와의 차이가 발생한 경우, 일본어판 이용 약관이 적용됩니다. --------------------------------------------- ●ライセンスの解釈例です。 1. 本シェーダを使用するワールドをVRChatで公開する。 → OKです。public公開も問題ありません。 クレジット表記も不要です。 2. 本シェーダを使用するデータをunitypackageなどの形で配布・販売する。 →OKですが、配布するunitypackage内に本シェーダを含めるのはNGです。 配布するデータの利用者に対して、 本シェーダを別途導入するように案内してください。 ●Examples of license interpretation. 1. Publishing a world that uses this shader on VRChat. → OK. Public distribution is also acceptable. Credit attribution is not required. 2. Distributing or selling data that uses this shader in the form of a unitypackage, etc. → OK, but including this shader in the unitypackage you distribute is not allowed. Please inform users of the distributed data to install this shader separately. ●라이선스 해석 예시입니다. 1. 본 셰이더를 사용하는 월드(World)를 VRChat에서 공개합니다. → 가능합니다. public 공개도 문제 없습니다. 크레딧 표시도 필요 없습니다. 2. 본 셰이더를 사용하는 데이터를 unitypackage 등의 형태로 배포하거나 판매합니다. → 허용되지만, 배포하는 unitypackage 내에 본 셰이더를 포함하는 것은 금지됩니다. 배포하는 데이터의 사용자에게 본 셰이더를 별도로 설치하도록 안내해 주시기 바랍니다.
■更新履歴 / Update History / 업데이트 내역
[2025-06-27: v1.0] 公開開始 / Release / 공개 시작