Wednesday 30 March 2011

Fixing the trees!

So... I manged to write a mel script that will fix the tree issue for us.

It took... a good few hours of googling, trial and testing, of different methods that I could think of, and work out the syntax for. @_____@

The method I made work, (and is actually the simplest) basically goes through every tree and sets the bounding box type and then the file location for the mental ray proxy.

Here it is:

int $i;
string $filePath = "scenes\ShapeTestMI.mi";
for($i=1; $i<=865; ++$i)
{
eval("setAttr TreeType1Proxy__" + $i + ".miUpdateProxyBoundingBoxMode 1");
eval("setAttr TreeType1Proxy__" + $i + ".miProxyFile -type " + "\"string\"" + " $filePath");
}

I'll set this up when I get into University, but i'm putting it up here incase you need it sooner.

Change "scenes\ShapeTestMI.mi" to the file location.
Change 865 in "for($i=0; $i<=865; ++$i)" for additional trees.

ALSO! TreeType1Proxy__27 and 28 are missing, and will cause the script to stop.
So duplicate and rename two trees to 27 and 28 to solve this.

Thursday 24 March 2011

Geometry Proxies!

Each tree has a really high polycount (18k for the trunk.. and something silly... for the leaves). Placing all the trees as they are in the scene would explode the world.

I found two ways in which you can make "proxy" geometry for mental ray in maya, that gets rendered as the real geometry, but means you can have each tree as low a 1 polygon in the scene, for animating.

One way uses a proxy geometry shader, using the mental ray "mip_binaryproxy". I found this first.. and it took a while to work out how to actually get access to it, as it is part of the mental ray production shaders which are hidden by default.

http://www.pixelcg.com/blog/?p=586 - Link to a video on this.
This blog is full of videos, many about the mental ray production shaders.

Another way is to export the real mesh as a .mi file (some mental ray thingy) and then under the mesh shape node (that you're using as a proxy) set the mental ray "Render Proxy (Assembly)" to the exported .mi file.

http://download.autodesk.com/us/maya/2010help/index.html?url=WS1a9193826455f5ff6026605b11840df46315041.htm,topicNumber=d0e588348

-There is the link to the documentation if you want it.

Below are the images of the proxies in action.







The roots of the proxy tree are pretty close to the original model (i decimated them to a lower polycount) while the rest of the tree is pretty much a box.

Trees... but not quite pine trees

So... these trees have been a real headache, and very time consuming for me. I tried a few different ways to create pine needles, but the trees look very bare unless i have them in a very high number. Which is fine.. but with pine needles you can tell when they're not facing in the right direction or not connected to a branch, which isn't practicle when placing them. I don't know if there are any scripts of programs that we could use; i've spent a lot of time looking.. but nothing has worked so far.

I've instead created some trees (which look more like my original consept) using "oak leaves" <- its a texture and shader from maya, and can be changed, but a leaf is much easier to place than a pine needle/branch.

I was able to use the geometry paint tool to paint the leaves on to planes that i placed where the branches were, and i also used the leaf layout from some of the paint effect oak trees. This is what i've created.



I've modified the default leaf shader slightly, and did some quick renders.



This is the new tree trunk that I used the decimation master on, and also applied a normal map (WHICH I FINALY GOT WORKING AFTER FINDING OUT HOW TO MAKE THEM IN MAYA!)



The lighting is a bit blerg, and the shader needs modifying.

Sunday 20 March 2011




This is the maya render. (left to right:6k, 3k, 1.5k).
I'm considering using the decimation master with the trees, and ground environment. What do you think?

Zbrush Rocks,.. Decimated





I was trying out the best way to creat some large rocks to place in the forrest.
I used the zbrush decimation master :
The first image is 1.3? million poly, the second is 6k and the third is 1.5k
(i also have a 3k version)

You can render these in maya, and with the mental ray approximation editor have them subdivided during rendering, which makes them look pretty close to the 1.3millon version.

Thursday 17 March 2011




Here is a quick render, and screenshot of the pine branches i was trying out.

Wednesday 16 March 2011

I found a "Geometry Paint" plug-in for maya. It's part of the Bonus Tools autodesk made, which you have to install... which took me ages to get to work 8E.

Its basically like the paint effects tool, but for custom meshes.

http://area.autodesk.com/bonus_tools <- link to the download



I tried it out on a plane (above)(the plane is hidden).
We can use this to populate the ground folliage, and the leaves/needles on the trees.

Do you want pine trees with real leaves or with pine neeedles? I can look more into how to paint textures on the planes for this.

I also found a script, which was for leaves created by paint effects trees, that changes the UV layout of the leaves, so that you can have different textured leaves.

http://www.djx.com.au/blog/2011/03/10/maya-paintfx-leaf-uv-layout-script/ <- linky to that.

Tuesday 15 March 2011

The trees are growing




More branches? Less?

... how are we doing the pine needles.. are we? O: