Thursday, 26 April 2012

Maya Texturing - Layering Textures for Terrain

 Over the past few weeks I have come across a number of problems in Maya and I find as soon as I solve one problem ... a harder problem just replaces it. I have been told that Maya 2012 is one of the buggiest versions of Maya so I'm hoping some of these bugs I have encountered will be fixed by then.

I have decided to document just some of the problems I have been having. Most of them have nothing to do with bugs just Maya's lack of ability to excecute some pretty basic stuff. By writing this I am hoping to help out some people who have come across the same problems so they don't end up wasting time on things such as AO with transparency.One of the reasons I had these troubles was because I can't download and use any plug-ins because I will be rendering this on the University's RenderFarm.

Layering Textures for a Terrain

So I'm going to kick start this with something that set me back a few days trying to find the best method to texture a terrain. Anyone who has done research on this matter has probably come across this video on YouTube: http://www.youtube.com/watch?v=sdI3ddGFYJg You might have spent hours and hours trying to get it to work but what the author fails to tell you is that this cannot actually be rendered ... it is purely a real time effect used to in game engine.

 CreativeCrash hosts a good shader for this which allows you to use multiple layers for MentalRay but unfortunately I couldn't use this because of the RenderFarm. It will no doubt cause some problems later down the line if I use this. Here it is anyway http://www.creativecrash.com/maya/downloads/shaders/c/mix8-layer-for-mentalray

One method would be to use the BlendColors node which is ok but it limits you to just 2 materials. If you want to use this method then you will have to create the BlendColors node, apply two different materials OR shaders and have a transparency map in the Blender slot. To apply this to your mesh you must first make a SurfaceShader node and connect the BlendColors to the OutputColor of the SurfaceShader and then assign that to the mesh.

Using the Layered Shader didn't work for me at the time but the Layered Texture node can be pretty useful. I didn't use this method because I thought you could only hook up a texture instead of a Blinn material (because of the name layered 'texture') But after some testing I have discovered you can infact put materials in the slots and each layer has its own Alpha channel. (really wish I found this out earlier)

So anyway this bring me to my last method and the one I went for. It's using a node called the mib_color_mix node found in the Data Conversion section of the MentalRay nodes. This is better explained here http://area.autodesk.com/forum/autodesk-maya/materials/blend-two-shaders-together/ It is a great node for having a lot of control over your layers but I found it very frustrating to get the connections right as you can't just apply the mib_color_mix node to a mesh so you have to work around that. Here is a pretty good tutorial on it http://www.youtube.com/watch?v=8L3G69kuvvc


I hope this has helped anyone who was in the same position as me. Please comment if you would like to add anything to this :)





























Tuesday, 10 April 2012

nCloth Flag Finished

Here is my final test render of the flag using nCloth in Maya.Please feel free to comment on it :)

 
 
 
 
 
 
Since the last WIP of the flag I have changed a few things. I raised to the Scale slightly (I realise some people say set this at 0.01 but I thought I had a better effect with that number raised slightly) The biggest change I made for this flag was creating a Volume Axis Field and creating an expression for the Turbulence and the Magnitude. This really helped break the repetative waves I had going on. Any questions on how I made it please feel free to ask.

Tent Fire Finished - Maya Fluids

Here is my final test render of the tent fire in Maya. I had some feedback from my tutor saying there wasn't enough detail around the edges ... it was generally all too smooth. To fix this I animated a texture into the fluids to give it a lot of depth and created a general turbulance in the fire.


 
 
There are still some final tweaks I would like to make before rendering and that will just involve slowing the texture speed down very slightly but overall I am happy with the result :) Below are some of the improvements I made since that last post.







 
 Here I have created a texture and creating an expression to animate the texture. I found that to get the right result I had to animate the texture in a negative direction to the fire.
 




 
