Dota 2
Not enough ratings
Blender Cycles Dota 2 Shader Node Usage
By Kirbinator
Using Blender is fine. Modeling for Blender is fine. Rendering Dota 2 styled images in Blender cycles is...difficult. I'm posted a Material node to help with that regard, and here is how it is used. In time, you should be able to easily make kicka** promo pics.
   
Award
Favorite
Favorited
Unfavorite
Preamble
So you got your model, you uploaded it to the Workshop…now what? Ideally, you should make some advertising material to get the word out, and get dem upvotes. If you got 3DS max or Maya, it is pretty straightforward. If you got Blender, however…
For many of us who do not have the budgets or commitment for 3D modeling software, Blender offers a great entry into the world of 3D for little to no risk. It is extremely fast, stable, and its interface has come lightyears (!!!) from where it used to be, even surpassing some of the bigger names in certain areas. However, doing certain things is still very painful. One of those things at times: complex rendering. Fortunately, the good folks at the blender foundation had the foresight to see this coming, and made most of blender scriptable and repeatable.

On the flip side, Dota 2 models have a lot that go into them. They can be made of many parts, have different textures for each part, and have multiple separate textures defining effects. This is where the Cycles Dota2 Shader Approximation Node enters the scene.
But first, a few things out of the way about…
…Blender
Blender is a free (as in beer and freedom) 3D production suite. It can be downloaded here:
http://www.blender.org

…Cycles
Cycles is an “unbiased” render, and officially the core renderer, of Blender 2.5+ (current version is 2.68 at time of writing). Unbiased means that the renderer is actually simulating light, by tracing lines between surfaces and light sources (referred to as ray-tracing). This is good and bad. It is good because you get ultra-realistic, detailed and complicated renders. It is bad because Dota2 natively is neither.

…GIMP
The GIMP 2 is a free (in both ways) image editor suite. It will be used for certain aspects of the texture. It can be downloaded here:
http://www.gimp.org/



Getting and Adding the Node
The first order of business is to download the node. It can be downloaded here:
http://www.blendswap.com/blends/view/69403#comment-42945

You will have to login to download, but the account is free.

The next order of business is to open your model. If you don’t have one, use one of the characters from the workshop page here: http://www.dota2.com/workshop/requirements

. You will need to import the models with the blender smd importer from here:

https://code.google.com/p/blender-smd/
…or just use your own model, whatever

Once the models are ready, we need to add the material node to blender’s repertoire.
Go to File at the top left, then click Append.


Find the blend file you downloaded, and click it. You will be presented with a folder view. Choose “NodeTree”, then “DOTA2-Shader-Appro”. Click Link/Append from Library.
To make sure that it was included correctly, go to the Nodes window, make sure that material is selected (the globe in the set of icons that includes a red checker and photos), and click add. Hovering your mouse above “Group” should reveal a node called DOTA2-Shader-Approx.


The node is now ready to be added to a material.
Hooking up the Node
The first thing you need to do is make sure the model you are applying the shader to is selected. Then, open up the node browser and turn on materials mode (the globe next to the checkerboard). Actually click on the button referenced to on the picture above. This should show up:

This node does a lot of things to get models to look more valve-y. While a true Dota 2 shader is not yet possible with Cycles, we can fake it pretty well with this node and some tricks.
Using weaver as an example, he normally looks like this, with a straight diffuse-normal setup.

Notice the lack of shadow detail on the ridges.


But the node I’m providing does a lot of stuff, including the glowing eyes, brighter lighting, gloss color mixing, and more interesting shadows.


It’s just a matter of providing the correct information in the form of textures. Before you do anything, click add->output->material output on the nodes window, and hook up the shader approximator node up to it. Then click add->input->Texture Coordinates. You will need this in a moment.
From here on out, it is a fairly rote process. Click add->Texture->image Texture for each texture that is required. Then click the folder and find the needed image. Hook up this node to the input described. There is one special case that needs to be handled however, but we will get to that in a moment.

  • connect input marked “Normal map” (yellow) to the image texture using the normal map (suffix _normal).
  • connect input marked “Texture” to the image texture node using the color map (suffix _color)
  • connect input marked “Mask2” to the node that has the image texture with mask 2 (suffix _masks1)
  • connect input marked “mask1” to the node that has the image texture with mask1 (suffix _masks2).
  • connect ALL image texture nodes’ vector input to the output marked UV on the Texture coordinate node
  • The camera ViewAngl input currently does nothing.

  • If your model has any glowing or lightmap components, it will need to be extracted from mask1.

For light maps, this is where GIMP enters the picture.

For weaver, it is only his glowing eyes, so I open up “weaver_masks1.tga” on GIMP. Go to “color->componants->Decompose”. On the pop up window, ensure the color mode is “RGBA”.

Ensure that only the alpha layer is visible, then press Ctrl+e to export the image as whatever you like. Add the image Texture like you did the others, and hook it up to the illum-Mask input. Remember the UV input for the texture. It should look similar to this when done:


