
This site is hosted with IXWebhosting:
:: Post Date: 2007-07-10 13:51:22 [Post Comment] [Post Articles]
|
Lava Shader Effects in MayaApplication Used: Autodesk MayaAuthor: Bogdan AmidzicContact:santobranko@yahoo.co.ukAuthor Website:http://www.cavz.com/Lava shader effectHere I will explain how to make a shader for lava effects using Maya's material editor, called Hypershade. For this tutorial I recommend basic knowledge about connecting material nodes inside Hypershade. ![]() So for the lava effect, we will use the following procedural 3D textures: - Stucco - SolidFractal - Granite Also, we are going to use the following Utility Nodes: - MultiplyDivide - SetRange - Bump3d - Displacement - Luminance - 3D texture placement First, create plane (NURBS or poly), and assign a lambert shader to it. ![]() Go to Hypershade, graph the network of lambert material(lambert4 in my case, in yours will be lambert2 if you started with a blank scene), don't use lambert1. Create stucco node (under 3D textures tab) Stucco and the 3D placement node shall pop near the material. Also, open the Attribute Editor for stucco (ctrl+a) Change shaker attribute to 30, and change channel1 to black and channel2 to orange. Connect Stucco to the incandescence of the material. ![]() Create Fractal texture (also under 3D textures) Open color balance tab and click to change the color gain attribute. In the color wheel, make the color orange. In the HSV sliders under the wheel, change V to 2.5 (basically the color goes higher than the actual color range, use this every time you need to create fire and explosions). ![]() Connect Fractal to the channel2 of the stucco. You can do that easily by selecting the stucco, and then dragging fractal to the channel2 color (black rectangle). Now you are starting to get something that looks like lava! ![]() If you go to the persp view, you'll see nothing. You can go to the material attributes and turn on hardware texturing for incandescence channel, but the result will be ugly even at 256x256. Instead, I prefer going in High Quality (in the viewport menu bar shading/High Quality Rendering option box). This mode works only if you have pixel shaders, and will display color/incandescence/bump all together. ![]() In the options, change color resolution to 256 and bump to 512. Hit the Set button! ![]() After a few moments, you will get nice hardware display. But now you can notice that there's no color from the lighting (just gray), and also there's no bump. So let's get to it. ![]() Back to Hypershade, create another stucco node, change it's shaker attribute also to 30. Select placement of that new stucco and delete it! ![]() Now connect the placement of the first stucco with the second stucco (just MMB drag from placement to texture and a small menu will pop up - choose default) Also connect the second stucco to the material color attribute. * Some of the names of the nodes maybe won't match with the names of the ones you've created, but I don't want to bother you with renaming nodes: I'll call the stucco we created first, incandescence stucco, since it's connected to incandescence. I'll call the second stucco, color stucco, since it's connected to color. ![]() Now create Granite texture (also 3D texture), and change it's attributes like I did. ![]() Connect the Granite to channel1 with the "color stucco". ![]() Make Multiply/Divide node (under general utilites), and connect Granite.OutColor to the MultiplyDivide.input1. Change input2 to 0.5, 0.5, 0.5. ![]() Connect MutiplyDivide.output to channel1 ot the "incandescence stucco". * MiltiplyDivide node is reducing strength of Grainite color to a half, so it will shine a bit in the incandescence. You can change input2 as you wish, feel free to tweak the lava colors more. ![]() Also you can select Granite placement and scale it in viewport to get it to the size of granite you want. If the viewport is in High Quality mode, you can do this interactively. I've scaled the placement node about 4 times. ![]() If you render now, you should get something like this: ![]() Create another stucco texture and delete its' placement, than connect the placement of the first to that new stucco (like you did with the second stucco node), Change shaker to 30, and make channel1 white, and channel2 black (so that channel1 is higher then channel2) ![]() Connect the third stucco to the bump of the material (bump3D node will be automaticly created). * This stucco node I will call bump stucco ![]() Create Set Range node (under general utilites), and connect granite to the setRange node (just MMB drag from Granite to SetRange node, a menu will pop up, choose value). ![]() In the SetRange node enter these values: OldMin: 0,0,0 OldMax 1,1,1 Min 0.6,0.6,0.6 Max 1,1,1 ![]() Connect SetRange.OutValue to channel1 of the "bump stucco" ![]() Create another SetRange Utility and connect SolidFractal to it. Enter: OldMin: 0,0,0 OldMax 1,1,1 Min 0,0,0 Max 0.4,0.4,0.4 Connect that SetRange Node to channel2 of "bump stucco" * I did this thing with set range nodes to compress textures to selected color range, so the height of channel 1 will not go over 0.4 (that's hot lava height) and the height of the channel2 will go from 0.6 to 1 (that's cold lava). ![]() Now you can preview bump in either viewport or render view. You can see, that bump alone is not enough so we are going to add some displacement. You can add some lights to see the bump a little better. ![]() ![]() Create MiltiplyDivide node and connect the "bump stucco" to Input1 of the MultiplyDivide Node. Input2 will control displacement height, so I entered 0.5 to make displacement lower, but you can change this number as you wish. ![]() Now Create Luminance node (under Color utilites), and connect MultiplyDivide to it. Then connect Luminance node to material displacement attribute (again MMB from Luminance to material (lambert), then choose displacement). * You cannot plug MultiplyDivide directly into displacement, since displacement works only with alpha information (grayscale). So we are going to converting RGB of the MultplyDivide to Grayscale information using the Luminance Node. ![]() Now if you graph network on the material, you can see that Maya has connected Luminance directly to the displacement shader attribute of the Shading Group. This is bad! ![]() Delete that connection and create Displacement node (under Displacement), and connect luminance to it. Then connect that displacement node to the shading group. ![]() And the last thing ?Glow. For the glow, create MultiplyDivide and connect "incandescence stucco" to input1 of that MultiplyDivide. Input2 should be 0.2 less, basically that number controls the strength of the glow. Create Luminance node, and connect MultiplyDivide to it, and connect that Luminance to material GlowIntensity. ![]() So in the end, you get a shading network that looks like this. Simple eh? ![]() * As you can see, there is only one placement for all three stucco nodes. I did that because this way, you can change the size of lava without having to grab three placement nodes. Also I left SolidFractal and granite Placements separated because they are not the same sizes and of course if you want you can animate SolidFractal movement so you can get the effect of hot lava moving beneath the cold lava. Then set your displacement values. I used mental ray and made a displacement approximation node, to get nice displacement. You should get a render like this: ![]() ![]() Enjoy! |
| How do you make the awesome walls? |
| Thank you so much, very nice shader tut. |
| hi friends this is really nice creating |
| HEY DUDE ITS REALLY THE NICE ONE AND I WAS IN DESPERATE NEED OF THIS THING U ROCK |
| it is very good... |
| Thanks! Great tutorial! |
| thats great tut man thanks alot for it =D, although i stuffed up my bump map somewhere lol, |
| great, simply great. The best way to spend my drunk nights. It works at once. |
| exelent |
| its gr8..and fun.i spent my whole night on this.a wonderful glimpse of all utilities..must read |
| I cant get it to glow in metal ray=( and for you anonymous who cant get it to glow are you rendering with metal ray |
| my english is so bad :P but it's a great tutorial thanks =) |
| exelent-you are a genias |
| Thanks very usefull!! |
| Problem. The lava moves at a rate depending on the speed of the camera. when the camera is still the lave is there for still this is a problem in production when you have the lava in multi shots and some are moving cams and some are not also even worse when the camera moves then holds. So, How will we make the lava either always move or always still. I guess I could animate one of the placement nodes to make it move all the time. |
| i liked your method and it worked for me but can it be more simpler then this ? |
| i am having problems getting th lava to glow. I have done everything you have stated above, i have changed parameters, but still no glow. Can you help? |
| no |