The International Simutrans Forum

 

Author Topic: Blender trees  (Read 13008 times)

0 Members and 1 Guest are viewing this topic.

Offline Sarlock

  • Devotee
  • *
  • Posts: 1340
  • Languages: EN
Blender trees
« on: August 31, 2013, 09:34:02 PM »
I have been buried deep in the bunker the past few months trying to refine my blender tree process.  I've gone through dozens of different designs and models trying to come up with something that fits all of my demanding criteria:
1) Looks good when scaled to 128x128
2) Doesn't have too many faces so that rendering is fast
3) Looks good from every angle
4) Is easy to port through GIMP to Simutrans (this was a major hurdle during my first designs last winter, it took up to an hour to convert from blender to Simutrans)

I'll let you decide on #1, but I think I have satisfied #2-4 on the list.  I can convert from blender to Simutrans in less than 1 minute now and get a great result.

Let me know what you think of this cedar tree.  I'm getting closer to my goal.  The tree colour doesn't quite match the other trees but it's also much truer to what a cedar tree does look like.  pak128 trees tend to be quite strong on the green side.


Offline Sarlock

  • Devotee
  • *
  • Posts: 1340
  • Languages: EN
Re: Blender trees
« Reply #1 on: August 31, 2013, 10:21:18 PM »
I took that tree and tried making a single-tile forest with it (coded as a res building since I wanted it centred on the tile).  Not bad.


Offline Carl

  • Devotee
  • *
  • Posts: 1559
    • Website
  • Languages: EN
Re: Blender trees
« Reply #2 on: August 31, 2013, 10:23:50 PM »
That's really nice. It works well as a RES building, too, which is no mean feat, since doing things that way can often look too regular and geometric.

Offline The Hood

  • Devotee
  • *
  • Posts: 2889
  • pak128.Britain developer
Re: Blender trees
« Reply #3 on: September 01, 2013, 10:53:20 AM »
I'd be interested in how your tree blends compare with the two I've used in pak128.Britain - I want to add a few more trees soon.

Offline IgorEliezer br

  • Devotee
  • Administrator
  • *
  • Posts: 4073
  • Cake recipes are cool... REALLY!
    • Igor Eliezer Architect and Urban Planner/Arquiteto e Urbanista
  • Languages: PT, EN, AutoLISP, Python
Re: Blender trees
« Reply #4 on: September 01, 2013, 11:39:13 AM »
I took that tree and tried making a single-tile forest with it (coded as a res building since I wanted it centred on the tile).  Not bad.
*pic*
Not bad, the forest either.

A thing I don't like in Simutrans (at least in pak128) is the way how the forests look: they look like a very rich tutti-fruit salad. All kind of trees in the same area (the 1st post's pic is okay, though). Pak128.Britain is a good example: the forests are pretty easy-looking, there's some kind of uniformity.

My opinion, don't kill me. D:

Offline Sarlock

  • Devotee
  • *
  • Posts: 1340
  • Languages: EN
Re: Blender trees
« Reply #5 on: September 01, 2013, 05:46:08 PM »
I absolutely agree, Igor.  That's one of my goals, actually.  A little variation in colour and tree type is good but as long as the forest retains a certain uniformity to a certain type of tree.  Combining 20 trees together makes it look, as you say, like a salad.  The other thing I dislike is the lack of forest cover: even at 4 trees/tile the forests aren't dense enough.

Hood, I tried using the sapling tree-maker addon for blender a lot but I could never achieve a tree that I was happy with.  Part of the problem is that the foliage would extend right to the trunk of the tree and not group at the ends of the branches like most real trees do, especially evergreens.  What I did then was create the tree manually but in a way that wasn't too labour intensive.  Using a tree picture that I wanted to model, I built the trunk and about 3-4 different types of branches along one axis.  I then took an alpha map that I assembled of a full branch of foliage and laid that out along the branches.  Once I set up a few branches then I would just copy those same branches and spin them around the trunk to create full coverage.



You'll notice that every single branch has the same image, just different sizes and rotated slightly.