At this point, repeat for all parts and items for the hero, and you are done with the material part.


Tips on Lighting
Lighting makes a scene, so I will not give specific steps here. Here are some things to keep in mind...

As mentioned before, Valve uses something called Half-Lambert as a shader. This means models are lit brighter than their real world counterparts.

Here's a comparison to Blender's Fresnel and Half-Lamberrt

Since Blender does not give access to this physical ruleset, we have to fake it a little. I went about lighting weaver with a few planes with emit shaders on them for ambience, then I put some point lights fairly close to him. Point-lights are useful in this regard, as they do not render as a physical object, and can be put wherever needed. Just don’t get them too close, or your model will appear glossy.

The gloss on his right antennae is what I'm warning against. Otherwise good

A light box as shown here will increase render complexity and render time. You may want to consider compositing in backgrounds to save time.

If you plan on doing animations, parent the point lights to the armature.

The light source coming from the light mask should not go above 20 units. Remember, the way this renderer works, the model is actually emitting light. Going too high will add to the complexity of the scene and increase render time, not to mention look bad.
Tips on Rendering
Before you start taking stock in your renders, go to the scene pane on the right and set units to “meters”.



Now, press space bar and type “add cube”. The cube that is spit out is 1x1x1 meters. Your character should not exceed the dimensions of a 2x2x2 version of this cube. Scale up or down as needed. The renderer does care.

While Progressive rendering does work alright, turning it off and tweaking the aspects of the render process may increase the quality/decrease render time. These settings worked for me and weaver here, but YMMV . Tweak as needed.


As with anything cycles, more samples means better quality, but be aware of the point of diminishing returns.

With that, you are on your own.
Potential Issues
Blender’s PNG/TGA interpreter can get overloaded sometimes. If you find a texture is interpreted as a flat purple, make sure it is referencing a valid file, and fail that, convert the image to a .jpg .
Notes


“Why isn’t there rimlighting? Why can’t you just port what those people at polycount did?”

I am aware of a the Dota 2 shader for Max/Maya. If you want that, buy Max/Maya. And let it be known, dear reader, that I spent a week trying. Only to find out Blender has made it mathematically impossible and/or user unfriendly to add Half-Lambert to it in any way. The blender folks themselves will have to add the core shader. Until then, don’t hold your breath.

“Why did you do X when Y makes it faster/better/stronger”

Post a comment. I’ll take a look.

“Why Blendswap?”

*shrug*

“Why do I have to do this thing in GIMP?”

You don’t, but you do need to separate the Alpha layer from the rest of the mask. Blender materials has no way of doing that normally. In Photoshop, you can just hide the other color channels and export the result.

“How do I do X in Blender?”

I will now leave you to the power of the internet.[lmgtfy.com]

Why do this at all?

I find the lack of Dota 2 GIFs disturbing.


Weaving like a BOSS

10 Comments
ORISEN 20 Jan, 2019 @ 11:26pm 
Blender 2.8 is the best program ever made so and is free now we can say blender is complete noting bits this any more
Kirbinator  [author] 20 Jan, 2015 @ 9:00pm 
;-)
Kirbinator  [author] 14 Jan, 2015 @ 9:29pm 
There are no Dota 2 importer plugins for anything, ever. I've looked. MESA streamlines and compiles your models, but SURPRISE, to get it in game you need to go through the official importer at some point anyway.

Also be aware that the licenses for student versions of Autodesk software prohibits making money off of the software, and Autodesk does enforce this aspect of their licenses.
Kirbinator  [author] 13 Jan, 2015 @ 4:51pm 
DA BEST program to use would be Autodesk Maya. I don't recommend that for beginners as it is a $360+ investment. Blender is good for learning.
Moltar 16 Aug, 2014 @ 2:28pm 
what about mask_2 ? how would we make that in gimp?
Uriyel 10 Jun, 2014 @ 6:59pm 
Every search online leads me back to this shader which is nice, but for the life of me I can't get the alpha masks to work. The wings on this skywrath mage have that black border around the feathers.
Kirbinator  [author] 4 Sep, 2013 @ 6:55pm 
Yeah, turns out nodes aren't saved if they aren't applied to anything now. It really should work now, thanks for the heads up.
76561198099041070 3 Sep, 2013 @ 11:17pm 
Hey Kirbinator, for me, it still does not work. There are more folders in the .blend file now, but there is still no NodeTree. Do you have some local references maybe? (if you want to reproduce my case, just download Blender 2.68a 64bit zip version (I also tried all 2.67 zip versions, 32/64) and append it with that)
Kirbinator  [author] 3 Sep, 2013 @ 7:02pm 
There was an error in the file, try now.:B1:
76561198099041070 3 Sep, 2013 @ 7:41am 
Hi Kirbinator, when I try to append your file in Blender 2.68a 64bit, I cannot see any “NodeTree” or “DOTA2-Shader-Appro” folders. Could you explain how to do it in more detail please?