Unreal Engine 4によるゲーム制作で使用する木の作成
- 2019.01.22
- Game Production
![Unreal Engine 4によるゲーム制作で使用する木の作成](https://sp-ao.shortpixel.ai/client/q_glossy,ret_img,w_890,h_500/https://celestial-grief.info/wp-content/uploads/2019/01/game_tree_making18-890x500.png)
自分用のワークフロー覚書として簡単な木作成手順と注意点などまとめてみました。使用ツールはLightwave2018とその外部プラグインDP Treeです。
定番プラグインDP Treeを用いて木を作っていきます。自動生成なのですが、手直しなども必要なので以下簡単な使用方法と手順など記載します。
![](https://sp-ao.shortpixel.ai/client/q_glossy,ret_img,w_1024,h_811/https://celestial-grief.info/wp-content/uploads/2019/01/game_tree_making01-1024x811.png)
枝を生やすためのガイドとなるオブジェクトを用意します。ここでは粗目のコーンを用意しました。高さは4mほどあります。
![](https://sp-ao.shortpixel.ai/client/q_glossy,ret_img,w_1024,h_797/https://celestial-grief.info/wp-content/uploads/2019/01/game_tree_making02-1024x797.png)
痩せた(枯れ気味な)木を作ろうと思うので、コーンも少し長めに用意した上で、ポリゴンを間引いていきます。間引いた個所には枝が生えないので、結構取ってみました。
![](https://sp-ao.shortpixel.ai/client/q_glossy,ret_img,w_1024,h_784/https://celestial-grief.info/wp-content/uploads/2019/01/game_tree_making03-1024x784.png)
バックグラウンドレイヤーに置いて、アクティブにした空のレイヤーにてDP Treeを起動します。
![](https://sp-ao.shortpixel.ai/client/q_glossy,ret_img,w_600,h_1024/https://celestial-grief.info/wp-content/uploads/2019/01/game_tree_making04-600x1024.png)
プラグインのボタンを押しただけでは何も起きないので、nキーを押して数値入力ウィンドウを出します。
![](https://sp-ao.shortpixel.ai/client/q_glossy,ret_img,w_802,h_1024/https://celestial-grief.info/wp-content/uploads/2019/01/game_tree_making05-802x1024.png)
デフォルトでは木も何も表示されないので、「Interactive Tree」のチェックボックスをチェックし「Render」から「SubD」を選ぶと、サブパッチ適用された木が出現します。
![](https://sp-ao.shortpixel.ai/client/q_glossy,ret_img,w_937,h_1024/https://celestial-grief.info/wp-content/uploads/2019/01/game_tree_making06-937x1024.png)
パラメーターをいくつか変更して、痩せた木を作っていきます。ここではMainタブないの「Branch Number」で枝の数を減らし、「Trunk Height」で幹の高さを調整し枝が生える部分を高くしました。後は「Start Truck Radius」を下げて幹の太さを細くし、合わせて枝の太さを調整するため「Main Branch Radius」の数値も下げて細くしました。
![](https://sp-ao.shortpixel.ai/client/q_glossy,ret_img,w_968,h_1024/https://celestial-grief.info/wp-content/uploads/2019/01/game_tree_making07-968x1024.png)
続いて、Miscタブに移り根っこを5本ほど追加して設定終了とします。これで木はできました。
![](https://sp-ao.shortpixel.ai/client/q_glossy,ret_img,w_773,h_1024/https://celestial-grief.info/wp-content/uploads/2019/01/game_tree_making08-773x1024.png)
UVは自動的に「Bark」という名称で作成されているので確認してみます。自動生成で作ってあるので、枝や幹、根っこが混在して異様な長さで生成されています。
![](https://sp-ao.shortpixel.ai/client/q_glossy,ret_img,w_793,h_1024/https://celestial-grief.info/wp-content/uploads/2019/01/game_tree_making09-793x1024.png)
自動生成のままではUVが裏返っていたり、そもそも枝の先が下向きになっていて見栄えが悪いなどモデルを修正する必要があります。また、F5で色分けを確認すると「Branch1」「Branch2」「Root」「Trunk」の4種類のサーフェイスが自動で設定されています。
![](https://sp-ao.shortpixel.ai/client/q_glossy,ret_img,w_1024,h_792/https://celestial-grief.info/wp-content/uploads/2019/01/game_tree_making10-1024x792.png)
一旦、4種類のサーフェイスの色分けを行い視認性を上げます。
![](https://sp-ao.shortpixel.ai/client/q_glossy,ret_img,w_1024,h_796/https://celestial-grief.info/wp-content/uploads/2019/01/game_tree_making11-1024x796.png)
![](https://sp-ao.shortpixel.ai/client/q_glossy,ret_img,w_1024,h_801/https://celestial-grief.info/wp-content/uploads/2019/01/game_tree_making12-1024x801.png)
枝が変に多かったりするので、剪定します。剪定した枝の根には穴が開きますので、ポリゴンを埋めるなど修正を行います。また枝の節々があまりに“くねり過ぎ”な個所がありますので、いくつかのエッジをループ選択してザクザク削除していきます。
![](https://sp-ao.shortpixel.ai/client/q_glossy,ret_img,w_1024,h_795/https://celestial-grief.info/wp-content/uploads/2019/01/game_tree_making13-1024x795.png)
![](https://sp-ao.shortpixel.ai/client/q_glossy,ret_img,w_1024,h_794/https://celestial-grief.info/wp-content/uploads/2019/01/game_tree_making14-1024x794.png)
全体的に枝と枝の付け根が食い込んだりしておかしなことになっているので、これを地道に修正していきます。
![](https://sp-ao.shortpixel.ai/client/q_glossy,ret_img,w_1024,h_818/https://celestial-grief.info/wp-content/uploads/2019/01/game_tree_making15-1024x818.png)
自動生成される枝先はガイドとなるポリゴンの面に対してできる結果、枝先が下向きに作成されます。対して自然の木々から生える枝は、太陽に向かって上に向かうので、これも面倒ですが修正していきます。また、根っこも幹に対して太いので、サイズを調整します。以上、上記は修正後の画像。
![](https://sp-ao.shortpixel.ai/client/q_glossy,ret_img,w_1024,h_764/https://celestial-grief.info/wp-content/uploads/2019/01/game_tree_making16-1024x764.png)
あとはグダグダになっているUVを手直していきます。選択ツールを使ってスキンの名前別に選択するなどして効率よく選択します。この際、全オブジェクトが表示されている段階で、ポリゴンの解除を行ったうえで選択します。
![](https://sp-ao.shortpixel.ai/client/q_glossy,ret_img,w_1024,h_618/https://celestial-grief.info/wp-content/uploads/2019/01/game_tree_making17-1024x618.png)
サーフェイス毎に大まかに分けましたら、サーフェイス毎の塊で修正を行っていきます。作業を行なわないサーフェイスはポリゴン解除の状態のまま、一旦非表示とし、作業を行うサーフェイスだけ表示します。その後、ポリゴンの結合を行うと、枝ごとにサーフェイスを選択できるので効率よくUVの選択ができます。
![](https://sp-ao.shortpixel.ai/client/q_glossy,ret_img,w_1024,h_805/https://celestial-grief.info/wp-content/uploads/2019/01/game_tree_making18-1024x805.png)
チェッカーボードのテクスチャをUVとして貼り付け、全体的なサイズを合わせます。その後、樹皮のテクスチャを貼り付けて、全体を見回して伸びている個所などは直します。ここで用意したテクスチャは、カラー、ラフネス、スペキュラー、ノーマル各2kです。実際UE4で作業および(プラットフォームはまだ不明ですが)ゲームリリース時のことを考えると1Kに解像度を落とすかもしれないですが、ここの木の作成では2kで進めました。
葉っぱの作成は、モデラー上で木を選択した上で、プラグインDP Foliageを使用して作りますが、手間のかかかる木の作成にフォーカスした覚書なので、まとめはここまでとします。