I prefer to export a 32 bit (with alpha) PNG from blender at a higher resolution than 128x128, so I usually do 256x256 or 512x512.  I then load it in GIMP and reduce the size to 128x128 and then use a Threshold Alpha removal of around 40 or so (changes depending on what the final product looks like) to peel off the alpha channel, then add a second layer of the background colour for Simutrans and it's done.



I think I can still improve the post render result but it's getting much closer to something that makes me happy.  You're more than welcome to use any of the trees I create for pak128.Britain.  I'll provide the blends once I achieve a final blend that I am happy with.  Then you can just take them and apply the pak128.Britain blend filters/lights/etc to make it fit that pak's style.

Offline Fabio

  • Devotee
  • Administrator
  • *
  • Posts: 2898
  • The Pak128 Guy
    • Visit me on Facebook
  • Languages: EN, IT, RO, FR
Re: Blender trees
« Reply #6 on: September 01, 2013, 09:28:00 PM »
Awesome trees.

I think that instead of gimp you might want to try Imagemagick for post rendering, writing a script to authomatize the editing.

Offline Sarlock

  • Devotee
  • *
  • Posts: 1340
  • Languages: EN
Re: Blender trees
« Reply #7 on: September 01, 2013, 11:30:10 PM »
I haven't used Imagemagick before.  I am only using GIMP for about 30 seconds, so it isn't that important speed-wise.  I prefer to image resize in GIMP instead of rendering a 128x128 image as I find that GIMP does a nicer job on resizing a small object.  GIMP also has a nice tool for quickly filtering out the alpha channel.

This is the same tree with and without an alpha channel to blend in to the background (cast against a white background):



Having to strip the alpha channel certainly makes the tree look more "blocky".
« Last Edit: September 01, 2013, 11:35:43 PM by Sarlock »

Offline Sarlock

  • Devotee
  • *
  • Posts: 1340
  • Languages: EN
Re: Blender trees
« Reply #8 on: September 02, 2013, 07:38:33 AM »
Another experiment:





Added a few dead trees to the group, different sizes, etc.  Might vary a few colours a bit and see how that improves things.  And then, of course, different types of trees and different combinations of trees to break up the repetitiveness (though it looks pretty good for only one image).

[EDIT] Probably a bit too crowded, too...a few too many trees.
« Last Edit: September 02, 2013, 07:46:09 AM by Sarlock »

Offline wlindley us

  • Devotee
  • *
  • Posts: 953
    • Hacking for fun and profit since 1977
  • Languages: EN, DE
Re: Blender trees
« Reply #9 on: September 02, 2013, 08:57:45 AM »
...in Simutrans (at least in pak128)... the forests look... like a very rich tutti-fruit salad.

Could this be mitigated by defining the various types of trees to occur only in certain climate-zones?

Offline VS

  • Senior Plumber (Devotee)
  • Moderator
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: Blender trees
« Reply #10 on: September 03, 2013, 07:45:20 PM »
Looking good! The forest works with one tree "as is", which exceeds my wildest expectations :D

Offline IgorEliezer br

  • Devotee
  • Administrator
  • *
  • Posts: 4073
  • Cake recipes are cool... REALLY!
    • Igor Eliezer Architect and Urban Planner/Arquiteto e Urbanista
  • Languages: PT, EN, AutoLISP, Python
Re: Blender trees
« Reply #11 on: September 04, 2013, 08:04:39 AM »
Could this be mitigated by defining the various types of trees to occur only in certain climate-zones?
Long time no messing around with dats, so I can't answer. I think it's possible to set the climates where a certain kind of a tree will be generated, isn't it? But I don't know if it's possible to set the chances or probability of a certain tree to be generated within a climate-zone.

Offline Combuijs

  • Web Team
  • Devotee
  • *
  • Posts: 1392
  • Maintainer of maps.simutrans.com
    • Combuijs
  • Languages: EN, NL
