|
Feedback
Posted: Nov 28, 2008
Category: Tutorials
There are a variety of approaches one might take in creating a plasma ball, but the simplest I know of is to use Maya Paint Effects. The branching methods on paint effects brushes are good for defining the shape of the sparks and the paint brushType has a nice softness that is good for the shading. Animating the sparks involves using the built in turbulence on the brush, as well as animating a few of the brush attributes. We can make the sparks attract to close objects by using a paint effect modifier object. One nice thing about this is that there is no dynamics involved so one can scrub the timeslider while working with no need to cache anything.
1. Select the preset brush "Get Brush:Electrical:lightingRed.mel" and paint a short stroke at the origin. It always helps to start with a brush close to the desired effect. NOTE: instead of starting from the lightingRed brush there is a paint effects brush "plasmaBall.mel" included in the attached plasmaBall.zip file. You could put this brush and its icon "plasmaBall.mel.swatch" in the folder "/brushes/electrical" in the maya location. It should then appear in the same folder as the lighting brush.
2. Edit the brush attributes. (unless you used the attached plasmaBall brush)
Brush Profile: softness = 1 transparency1+2 = 0.97 0.97 0.97 incandescence1 = 0.25, 0.17, 0.37 // define blue to purple incandescence ramp incandescence2 = 0.06 0.007 0.05 //needs to be dark because ends are fat // color can match incand, but is not important because transparency is close to 1 rootFade 0.05 tipFade 1.0 Glow: glow = 1.0 glowColor = white glowSpread = 6 Tubes/Creation tubesPerStep = 0 startTubes = 6 // or the desired spark count segments = 100 lengthMin/Max = 1.5 tubeWidth1+2 = 0.25 widthScale = edit ramp to make fat blob at spark root going to full thickness at tip elevationMin/Max = -1, 1 // all directions azimuthMin/Max = -1, 1 // all directions Growth: Twigs = OFF Growth/Branches: splitMaxDepth = 7 branchDropout = .3 splitAngle = 40 splitBias = .4 Behavior/Forces: pathFollow = 0 pathAttract = 0 random = 0.2 lengthFlex = 0.3 Behavior/Displacement: noise = 0.15 noiseFrequency = 0.2 Behavior/Turbulence: TurbulenceType = grass wind turbulence = 1.0 frequency = 4 turbulenceSpeed = .2
Now we will confine the "plasma" inside a sphere shape using a line modifier.
3. With the plasma stroke selected do "Paint Effects: Create Modifier". Scale up the modifier so that it is roughly the size of the sphere that will contain the plasma.
4. Edit the line modifier to make lines outside the sphere attract inward. The default modifier simply affects line thickness. To make it have no effect set:
widthScale = 0 Now set the force under "Brush Tube Attributes": force = -0.03 The plasma will scrunch up at the center. In order to make it such that there is only force near the sphere edge and beyond edit the dropoff ramp as follows:
Now we can animate the plasma. Turn off "Draw as Mesh" on the stroke node for faster playback of the plasma.
5. On the plasma brush animate the following attributes: noiseOffset: In the edit box type "= time * 0.1" to create a slow undulation. (This expression simply gradually increases the noiseOffset value)
splitRand: In the edit box type "= sin(time * 0.3) * 0.5 + 0.5
This slowly occillates the value up and down between 0-1( you could use keyframes if you don't like math) This animation will cause sudden jumps in the branching.
Now we can add an interaction of an object with the plasma.
6. Create a second lineModifier for the plasma. Again make the widthScale = 1(no effect) and set the force to -0.03. Parent this line modifier to the object you wish to interact with the plasma and scale the size of the modifier to control the region of influence. For a hand one might create a line modifier for each finger tip. As the modifier comes close to the plasma it should be attracted towards the center of the modifier. In order to have sparks "combine" when the object is closer one can keyframe the startTubes to a lower value and also key the incandescence values brighter. 7. Create a sphere object for the glass and apply a transparent shader. Note that paint effects does not take the level of transparency into account... paint effects elements are either fully visible or fully obscured by objects in a scene, as it is rendered in a post process using the depth buffer for occlusion. In this scene the sphere is fully transparency so it looks OK. However partial opacity might not look as natural. As well one cannot directly use raytrace refractions with paint effects. However one could render the paint effects without the sphere then map the resulting animation to a plane positioned inside a raytraced sphere.
| |||||