Windows Subsystem for Linux in Terragen

Started by Mid-Knight Acchan, December 29, 2018, 07:25:37 AM

Previous topic - Next topic

Mid-Knight Acchan

A tutorial on using "Windows Subsystem for Linux" to start linux version of Terragen on Windows and perform VDB export.

https://www65.atwiki.jp/terragen/pages/205.html

Please be aware that it is a Japanese page :P

I started 3D landscape with "Bryce" and am currently editing Japanese Wiki as a Terragen user. I am riding the Kawasaki ZEPHYR1100. I am a reader.

D.A. Bentley (SuddenPlanet)

#1
I went through the entire process of setting up WSL (Windows Subsystem for Linux) under Windows 10 Pro and it was a little different that the above referenced tutorial which may have been because it was made using the Japanese version of Windows 10, or perhaps a different version of Windows 10?
[attachimg=1]

Here are the official instructions from Microsoft to set up WSL:  https://docs.microsoft.com/en-us/windows/wsl/install-win10

After WSL is installed you need to go to the Microsoft Store App and find Ubuntu.  I installed the non-LTS option, which I think is the one that gets updated frequently.  You can also instal 16.04 LTS, or 18.04 LTS.
[attachimg=2]
[attach=3]

Once Ubuntu is installed you can run it and get a shell (bash) prompt.  You will need to figure out how to access your Windows directories, and drives from within the linux shell.  You don't ever want to shove files from Windows 10 into the Ubuntu Linux filesystem which is within the AppData folder here (on my PC):  C:\Users\Derek\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs
[attachimg=4]

FYI in Ubuntu Linux you can find your Windows 10 Downloads under /mht/c/Users/<USER>/Downloads so for me it looks like this:  /mht/c/Users/Derek/Downloads
/mht/c gets you to your C:


After you download Terragen Linux you need to copy it to your user root directory and extract it.
This will take you to your user root directory:
cd ~

Once your there you can copy the Terragen Archive to there but you need to know where it is in your Windows file system.  I would put it somewhere easy to find like directly under your C:, or your Windows 10 user Download folder.
For me my User Download folder under Windows is:
/mnt/c/Users/Derek/Downloads

So you could do this to copy your Terragen download to the user root directory under linux:
cp /mnt/c/Users/Derek/Downloads/Terragen_4_Linux_43210.tar.gz .
The period character tells the copy command you want to copy the file to the current directory you are in (~).
If your Terragen_4_Linux_43210.tar.gz archive was directly under C: under Windows 10 you could do this instead:
cp /mnt/c/Terragen_4_Linux_43210.tar.gz .

Then extract it like this:
gunzip Terragen_4_Linux_43210.tar.gz
tar xvf Terragen_4_Linux_43210.tar
[attachimg=5]
[attachimg=6]

I would rename the directory Terragen is in to something simple like "Terragen" and then you need to find your license file and copy that on over to the Terragen directory as well.
[attachimg=7]

Before you can run Terragen you need to make sure your license is working.  It must be the Terragen Professional license.
[attachimg=8]

The Terragen install was a little rocky, meaning you have to install some dependency packages, and sometimes there are some errors/missing components.  I did "sudo apt-get update" a couple times and had to retry getting some of the packages that failed to get everything on the first try.
[attachimg=9]

Here are the packages:
sudo apt-get install libgl1-mesa-dev
sudo apt-get install libglu-dev
sudo apt-get install freeglut3-dev
sudo apt-get install libjpeg62

I also had to get this with wget:
wget http://mirrors.kernel.org/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1_amd64.deb
and then:
dpkg -i /libpng12-0_1.2.54-1ubuntu1_amd64.deb


[attachimg=10]

The command for using vdbexport is like this:
./terragen -p project.tgd -exportvdb "Name of cloud layer" filename.vdb
[attachimg=11]
[attachimg=12]