Re: Blender trees
« Reply #12 on: September 04, 2013, 08:45:53 AM »
Could this be mitigated by defining the various types of trees to occur only in certain climate-zones?

Yes, it can. You can restrict trees to climates.

Offline Sarlock

  • Devotee
  • *
  • Posts: 1340
  • Languages: EN
Re: Blender trees
« Reply #13 on: September 04, 2013, 02:37:15 PM »
Yes, you can restrict per climate zone.  You can't define the distribution per specific climate zone but only for the group of zones that tree applies to... though you could create several .DAT files for the same .PNG and have one for each climate zone if you wanted to change the distribution for each climate zone.  The main reason for the "fruit salad" look is because there are so many trees for the mediterranean and temperate zones.  I released some changes to some of the temperate trees last winter and will be working on a bunch more over the next few months, hoping to address this very issue.

Offline greenling

  • Lounger
  • *
  • Posts: 1728
  • Simutransarchology it my hobby!
  • Languages: DE,EN
Re: Blender trees
« Reply #14 on: September 15, 2013, 07:25:10 PM »
Hello Sarlock
The new tree make my flat to a flunder. :o

Offline Sarlock

  • Devotee
  • *
  • Posts: 1340
  • Languages: EN
Re: Blender trees
« Reply #15 on: September 23, 2013, 06:17:50 AM »
Working on a beech tree.  Further refinements to blender technique... sapling addon does half decent leaves but doesn't do nice trunks, especially for more complex trees like an oak or a beech.  I manually created the trunk for this beech tree and then used a generated sapling set of leaves and did some manual work to make it fit nicely onto the trunk.

Posting a work in progress for a question to my fellow artists: I had lightly toyed with the concept of open holes in my trees while designing the birch tree in the first release last winter.  It is nice to be able to let the landscape show through the tree a bit but it is difficult to strike a good balance between small holes and being too sparse.

Using blender and playing with the alpha transparency removal settings in GIMP, I've generated a set of two different types of leaf-covered beech trees and one with the trunk only.  You'll notice that both the leafy trees and the trunk have pixels that are not directly connected to the tree and also have holes in the foliage to let the background come through.

I haven't done any post-blender editing to these trees except for alpha channel removal.  I can port from a blender render to viewing it in simutrans in about 20 seconds flat.



Let me know what you think with particular emphasis on the "holes" question.  Pay particular attention to the pair of leafy trees on the left: the tree in front is different than the other 4 leafy trees.  It has a much more "holey" section at the bottom right.  What do you think?  That section might be a bit too holey, perhaps.

Thanks!
« Last Edit: September 23, 2013, 06:23:36 AM by Sarlock »

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2256
Re: Blender trees
« Reply #16 on: September 23, 2013, 07:23:53 AM »
Nice - both the version with less holes and the one with more :)

Offline Fabio

  • Devotee
  • Administrator
  • *
  • Posts: 2898
  • The Pak128 Guy
    • Visit me on Facebook
  • Languages: EN, IT, RO, FR
Re: Blender trees
« Reply #17 on: September 23, 2013, 01:08:05 PM »
They all look great! :thumbsup:

Offline greenling

  • Lounger
  • *
  • Posts: 1728
  • Simutransarchology it my hobby!
  • Languages: DE,EN
Re: Blender trees
« Reply #18 on: September 23, 2013, 04:25:02 PM »
Hello Sarlock
Your Painting´s looks very cool out.
Do you creat this tree as building?

Offline Sarlock

  • Devotee
  • *
  • Posts: 1340
  • Languages: EN
Re: Blender trees
« Reply #19 on: September 23, 2013, 09:02:13 PM »
It's created as a regular tree.  Would only take 30 seconds to make it a building though.

Thanks for the positive input, I'll continue to refine this tree and add it to my set of trees for release later this year.  Now that I have a good tree making process in place I will be able to make a lot of new trees.

Offline VS

  • Senior Plumber (Devotee)
  • Moderator
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: Blender trees
« Reply #20 on: September 25, 2013, 10:12:59 AM »
I think it's really nice :)