Monday 28 October 2013

Grass tutorial in Maya

Open Maya and create NewScene. I use the HotBox coz this is the best solution for me to navigating through Maya interface.
Next we need to create sum geometry to paint on it, coz PaintFX will be created on curves on surface. Create NurbsPlane. Scale it a little bit so ya get sumthin' like that.
There are few diffrent ways to create PaintFX. Ya can paint direct on surface using Brush tool, then brush tool will create curve on surface or you can create curve on surface and attach brush to curve. In this tut I choose second way.
To make surface live, select it and click big red magnet on status line.
Now the surface is live and you can draw curve on it.
Choose Create - CV Curve Tool and click little box near it. This is an option box. Now in CV_Curve_Options click ResetTool and Close it. This was for setting 3 degrre cubic curve.

Now you get the diffrent pointer. So draw the curve on surface. Make it 8 spans or sumthin' near that number.
You should get something like this on pic.
Click again MakeSurfaceLive, I mean BigRedMagnet and you'll back to normal shaded mode.
Now it's time to select proper brush. We wanna create grass. So open up the Visor and look around what kind of grass there are. Visor is in: Window-GeneralEditors-Visor.

And here ya got Visor.
With brush selected, select curve on surface.
When ya choose brush from Visor ya'll get diffrent kind of pointer, sumthin' like red circle. This means that you are now in PaintFX mode. But if you wanna select curve on surface you shoul back to normal pointer mode. For that just click "Q" button on your keyboard and if you wanna back to PaintFX pointer just click "Y" on your keyboard.
If you got problems with curve selection coz this is curve on surface and you can select both curve and surface, solution are SelectionMasks. You'll find'em on StatusLine, look at pic.
Click: PaintEffects-CurveUtilities-AtachBrushToCurve. So now stroke curve with selected brush is on curve on surface. If it liitle to mass to understand you can open up Hypergraph to see all conections, like on pic:
Tips: if after attached brush to curve. Your grass is really tiny then ya should do sumthin' like this: you should see PaintFX pointer - red circle. If don't see it click "Y" on your keyboard. Than press ans hold "B" key and move your mouse, this is an interactive size changing for FX pointer. So make it bigger and try to attach your brush again to curve.
You can find Hypergraph in: Window-Hypergraph or just make a hotkey for that. I got hothey for Hypergraph under alt+G buttons. It's depend on you.
In Hypergraph select: grassWindWide1 node -this is your brush- and open the AttributeEditor.
In AttributeEditor change the values like here: BrushWidth: .8, StampDensity:12, Segments:12.
There is about 300 parameters in PaintFX, so don't panic if your first grass looks so simple but with sum patience you'll get more knowledge about that powerfull tool.
Well, I think it's good moment to make prewiev render. So open the RenderGlobals and set sum of the attributes.


RenderGlobals window. Now create the SpotLight. Choose menu: Create-Light-SpotLight and bring AttributeEditor to see it attributes.
Set the camera in proper place and Render scene. You should know where the Render button is if not check the Maya's docs. You should get sumthin' like this. Not bad for dumb maximum simple grass huh.
You can also add sum environment to your scene, sum fog or sumthin'. So open once again RenderGlobals and set attributes like that.
Then click black arrow on the right near EnvironmentFog. Set like this one.

Now ya should get similar to this one. Don't worry if your stuff doesn't look like this coz this is just brief overwiev of PaintFX. The main reason for making this tut was make ya a little bit unappreciated with Paint FX techniques.
R ya still there?? Don't sleep? Ok. So we got simple grass. Oh I forgat about rendering, the render time is: 49s on 640x480 with ProductionQuality. Next we add some dynamics to our grass and will animate it.
In GrassWindWide1 node go to Turbulence tab and set attributes like on pic below or close these values.
This added sum wind turbulance to grass. Just click Play on timeline and see what happend.
This added sum wind turbulance to grass. Just click Play on timeline and see what happend.

"MASKING" in Photoshop

This one will show how to easy extract some part of image. We'll try to leave only the car and swap whole background.
First we need to make layer from backround. Simply choose "layer/new/layer from background.." from the menu and click OK with default options.
Now have to switch to quick mask mode by clicking icon on the left (hotkey: "q")
Now when we're editing image in quickmask mode we need to paint with all useful tools (brushes, fills) on part we wanna save (a whole car in my case). Painted areas are turning red, notice you can use eraser tool also
Whith bigger and smaller brushes I finished covering whole object.
Now we have to quit quick mask mode by clicking on appropriate icon (or pressing "q" key again) -our quick mask will turn into selection.
Notice we have selected all except masked area so there's nothing left to do then press "delete" key to get rid off unwanted part. And here's what we get -separated car.
And that's it. Now you can create layer below current and design a new composition. Something like this for example..