I name my files like this to keep track of my source scenes and export scenes:
./terragen -p clouds001_cl3_r100km_vox400.tgd -exportvdb "Cloud layer v3 01" cloud_layer_v3_100km_400m_voxels.vdb
./terragen -p clouds002_cl3_r256km_vox200.tgd -exportvdb "Cloud layer v2 01" cloud_layer_v2_256km_200m_voxels.vdb
./terragen -p clouds003_cl3_r256km_vox100.tgd -exportvdb "Cloud layer v3 01" cloud_layer_v3_256km_100m_voxels.vdb
./terragen -p clouds003_cl2_r256km_vox400.tgd -exportvdb "Cloud layer v2 01" cloud_layer_v2_256km_400m_voxels.vdb

Brought this small test into Modo to look at it:
[attachimg=13]

If your trying this and need help let me know.  The hardest part is installing Terragen.  ;)

Derek

Mid-Knight Acchan

Thank you、D.A. Bentley

I was not confident of correctly rewriting this tutorial in English.
Thank you for making an explanation in polite English.
I want many people to experience the function of VDB export.
I started 3D landscape with "Bryce" and am currently editing Japanese Wiki as a Terragen user. I am riding the Kawasaki ZEPHYR1100. I am a reader.

gao_jian11

Thank you two, very helpful. I want to ask where is the "linux version of Terragen"? In addition, I think terragen's cloud rendering is unparalleled. Importing vdb makes more sense. In other software, the animation of the cloud is set and imported into terragen rendering. When can I import vdb?

Oshyan

The Linux version is an available download for anyone who owns the Professional version of Terragen.

VDB import will be developed, but we have no time frame for it.

- Oshyan

D.A. Bentley (SuddenPlanet)

Quote from: Mid-Knight Acchan on December 30, 2018, 11:39:30 AM
Thank you、D.A. Bentley

I was not confident of correctly rewriting this tutorial in English.
Thank you for making an explanation in polite English.
I want many people to experience the function of VDB export.

Your very welcome!  It was a fun learning experience, and I am actually amazed the Linux version of Terragen can actually run under Windows using this new WSL!  :)

Derek

aokcub

The WSL feature can be enabled by either CUI or GUI. Microsoft (MS Japan too) instructs to enable it from the PowerShell but the control panel also has a switch as written in above tutorial.

D.A. Bentley (SuddenPlanet)

Quote from: aokcub on December 31, 2018, 07:27:52 PM
The WSL feature can be enabled by either CUI or GUI. Microsoft (MS Japan too) instructs to enable it from the PowerShell but the control panel also has a switch as written in above tutorial.

Here is an English tutorial on installing the WSL through the GUI/Control Panel.
https://www.wikihow.com/Enable-the-Windows-Subsystem-for-Linux

Enjoy!

Derek

D.A. Bentley (SuddenPlanet)

I noticed the formatting on my WSL Tutorial got messed up after the new Terragen Forum came online, so when I get a chance I will go through and rewrite it and get the images inserted properly again.  For now all the images appear at the bottom of the post, and hopefully you can figure out which image corresponds to what reference.

-Derek

D.A. Bentley (SuddenPlanet)

Here is the Re-Post of this tutorial on setting up Linux Terragen under Windows 10 using Windows Subsystem for Linux:


I went through the entire process of setting up WSL (Windows Subsystem for Linux) under Windows 10 Pro and it was a little different that the above referenced tutorial which may have been because it was made using the Japanese version of Windows 10, or perhaps a different version of Windows 10?
01_Enable_WSL.PNG

Here are the official instructions from Microsoft to set up WSL:  https://docs.microsoft.com/en-us/windows/wsl/install-win10

After WSL is installed you need to go to the Microsoft Store App and find Ubuntu.  I installed the non-LTS option, which I think is the one that gets updated frequently.  You can also instal 16.04 LTS, or 18.04 LTS.
02_MicrosoftStore_Ubuntu.PNG
03_MicrosoftStore_UbuntuDownload.PNG

Once Ubuntu is installed you can run it and get a shell (bash) prompt.  You will need to figure out how to access your Windows directories, and drives from within the linux shell.  You don't ever want to shove files from Windows 10 into the Ubuntu Linux filesystem which is within the AppData folder here (on my PC):  C:\Users\Derek\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs
04_UbuntuInstalling1.PNG

FYI in Ubuntu Linux you can find your Windows 10 Downloads under /mht/c/Users/<USER>/Downloads so for me it looks like this:  /mht/c/Users/Derek/Downloads
/mht/c gets you to your C:


After you download Terragen Linux you need to copy it to your user root directory and extract it.
This will take you to your user root directory:
cd ~

Once your there you can copy the Terragen Archive to there but you need to know where it is in your Windows file system.  I would put it somewhere easy to find like directly under your C:, or your Windows 10 user Download folder.
For me my User Download folder under Windows is:
/mnt/c/Users/Derek/Downloads

So you could do this to copy your Terragen download to the user root directory under linux:
cp /mnt/c/Users/Derek/Downloads/Terragen_4_Linux_43210.tar.gz .
The period character tells the copy command you want to copy the file to the current directory you are in (~).
If your Terragen_4_Linux_43210.tar.gz archive was directly under C: under Windows 10 you could do this instead:
cp /mnt/c/Terragen_4_Linux_43210.tar.gz .

Then extract it like this:
gunzip Terragen_4_Linux_43210.tar.gz
tar xvf Terragen_4_Linux_43210.tar
05_TerragenInstalling_ExtractTerragen.PNG
06_TerragenInstalling_ViewDirContents.PNG

I would rename the directory Terragen is in to something simple like "Terragen" and then you need to find your license file and copy that on over to the Terragen directory as well.
07_TerragenInstalling_RenameTerragenFolder.PNG

Before you can run Terragen you need to make sure your license is working.  It must be the Terragen Professional license.
08_TerragenInstalling_LicenseKeyFile.PNG

The Terragen install was a little rocky, meaning you have to install some dependency packages, and sometimes there are some errors/missing components.  I did "sudo apt-get update" a couple times and had to retry getting some of the packages that failed to get everything on the first try.
09_TerragenInstalling_AdditionalPackages.PNG

Here are the packages:
sudo apt-get install libgl1-mesa-dev
sudo apt-get install libglu-dev
sudo apt-get install freeglut3-dev
sudo apt-get install libjpeg62

I also had to get this with wget:
wget http://mirrors.kernel.org/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1_amd64.deb
and then:
dpkg -i /libpng12-0_1.2.54-1ubuntu1_amd64.deb


10_TerragenInstalling_ExecutingTerragen.PNG

The command for using vdbexport is like this:
./terragen -p project.tgd -exportvdb "Name of cloud layer" filename.vdb
11_TerragenExportVDB.PNG
12_TerragenExportVDB.PNG

I name my files like this to keep track of my source scenes and export scenes:
./terragen -p clouds001_cl3_r100km_vox400.tgd -exportvdb "Cloud layer v3 01" cloud_layer_v3_100km_400m_voxels.vdb
./terragen -p clouds002_cl3_r256km_vox200.tgd -exportvdb "Cloud layer v2 01" cloud_layer_v2_256km_200m_voxels.vdb
./terragen -p clouds003_cl3_r256km_vox100.tgd -exportvdb "Cloud layer v3 01" cloud_layer_v3_256km_100m_voxels.vdb
./terragen -p clouds003_cl2_r256km_vox400.tgd -exportvdb "Cloud layer v2 01" cloud_layer_v2_256km_400m_voxels.vdb

Brought this small test into Modo to look at it:
13_VDB2MeshModo.JPG

If your trying this and need help let me know.  The hardest part is installing Terragen.  ;)

Derek

WAS

WSL2 is coming out soon too with better kernel support, and AMD nested virtualization.

D.A. Bentley (SuddenPlanet)