Jump to content

TileProc For Houdini


Atom

Recommended Posts

Hi All,

I wanted to share a conversion of the TileProc scene generator. It started off in Blender a couple of years ago and I recently ported it to Clarisse as well. This is the Houdini release of the script. TileProc procedurally generates a landscape scene based upon a mesh tile set. I have included the original tile set which was created by eRaccoon and can be found on Blendswap.com, licensed cc0.

Usage:

Download the attached file and open in Houdini. Make your settings for width, height, random seed and branch rate on the Python node. Activate the display flag for the python node to run the script, turn off display flag once generation is complete. This is a single core process so large tile sets can take a while to generate. Just keep an eye on the status area in the lower left portion of the screen. The script creates a series of geo objects with file nodes inside. Once generated Houdini will cook the entire subnet by loading all the file names the script populated inside each geo node (this can take a while as well but is a one time process).

How It Works:
TileProc uses a layer based system. Each layer can be one of three types. A simple area, a maze or scatter items (scatter is still in development). The layers are composed one on top of another by the code. The order is defined in the code but it goes something like this...Dirt, Sand, Water, Grass, Hills, Dunes , Rivers, Canals, Roads, Houses, Trees, Bushes, Flowers.  So if a river and a road collide, the compose order determines what tile ends up on top for that tile position. The branch_rate of the generator controls how curvy or straight the maze types will be. Low branch rates make straight roads, high branch rate makes curvy roads.

 

Here is an example of the default 5x5 grid:

tileproc-1.jpg

 

Here is a 15x15 grid:

tileproc-2.jpg

 

tileproc_for_houdini_051916.zip

  • Like 1
Link to comment
Share on other sites

Thanks for trying TileProc out. I set the file path up to use $HIP/... I hoped this would work for most situations but I have not tested it yet on OSX or Linux.

Did the code work for you on OSX?

Link to comment
Share on other sites

Here is another update with testing on OSX.

I have mapped a lot of the variables to controls. You can now turn all the layers on or off. You can offset layers in the X/Y position. Each maze type, Roads, Canals and Rivers can have their own branch rate (curviness) and random seed.

Grass offset -0.5 in the X direction over top Dirt:Screen Shot 2016-05-20 at 2.11.13 PM.png

Road and Grass offset -0.5 in the X direction:Screen Shot 2016-05-20 at 2.12.16 PM.png

Road and Grass offset -0.5 in the X direction and Rivers offset 0.5 in the X direction:Screen Shot 2016-05-20 at 2.13.40 PM.png

Road and Grass offset -0.5 in the X direction and Rivers offset 0.5 in the X direction with Hills and Trees added:Screen Shot 2016-05-20 at 2.16.29 PM.png

A 16x16 generation with Roads and Canals having separate branch rates: (generation took ~6 minutes on a 2.26Mhz machine)Screen Shot 2016-05-20 at 2.39.39 PM.png

tileproc_for_houdini_052016.zip

Edited by Atom
  • Like 1
Link to comment
Share on other sites

That is a good point. I had to write a python script to export those mesh tiles out of Blender, which does not have the bgeo.sc option. I guess I could bring them all into Houdini and then write them back out again in the faster format.

Edited by Atom
Link to comment
Share on other sites

On Windows, you can use Houdini Command Line Tools (or use full absolute path to gconvert.exe from $HB folder) with something like this:

for /f %f in ('dir /b *.obj') do gconvert %f %~nf.bgeosc

This will convert every .obj file in current directory into .bgeosc. For some reason, it is still slightly faster than use of uncompressed .bgeo after a bit of testing, but you could try it again. I expected overhead due to fact, that geometries are very light, and the blosc extractor will run every time, like gwavefront program for .obj files.

Another issue is large memory use. For 50х50 square it uses 3 gigs. Maybe it is better to combine all tiles into a single geometry file, then use one object with a single File operator and multiple Splits and Transforms plugged into resulting Merge. It will also work much faster in the viewport.

Edited by f1480187
  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...