I wanted a bit of variety in the density/voxel/sec of the main emitter so I set 4 keys and used the post cycle feature to keep this infinate.
 




 
I have done two things here. First I have imrpoved the incandescence of the FluidShape, mainly effecting the smoke. Also by default, MentalRay doesnt render the shadows very well. The shadows seemed to be solid black and unafected by the properties of the light so I changed the Shadow Method to Segments which improved it a lot but made the render time very slow.
 




 
 Finally I just animated the magnitude and the direction of the wind, much the same as how I animated the Fluid Emitter earlier.

 



 Along the way I rendered out a few tests if you would like the see my progress. There are still some things I would like to take further in the future ... at the moment it feels like there is something slightly stronger than just the material driving the fire, oil for example so I would like to make a fire that is a lot calmer.

I would also like to find a way to animate the texture so it changed direction at certain points, for example if the wind is blowing the fire half way up then the texture would have to move side ways at that specific point in time. Maybe there is just a more complex expression you need to write to achieve this effect.



 

Monday, 9 April 2012

Environment WIP

 It's taken me a while to get this post up but it's finally here! This is my second environment and is proving to be a tough one as it is totally different to the previous Italian scene. This environment involves a lot of open space, tonnes of trees and unlike the last one I have to make a 360 background with a sky.

I pretty much knew straight away I wanted to work with PaintFX and MR Proxies. I knew it was a fast way to get loads of detailed trees and not have to spend days rendering it. I started off just looking at the trees available in PaintFX and editing them to make them more advanced than the standard PaintFX tree.






 I started looking at various types of Oak trees. I went with the oak on the far right which ended up rendering faster than most of them.


I then started playing around with the settings in PaintFX. The first two shows what I can get with different leaf reflectivity. The second two shows off the shading you can get on just the upper part of the tree which could be handy for faking shadows. The final two shows the difference between the root fade and the tip fade of the leaves.


I noticed the textures on the tree were pretty lame but I found you could play around with the bump and displacement of the bark which was cool :)
 

Here I was just optomizing the segments of the tree. Making sure I had enough to get the right amount of foilage without over doing it and wasting rendertime on segments I don't need.
 

 Here I experiment with leaf clusters, tranclucency, leaf tip colouring and hue randomizastion.


  Finally I am playing with the width of the tree trunk by using a graph which gave me a lot of control. 


These are the final 4 trees I made. I wanted quite a bit of variety in my forest which I think I will get from these 4. If you want to see how I made these into proxies then please check out my older post on the topic PaintFX & MR Proxies


 I felt I had done enough with the trees so moved onto the ground which is still a WIP. I initially tested out the Substance texturing within Maya. I found, for what I was trying to achieve, it wasn't that great. Because my ground was so huge I would have had to repeat the texture so much it would have been very noticable in the renderer but the main reason why I couldn't use this is because you will need a specific plu-gin for it to work with Mental Ray and because I will be using a RenderFarm I just though I would come across problems when trying to get the script working.


 When it came to positioning the trees I asked a friends of mine, Lee Dunham, to write me a script for randomizing the placement of the trees. It was a bit fiddly at first but I got used to it and it helped a lot. Once that was done I was just fine tuning the pisitionnig and size of the trees. In the image above you can see all the 4 trees positioned seperately and then altogether in one scene. Thanks to the proxies, this has enabled me to work in a scene with potentially hundred of millions of polygons.


To create a realistic environment I had to create a convincing background. I am not currently dealing with the sky so for now it's just the mountains. I wanted to create a full 360 panoramic that is mapped onto a sky dome and has an alpha that leaves out the sky. I found this excellent image online and went into Photoshop to edit it. I first deleted the sky by using an adjustment layer and paint around the edges.


To create more depth in the image I applied a de-saturated layer and used another adjustment layer to paint in the areas I wanted more desaturated (the distanct mountains)
 

Because I am applying this to a sky dome I have to make this a cylidrical map. I used the Polar Coordinates filter in PS and matched up the ends so they loop nicely.
 

After removing the red background this is what I get. To map this I simply used a planer UV in the Y direction and relaxed the UV's slightly.


Here is the final shot comped together. Hope you all like this so far and please comment if you have anything to say or ask :)