[Free] Volumetric Fog and Fake Lights
- Digital0 JPY
![[Free] Volumetric Fog and Fake Lights](https://booth.pximg.net/da52898a-55fb-47ad-bd28-d1e52668811d/i/2552465/c94c8a5a-c867-456d-bd80-5536604540df_base_resized.jpg)
![[Free] Volumetric Fog and Fake Lights](https://booth.pximg.net/da52898a-55fb-47ad-bd28-d1e52668811d/i/2552465/39625085-653d-41ec-a878-39075f5cd2a3_base_resized.jpg)
![[Free] Volumetric Fog and Fake Lights](https://booth.pximg.net/da52898a-55fb-47ad-bd28-d1e52668811d/i/2552465/5a830738-cd07-4f0b-8581-366728c37b08_base_resized.jpg)
シーンに「擬似ライティング」と「ボリューメトリックフォグ(立体的で厚みのある霧)」を追加するUnity用シェーダーです。 空間に配置することで、3Dシーンにリッチな奥行きと空気感を与えることができます。
主な特徴
GPUインスタンシング対応: 多数配置しても1回のドローコール(Draw Call)にまとめられるため、負荷を抑えて描画可能です。 汎用性: ワールドのアクセントや、特定のエリアの雰囲気作りに最適です。
導入方法
Shader/ フォルダを、Unityプロジェクトの Assets/ ディレクトリ内にそのまま配置してください。
内容物
本パッケージには以下が含まれています。 Main Volumetric Fake Lights Shader: シェーダー本体。 Inverted Icosphere Mesh: ライトの描画に使用する、法線を反転させたIcosphereメッシュ。 Sample Prefab & Material: すぐに使える単体のFake Light設定済みプレハブとマテリアル。 Particle System Material: パーティクルシステム用のサンプルマテリアル。
使い方
同梱のPrefabを使用しない場合は、Icosphereメッシュをシーンにドラッグ&ドロップし、本シェーダーを適用したマテリアルをアサインしてください。 ⚠️ 技術的な注意点 1. デプスバッファ (Depth Buffer) について 本シェーダーはデプスバッファに依存しています。効果を正しく表示するためには、シーン内に Directional Light があるか、またはデプスバッファを有効にするその他の要素(例:Depth of Fieldなどのポストプロセス等)が必要です。 2. バッチングとRender Queueについて バッチング(Batching)の結果を最適化するために、各マテリアルには**異なるRender Queue(描画順)**を設定することを推奨します。 同じRender Queueを持つマテリアルは、カメラからの距離順に描画されます。 同じマテリアル同士が連続して描画されない場合、Unityのインスタンシング機能が効かず、ドローコール削減の恩恵が得られません。
Description
A shader for Unity that adds fake lighting and volumetric fog to the area they cover. The fog can be used to add depth to any 3D scene. They support Unity instancing, so multiple can be instanced together into one draw call. To install, place the Shader/ folder with the shader into your Assets/ directory.
Usage
Provided in this package are: - The main Volumetric Fake Lights shader. - An inverted icosphere mesh, used to render the lights. - A sample prefab and material for a single fake light. - A sample material for a particle system. If not using the prefab, drag the icosphere into your scene and assign it a material with one of the Fake Light shaders. Note that, like other shaders which depend on the depth buffer, you'll need a directional light or other depth buffer activator (like disabled depth of field) to see the effect properly. For best batching results, give each material a different render queue. Materials on the same queue render in order of their distance from the camera. Unity will not instance them if they aren't rendered in groups of the same material.
Notes & Support
Licensed under the MIT license. https://gitlab.com/s-ilent/fake-lights For support or feedback, you can join the Discord. https://discord.gg/uHJx4g629K



