はじめに
2015/06/11に、UE4のバージョン4.8がリリースされました
https://www.unrealengine.com/ja/blog/unreal-engine-48-released
Unreal Engine 4.8 Release Notes | Unreal Engine
ということで、追加された新機能の内の
「Landscape Grass Tools」を使ってみました
Landscape Grass Toolsとは
リリースノートより
- Each type of grass is described by a new Landscape Grass Type asset type, and each grass type can specify multiple static meshes for variation.
- A grass density map is generated from the landscape's material. A Landscape Grass Output node should be added to your landscape material, and one or more Landscape Grass Type assets can be assigned. For each grass type, a new input connection will appear, which is used to specify the grass density.
- Connecting a Landscape Layer Sample node directly will allow a landscape layer to specify the grass density. You can also connect a network of nodes to create more complex placement rules such as automatically removing grass based on surface normal or altitude or using multiple landscape layers.
超絶クソ翻訳
- 「Landscape Grass Type」アセットにStaticMeshを登録することで、様々な種類の草が描画できるよ
- 草の密度は、ランドスケープマテリアルで定義するよ
- Landscape Layer Sampleノードに接続することで、草の密度をランドスケープレイヤーに明示するよ
ざっくりまとめ
- なんか、草などのStaticMeshの配置が超楽になるよ
よく分からないので、とりあえず使ってみます
Landscape Grass Typeアセットの作成・設定
まずは、いつものようにアセット作成メニューから、
Landscape Grass Typeアセットを作成します。
Landscape Grass Typeアセットを開いてみると、StaticMeshを
複数個登録できるようなので、てきとーにCubeとSphereを登録しました。
各パラメータ
- Grass Density:10平方メートルにおける密度
- Use Grid:たぶん、分布方式の切り替えフラグ
- Placement Jitter:たぶん、Use Gridにチェックを入れた際の調整パラメータ
- Start Cull Distance:密度の減少を開始する距離
- End Cull Distance:密度が完全に0になる距離
- Min LOD:LOD設定
- Random Rotation:回転をランダムにするか
- Align to Surface:…?
※距離に応じた密度現象の様子
Landscape Grass Tools、距離に応じて調整してくれるのイイネ! #ue4study pic.twitter.com/WBzbFsIYZH
— おかず (@pafuhana1213) 2015, 6月 11
ランドスケープマテリアルの用意
次に、Landscapeに適応するマテリアルを作成します。
新規でマテリアルを作成して、↓な感じでノードを組みます。
先ほど作成したLandscape Grass Typeアセットは、
Landscape Grass Outputノードに登録します。(複数登録可)
Landscape Grass Outputノードには、Landscape Layer Sampleノードを
接続しています。
(これに関しては説明に従っただけなので、あまりよく分かってないです…
密度を調整していることは確かなのですが…)
Landscape Grass Toolsの利点・欠点
草や石ころのように、配置はてきとーでもいいから、
とにかく地形に敷き詰めたい場合は、凄い便利な機能です。
Landscape Grass Typeアセットでのパラメータ変更が、
ほぼリアルタイムで反映されるので、調整も楽です。
欠点としては、配置に意味がある物に関しては不向きです。
(プレイヤーの進行の妨げになる大きめの木とか)
その場合は、Landscape Grass Toolsではなく、
手動による配置や、プロシージャルフォリッジを使ってみるといいかもしれません。
※プロシージャルフォリッジについて
UE4 プロシージャルフォリッジを使って草木を自動で配置してみる - Let's Enjoy Unreal Engine
おまけ
圧倒的鹿!
先日買った、鹿アセットの自慢がしたかっただけ
Animals – Deer by The Furryous Animal in Characters - UE4 Marketplace