Atom Posted May 19, 2016 Share Posted May 19, 2016 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: Here is a 15x15 grid: tileproc_for_houdini_051916.zip 1 Quote Link to comment Share on other sites More sharing options...
Yader Posted May 19, 2016 Share Posted May 19, 2016 Thanks for this, quick note: in the python code the file paths for mac os x still point to a clarisse directory Quote Link to comment Share on other sites More sharing options...
Atom Posted May 20, 2016 Author Share Posted May 20, 2016 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? Quote Link to comment Share on other sites More sharing options...
Yader Posted May 20, 2016 Share Posted May 20, 2016 Indeed it did Quote Link to comment Share on other sites More sharing options...
Atom Posted May 20, 2016 Author Share Posted May 20, 2016 (edited) I have updated the script to allow for the generation of Trees, Bushes and Flowers as well. The Trees and Bushes will avoid roads and houses, the flowers only grow in rivers or water. tileproc_for_houdini_052016.zip Edited May 20, 2016 by Atom Quote Link to comment Share on other sites More sharing options...
Atom Posted May 20, 2016 Author Share Posted May 20, 2016 (edited) 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: Road and Grass offset -0.5 in the X direction: Road and Grass offset -0.5 in the X direction and Rivers offset 0.5 in the X direction: Road and Grass offset -0.5 in the X direction and Rivers offset 0.5 in the X direction with Hills and Trees added: A 16x16 generation with Roads and Canals having separate branch rates: (generation took ~6 minutes on a 2.26Mhz machine) tileproc_for_houdini_052016.zip Edited May 20, 2016 by Atom 1 Quote Link to comment Share on other sites More sharing options...
f1480187 Posted May 20, 2016 Share Posted May 20, 2016 Did you try .bgeosc instead of .obj? I guess, most of the cooking time is geometry loading. Quote Link to comment Share on other sites More sharing options...
Atom Posted May 21, 2016 Author Share Posted May 21, 2016 (edited) 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 May 22, 2016 by Atom Quote Link to comment Share on other sites More sharing options...
f1480187 Posted May 21, 2016 Share Posted May 21, 2016 (edited) 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 May 21, 2016 by f1480187 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.