Tuesday 8 October 2013

Realistic Bump Map


I will show you a simple way to create correct bump map for textile material.You are able to create any bump/displace surface using this way.
1. Create a Circle spline in Front View. By using Break command split it into two parts.
2. Grab bottom part and using snap, move it as you see on image. Weld connection points to get continuous spline.
3. Repeat last step few times.
4. By using Clone Instance tool and Rotate make grid like on image.
5. Select one spline and select Enable in Renderer and Viewport in Modify Panel.
6. Create camera sheer to splines. Select Orthographic Projection in Modify panel. Measure distance min and max as i show on picture. You can do that by using Create -> Helpers -> Tape
7. Go to Camera View. By using FOV parameter set range of view.
8. Go to Rendering -> Render -> Render Elements and add Z Depth. Input Z Min and Z Max bellow.
9. After rendering you should get black&white image that you can use for creating displace or bump. You can play with Z Min&Max parameters for get better result.

Fire effects in Maya

Open Maya and set new project. Click: File--Project--New. This step is for better management of your files in project. In the NAME window write your project name. In LOCATION window write your project destination directory. After that click USE_DEFAULTS and Maya will set the rest for you.

Before we do sumthin' I'll show ya some UI settings for PaintFX. First chang your view to 4 panes, just click spacebar button and Maya change the view to 4 panes view. Move the mouse over FRONT_PANE and click 8 on your keyboard. This change the view to PaintFX window like on pic below.

So this is a PaintFX window. This window is useful for testing brushes and for prewiev your brushes in perspective scene. Click right mouse button on PaintFX window and select PAINT--PAINT_SCENE. Now you can paint in 3D view. This ain't real 3D perspective view but this is for prewiev your brushes. So you can paint in this pane and see rendered stroke of your brush. Try it, select any brush and paint it. If ya wanna see rendered brush open HotBox over PaintFx pane and click: STROKE_REFRESH--RENDERED. If refresh rate is very, very slow you can change resolution of your PaintFX pane. Open HotBox and click: RESOLUTION, and choose resolution you want.
The standard: alt + mouse button work like in PERSPECTIVE_VIEW but if ya wanna select any object or stroke you should click and hold Ctrl button.
Ok. So now we are ready to develope fire. Open VISOR, you find it in: WINDOW--GENERAL_EDITORS--VISOR or just click icon in PaintFX pane like in pic below. Select black default paint brush.

You can paint direct in your pane or using sum geometry to paint on it. I suggest here to create nurbs plane to better get better view of your brush. So create nurbs plane - nurbs coz PaintFX works only on nurbs geometry. Click: CREATE--NURBS_PRIMITIVES--PLANE. Click 6 on your keyboard to go in SHADED mode and scale a little bit your plane. Sumthin' like on pic:
And before you do sumthin' check the HISTORY on. This is very helpfull to edit and get full control on your creation process. The history icon is here:


Select nurbs plane and open HotBox, than click: PAINT_EFFECTS--MAKE_PAINTABLE. With default black brush selected paint one simple stroke on nurbs plane. If your pointer didn't change for PaintFX pointer just click "Y" on your keyboard. And remember that you can interactively change the size of your brush using "B" key with left mouse button. There is also another way to paint on geometry and I prefer this way coz it give ya more control and not so many CV on curve. So first make surface live. Select nurbs plane and click bid red magnet on status line:
Click: CREATE--CV_CURVE_TOOL and open option box near it. Reset settings and close it. Like on pic below:

Draw about 5 CV's on plane then clik ENTER. Click once again MAKE_SURFACE_LIVE button.
Select default black brush from VISOR. Now select curve on surface open HotBox and click: PAINT_EFFECT--CURVE_UTILITIES--ATTACH_BRUSH_TO_CURVES. Now you added brush to curve. Remember that if ya got problem with selecting there are sumthin' like selection masks. So just click correct mask:


To see better what's goin' on open HYPER_GRAPH. WINDOW--HYPERGRAPH. You can also make a hoKey for that. I just click alt+G to open it. You'll find it in: WINDOW--SETTINGS/PREFERENCES--HOTKEYS. In Hypergraph you'll see sumthin' like on pic below.


Go to PaintFX pane. If ya not in 3D view then right click on it and choose: PAINT--PAINT_SCENE. Open HotBox and choose:RESOLUTION--50 , OBJECT_SHADING--SHADED , STROKE_REFRESH--RENDERED. Now you should sumthin' like this:


Select your brush and open AttributeEditor. To select brush open Hypergraph. You'll find AttributeEditor in: WINDOW--ATTRIBUTE_EDITOR.


Set values for attributes like here below and remember to change view to PaintFX PaintScene with STROKE_REFRESH--RENDERED selected.






Did I mention one pic is more worth than thousand words:





Change to PERSPECTIVE_VIEW, open TIME_SLIDER and RANGE_SLIDER. Set the END_TIME to sumthin' like on pic. You can now play animation to see how fire behaves. If animation ain't smooth you should change STROKE_DISPLAY_QUALITY. To do this select your stroke and click:
DISPLAY--STROKE_DISPLAY_QUALITY--CUSTOM and move the slider from right to left, then play animation again and find the best display setting to get smooth animation.


Next important thing is Looping animation. Play animation and you can note that between endTime and startTime there is seam or break, no matter how I name it but more important is remove this artifact. This is very simple. Just select stroke and click: PAINT_EFFECTS--BRUSH_ANIMATION--LOOP_BRUSH_ANIMATION and click option box near it. Set the values like here:

Now you can render fire to see how it looks. So open the render globals and set values like on the pic below. Remember that RenderGlobals are in here: WINDOW--RENDERING_EDITORS--
RENDER_GLOBALS or just click an icon on Status_Line.




Render scene. Should get sumthin' like here below:


If ya dont'l like how this fire looks then just play a little bit with attributes values to achive satisfactory effect.
Next we'll save our Fire to use it in the future. Click: PAINT_EFFECTS--SAVE_BRUSH_PRESETS. Next write label for your fire brush, select directory for it. Then click the GRAB_ICON and drag selection window over your fire(in PaintEffects scene window). Click SAVE_BRUSH_PRESETS. That's all here. If ya wanna see saved fire just open up VISOR.


Now we create nurbs curve. Click: CREATE--CV_CURVE_TOOL and click the option box. Reset tool and close it.
Create any name using Cv_Curve_Tool. I made Evermotion but ya also can write sumthin' like ...., doesn't matter.


I assume that ya know what cv curve tool is and know how use this stuff. If not... well there is sumthin' like Maya docs :>
If ya need more control you can add more CVs. Just right click on your curve and choose: CURVE_POINT, next click places on curve when ya need add CVs using Shift. After that click: EDIT_CURVES--INSERT_KNOT and click option box. Reset tool, Insert CVs and CloseTool.


Ok. So we got nice lookin' curve. Now we should attach our Fire to this curve. Open VISOR and find saved Fire. I called my Fire: MomoFire in fire directory. Like here:


Select curve and click: PAINT_EFFECTS--CURVE_UTILITIES--ATTACH_BRUSH_TO_CURVES.
Ok. Now I wanna animate stroke to see animation. Ya know, created CV curve is just path for your brush. So animating stroke we get result sumthin' like jhon' name. Select stroke using, in example, Hypergraph and open AttributeEditor:


We'll animate: MaxClip attribute.


Change the value of MaxClip attribute to: 0. Go to start of playback range. Right click on: MaxClip attribute and select: Set_Key. Next go to end of playback range, change MaxClip to 1 and again right click on MaxClip and select: Set_Key. Rewind and play animation.
Next we need to add sum EnvironmentFog. Go to RenderGlobals node, MayaSoftware tab and go to Render_Options. Like on pic:


First click on box near EnvironmentFog next click black arrow. Set values for attributes like here:


First click on box near EnvironmentFog next click black arrow. Set values for attributes like here:


Few usefull tips. Select any object on scene and open Attribute Editor next look at pic below to understand what's goin' on:


Render scene to see how fire looks. I get sumthin' like here:


You can also animate the camera moving. First choose camera ya wanna to animate. Or using default PerspectiveCamera click VIEW--SELECT_CAMERA. You need only 3 or 4 keys to animate it. We won't use here any motion paths or stuff like that. Just set camera in best place to view fire and moving through Timeline set keys for it. Look below to understand it better:


Remember that after ya set keys for camera don't move it. Better create new camera to see what's goin' on in your scene. To create new camera just click: CREATE--CAMERAS-CAMERA. Then click: PANELS--PERSPECTIVE and choose created camera.

Now it's time to do Batch_Render. Set stuff like on pic below:


Click: RENDER--BATCH_RENDER and option box. Set like this:



One note after rendering. I noticed that EnvironmentFog only disturbs. So I break the connection and I made final rendering without it. I also find that the fire animation doesn't look proper and fire need sumthin' like glow. So go to fire stroke, open Attribute_Editor and change the Shader_Glow attribute value to sumthin' about: 0.014.


You should try yourself play with attribute's values to see what will happen. What will happen if I do this or that. Ok it's time to composite all rendered stuff in Shake.
Open Shake. Click: FILE_IN to load all rendered frames. Then find directory where frames are.



I found that very nice is writing description directly on pic so:



Next Shake will open SaveImage or Sequence window. Enter there name for your final animation with extension and click ok.

Choose file format and correct codec. Like here:



and finale here....